Firefox for Android now supports H.264 video natively on some devices

Nov 30, 2012 10:40 GMT  ·  By

With Firefox 17 for Android safely in the stable channel, Mozilla is detailing one of the new "features" support for the H.264 codec for HTML5 video.

It doesn't work on all devices yet, in fact, you have to be running a very recent version of Android, but more will be added in the future.

Several months ago, Mozilla reluctantly decided to start supporting the license encumbered H.264 codec.

For a while, it had hoped that by supporting only open source, patent free codecs, it would force the web to switch to those better alternatives.

Betrayed by Google, Mozilla lost the fight, the vast majority of video on the web is encoded in H.264 and that's not going to change soon.

In fact, because it wasn't supporting H.264 natively, Firefox was forcing its users to rely on Flash, defeating the whole purpose of switching to HTML5 video in the first place.

After the decision to support H.264 was made, the problem became how to do it.

Support for the codec is not built into Firefox, despite the fact that Mozilla could afford to pay for it, rather the browser will rely on the codec being supported by the operating system it's running on.

For Android, that was relatively easy, since virtually all Android phones support H.264 decoding at the hardware level, it was just a matter of tapping into that.

Firefox relies on the standard Stagefright library for Android to access the hardware decoding capabilities.

For now, it works on any device with Android 4.1 as well as any Samsung device with Android 4.0. More devices will be added once bugs are ironed out and support for the older Android 2.3 is planned as well.

There are ways of enabling H.264 even if you're running an unsupported device, but most likely it won't work or the browser will crash altogether.

If you're willing to take the risk, you can type in about:config in the address bar and search for "stagefright." Set stagefright.force-enabled to true. Mozilla warns that while this may work on Android 4.0 devices, anything else will likely crash.

You can also force-enable hardware decoding, if it's not used by default. Also in about:config find media.stagefright.omxcodec.flags and set it to 16, from the default 0.

Photo Gallery (2 Images)

H.264 video in Firefox
The configuration options to force enable H.264 video in Firefox for Android
Open gallery