A while back we wrote how to play YouTube videos without Flash with just one click. The second method (my favourite) used to work with any browser but the latest Flash 10.2 breaks it because the cached files are deleted from /tmp (but are still there). With the help of Reddit, I got it working again and with a minor tweak it works with any browser (I've only tested it with Firefox and Chromium).


What is this about really? Using this method to play YouTube videos, you still need Flash installed but all you have to do is start a video in the browser so it's downloaded in the cache but then you can click "pause" (but don't close the tab!), then click a button on your panel (or you can assign a keyboard shortcut or whatever) which will launch that video in VLC or Mplayer.


Here's a video I've recorded showing how this works (I'm using Flash 10.2 in the video):




Setting everything up


1. Create a file in /usr/local/bin, let's call that file "yt":
sudo gedit /usr/local/bin/yt
2. In the file created at step 1, paste this:

#!/bin/bash flashvids() { lsof -p `ps x | awk '/libflashplayer.so\ /{print $1}'` -n 2>/dev/null | perl -lne '@F = split(/ +/, $_, 9); print "/proc/$F[1]/fd/${\($F[3] =~ /(^\d+)/)[0]}" if $F[4] eq "REG" && $F[8] =~ /\(deleted\)$/'; } vlc $(flashvids)
If you want to use Mplayer instead of VLC, replace "vlc" in the last command above, with "mplayer".

Then save the file.

3. Make the file executable:
sudo chmod +x /usr/local/bin/yt
4. Now let's create a launcher for it: right click a Gnome panel, select "Add to panel", add a custom launcher and under "Command", enter this:
/usr/local/bin/yt

That's it! Now when you open a youtube video page in your browser, click pause (don't close the video page!), then click the newly created launcher to play it in VLC or Mplayer.




If you're using Adobe Flash older then 10.2, see the initial post: 2 Ways Of Playing YouTube Videos Without Flash With Just One Click
(CC) www.webupd8.org 2009-2011. | Daily Ubuntu / Linux news and application reviews




Mer ...