Sunday, March 14, 2010

TED Fullscreen Video Multiple Monitor Userscript: Yay!

I like to think that I can hack out JavaScript as good as any web developer, but occasionally I still fall into rookie mistakes. For instance, I totally forgot to test my last userscript for fixing Slashdot articles while zooming in anything but my default browser (Google Chrome). In theory it should have worked with Greasemonkey, but when I tried testing it today using Firefox it failed miserably. Luckily with a few code changes I was able to update the script and get it to work with both Firefox and Google Chrome as well as fix a huge bug when visiting Slashdot’s main page as a non-registered user (another thing I probably should have tested!).

Considering that it was my first attempt at a user script I am not too upset and will chalk it up to experience. Tonight my plans for the evening fell apart, so I decided to try and fix a big pet peeve of mine: no multiple monitor support for video players on certain websites. Maybe I am the only one that thinks this is a problem, but I hate it when websites have a Flash or Silverlight video player embedded onto their page and don’t have an option to enlarge the video or open it in a pop-out window. Most people do fine using the fullscreen mode built into the player, but both Silverlight and Flash fail at fullscreen with multiple monitors since they will exit fullscreen as soon as you try and click on something outside the video (for security purposes apparently). This means you can either stop multi-tasking and only watch the video or you have to settle for a small video player that is absolutely tiny on anything larger than 1024 resolution width. For instance: here is a video that a friend brought to my attention as viewed on a 1600x900 LCD TV.

Sample

That is a lot of white space going to waste, and while the fullscreen mode works I often watch videos on the LCD TV while browsing the web on a projector connected to the same computer and end up switching in and out of fullscreen mode multiple times. I’ve had this same problem before with Channel9 and fixed it using a bookmarklet, but that actually requires clicking a link in my favorites every time I loaded a video, which was less than ideal. Now that Chrome supports userscripts I am working on converting some of the bookmarklets that I have into userscripts, and since I already have a working solution for Channel9 I thought that I would try creating one for TED.com next.

So if you ever watch TED videos on a machine with multiple monitors then today is your lucky day.  This userscript will enable multiple monitor fullscreen video for any page that uses the TED.Com flash player. Videos that are embedded from YouTube currently are not supported, but YouTube already lets you increase the width of the player, open it in a pop-out window, or even use the browser’s zoom feature to resize the video so that shouldn’t be a problem. And this time I did do some basic testing in both Firefox and Chrome so hopefully it will work as advertised.

Enjoy!

4 comments:

Julio said...

Hello Greg, First of all thanks for posting your scripts and allow people with no much knowledge of web design to install and use them.

Silly me I was trying to get your script that works superb with TED.com to work in a spanish site but as predicted it did not and I was wondering if you could point me on how could I do the same for that site?

the site iw www.elcarteltv.org and they use Jw Player4.3.132 with Flash player 10

Again thanks a million for all the info

Greg Bray said...

Wow... that website is pretty bad! Lots of iFrames and embeded flash objects. I played around with it for a bit and was able to get a working script. It only works on videos that use the JW Player (not the you tube, ustream.tv, or other videos). Also it will not work in Google Chrome right now due to a bug in window.parent.

You can download it here:

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

Julio said...

man you da man!!!!!, it works a treat with the JW player, that was exactly what I was looking for...like you said the website is really crowded and the problem is that there are so many other video types that you don't know what you going to get, I did a bit of benchmarking and I think aprox 70 of the videos are either JW player or ustream.tv, so if you get the chance to do ustream.tv I think you will have thousands of Spanish speaking people that love to watch Latin-American TV as fans!!!!

Great work Greg!!!

Anonymous said...

I download from ted.com by means of service takeyoutube.com

Post a Comment

Blog.TheG2.Net - Your guide to life in the Internet age.