Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

Any help appreciated.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

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.

share|improve this answer
    
Great response -- works a treat! Any idea how you could do the same for non-youtube and/or live streams? –  please delete me 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

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.