HTML5 and H264 for Firefox on Linux

In some Linux distributions such as Fedora the amazing browser Firefox will ship with some of the video decoders turned off by default, some of it is due to the decoder being in unstable stage or due to some copyrights/patents concerns. In either way trying to play videos that uses one of these formats won’t work even if you have all the packages installed (such as the good, the bad and the ugly gstreamer plugins).

I wanted to make youtube use the HTML5 player instead of the old flash player which is mostly used to track you, show ads and by hackers. Visiting the youtube html5 player page https://www.youtube.com/html5 used to be like this:

Firefox on Linux Youtube HTML5 Player
The items in red means they are missing which caused some youtube videos not be available in HTML5 player, or for the resolution to be limited mostly to a maximum of 720 or lower.

The solution is very simple after installing all needed packages, I got all my decoders for Fedora from RPM Fusion repos, and it is under the Firefox low level configuration page which you can get to by typing about:config in the URL box + Enter (click on the button “I’ll be careful, I promise!” if you see a warning page).

In the configuration page there is a search box at the top that makes it easy to find the settings which you need to change. So first type in “h264” and enable the disabled settings as you see in the picture below:

Firefox H264 decoder settings
Then type in “mp4” and do the same as the picture below:
firefox mediasource settings
Finally, search for “mediasource” and enable it as follows:
firefox mp4 settings
When you are done with the settings revisit the youtube html5 page and it should look like this:
firefox youtube html5
Now you can enable the HTML5 player as a default player and enjoy a faster youtube thanks to HTML5 and have the ability to play all videos in all formats.