Working your magic with Firefox OS – Playing mp4


Everything you are looking for, about Firefox OS development, is either on the Firefox MarketPlace Developer Hub or on the Mozilla Developer Network. We are also publishing blog posts on our blog, Mozilla Hacks, and I will do it also. Once in a while, I come with questions or code examples I want to share that doesn’t really fit in the hacks blog for different reasons. In that situation, I’ll use my own blog to share with you some of this stuff. Because I like posts series, this one will be named “Working your magic with Firefox OS“.

For the first one, I got an interesting question from a developer last week. He was asking if it’s possible to play mp4 in a Firefox OS application. The answer is yes, and no. You cannot play a mp4 in the <video> tag for security reason, but there is another way to do it: Web Activity. By using this sample code below, you will be able to play a mp4 file.

Keep in mind that for now, it’s not working in the simulator, and it also depends on the codecs on a real device. As an example, it wasn’t working with a file using isom, but it worked well with one using mp42 codec.

Share the love

Twitter Facebook LinkedIn Google Plus


  1. Hi,

    Great we will implement it tomorrow thanks!

    By the way I don’t understand the security issue, what about WebM video that are allowed to be played in tag?


    08/22/2013 09:21AM
  2. Hi
    Thanks for the post. I’m new to Firefox-OS. Can you give some more code or hints how to implement it exactly?

    10/17/2013 09:52AM


Leave a comment

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>