Tuesday, August 21, 2012

Firefox: Play Youtube videos with mplayer

I think everybody who has ever suffered through flash on Linux systems, know how horribly awful it truly can be. Fortunately things have gotten better, but not by much. I still see the flash-plugin crash randomly across several different systems that I use. There is always the choice of using html5 to play youtube videos now, but it requires quite some processing power. In my case that means that I can not use html5 to play youtube videos on my Netbooks, because it feels like turning the pages in a newspaper.

This is where mplayer comes in, since it can play pretty much every video format out there (including flash videos) and it does it really well.


Thing we need to install


To get Firefox running on a Linux desktop to play youtube video with mplayer there are a few tools we need to install. 

gecko-mediaplayer

With gecko-mediplayer installed.
Depending your Linux distribution this step may vary. But as far as I know almost every Linux distribution has this package in their repos. So go ahead and install "gecko-mediaplayer".

$ sudo apt-get install gecko-mediaplayer

Greasemonkey

Next we need to install a Firefox add-on called "greasemonkey". This add-on by itself does nothing. But it allows you to install scripts which can do all kinds of things.

https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/

Viewtube userscript

This is where the actual magic happens. This script reformats the youtube video pages and gives you some options on how you would like to play them. So go ahead and install it. You can see if it is active with the Greasemonkey add-on.

http://userscripts.org/scripts/show/87011

Final Notes

This may not be the most ideal solution. But it is one that I have found works really well on slow hardware. Especially if you compile mplayer yourself for your specific hardware.

I should point out that this also allows you to play direct download links to video files inside your browser as well. Not many sites actually provide direct download links to videos anymore but if they do you now can play them directly in the browser rather than download and then play them.




No comments:

Post a Comment