1

I'm using a dual-dual setup and would like to have youtube videos running maximised on one screen while freeing up the other screen for my IDE. However, as soon as I click the mouse the youtube video will revert back to regular size. Is there a work-around for this?

1

mplayer can be given a URL to a video and it will handle the download and display. To get the real URL to a YouTube video, you can use youtube-dl with the user-facing URL (http://youtube.com/watch?v=XXXXXXXX).

So, knowing that, the way I get fullscreen videos under firefox is by using a helper script that feeds the youtube video to mplayer, via the launchy extension that allows sending links to an external application.

To configure launchy, I create a file in ~/.mozilla/firefox/*/chrome/launchy.xml that will create a contextual menu entry in firefox:

<?xml version="1.0" encoding="UTF-8"?>
<configurations xmlns="http://launchy.mozdev.org/configurations">
        <application>
                <label>YouTube to mplayer</label>
                <type>1</type>
                <command>/path/to/bin/yt_mplayer.sh</command>
        </application>
</configurations>

Then, this yt_mplayer.sh script will handle the rest:

#!/bin/bash
URL="${@}"
YT_URL=$( youtube-dl -g "${URL}" )
xterm -T "YouTube-MPlayer from Firefox" -e " \
  echo -e Parameters : \"${URL}\n${YT_URL}\"; \
  mplayer -msgcolor -cache 10000 -cache-min 25 \"${YT_URL}\"; \
  read -p '<Return>' foo \
"

I like to open a xterm to be able to see what's happening with mplayer (especially the buffering stage); that could be skipped if you prefer.

This method has not only the advantage of giving you full control over your video, but also saves CPU cycles as mplayer has much better performance than browser players.

  • Great response -- works a treat! Any idea how you could do the same for non-youtube and/or live streams? – user19082 May 27 '13 at 7:48
  • youtube-dl supports more sites than just youtube (see rg3.github.io/youtube-dl/documentation.html#d4 for a list), but for live streaming, where they often use RTMP, I know of no automated way; often these sites want their stuff to be obfuscated. – Patrice Levesque May 27 '13 at 11:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy