Saturday, April 11, 2015

Firefox HTML5 Video Fullscreen/Scaling/Resizing Fix

I encountered the most annoying issue on Firefox recently and found a way to fix it, hope it helps someone.

The issue: 
After updating to Firefox 37.0.1, all html5 video from sites like vimeo, embedded html5 videos and even youtube (if you have html5 enabled as playback), stopped properly scaling for fullscreen. You would hit fullscreen, but the video would not resize and you would see black borders/areas on half the screen, the video would stay the default size. Also scaling a page with html5 video via ctrl & + or - would not work either.

The solution:
The culprit is the setting layers.offmainthreadcomposition.enabled when set to FALSE, in about:config. You NEED to set it to TRUE to fix fullscreen scaling or resizing for html5 video.

To fix this problem go to your url bar in firefox, type about:config and press enter, you may get a "here be dragons" warning inside the browser, click "I'll be careful, I promise!"

Now search for layers.offmainthreadcomposition.enabled and make sure it is set to TRUE.

In order for this fix to work, make sure you restart firefox.

Normally layers.offmainthreadcomposition.enabled is already set to true, however you may have set it to false at some point as advised by some forum posts to fix sluggish performance in firefox. Apparently I did just that a long time ago and forgot about it. Ever since Firefox 37, this setting appears to prevent correct resizing of video in firefox for fullscreen.

I really hope that this helps someone, it took me a while to figure this out. I tried searching and didn't find anything. I then ran firefox in safemode (by holding shift when launching firefox) and noticed fullscreen html5 video was working. I didn't want to make a new firefox profile, because I have a lot of things customized. So I started comparing line by line the about:config settings I had versus a default profile [ this can be done quicker by looking over prefs.js, which is inside your firefox profile, on windows it's normally under ...\AppData\Roaming\Mozilla\Firefox\Profiles\YOURPROFILENAME ] Anyways I finally found the issue, after a lot of trial and error.