Using HTML5 Video

In order to deliver video to all devices (Desktop, mobile, tablet), that is not served from a 3rd party like Youtube or Vimeo, we need to use the HTML5 <video>  element.

The trouble is, Firefox and Safari/Chrome don’t quite agree when it comes to the file format for videos. In order to deliver video to Firefox 4+, Safari4+, Chome11+ and IE9+, we need 2 video formats (.mp4 and .ogg) and 2 video players (HTML5 and Flash).


This makes Safari/Chrome happy (iOS devices as well). Make sure it’s encoded using H.246, which is the important part.


This makes Firefox Happy, but only if the file is served by the server with the “video/ogg” mime type, which is not usually a part of the standard configuration. Add the mime type to .htaccess for this.

Video Players (HTML5 Video, Flash)

Not all browsers support HTML 5 video, of course. To compensate, I use “Flowplayer“, a fallback Flash version, that uses the .mp4 encoded file. The Flash player is used for all browsers that don’t recognize the <video> element.

The final problem is that we can’t just use .mp4 for the iOS devices and fall back to Flash for Firefox, because Firefox understands the video element, looks for a src it can read and just sits if it doesn’t find one. It won’t use the fallback.


  1. Make one version that uses Theora video and Vorbis audio in an Ogg container.
  2. Make another version that uses H.264 baseline video and AAC “low complexity” audio in an MP4 container. (This version will also work in the Flash Player for IE and older browsers.)

Create the .ogg version

  1. Use ffmpeg2theora (it’s a command line encoder) to convert the video.
  2. My command was as follows:
    ffmpeg2theora -v 7 --soft-target -V 2500 -x 1024 -y 432 -a 5 /Users/ben/
    (Just type ffmpeg2theora at the command line for help with the params)

Create the .mp4 version

  1. Use Handbrake with the “Apple > Universal” preset. The iPad has certain limitations about what type of video settings should be used. See also this article at stackoverflow.
  2. Change the extension .mp4 (It’s exactly the same internals as .m4v, but for some reason it’s the standard extension) More here.
  3. Check the “Web optimized” checkbox under “Output Settings” just below.
  4. Process the video.


I’m using Video for Everybody and videojs to format the HTML5 player with a Flash (Flowplayer) fallback.

40 Responses to “Using HTML5 Video”

  1. Richie Black

    I must tell you that it’s hard to find your
    articles in google, i found this one on 15 spot,
    you should build some quality backlinks in order to rank your site, i know how
    to help you, just search in google – k2 seo tips and tricks

  2. Filomena

    Finally i quit my day job, now i earn a lot of money
    on-line you should try too, just search in google – bluehand roulette

  3. Adrianne

    I see a lot of interesting posts on your website.
    You have to spend a lot of time writing, i know how to save you a lot of time, there
    is a tool that creates high quality, SEO friendly posts in couple of minutes, just search in google – k2 unlimited content

  4. Luis

    I read a lot of interesting articles here. Probably you spend a lot of time writing, i know how to save
    you a lot of time, there is an online tool that creates high
    quality, SEO friendly posts in minutes, just type in google – laranitas free content

  5. history of baseball timeline

    The days of peeling your vegetables with a knife
    have been over since we have been blessed with the peeler.
    Nevertheless, having correctly coated chocolate anytime you want doesn’t mean that you can indulge
    in them indiscriminately. Regardless how big or small the occasion is, you always make
    sure that you furnish guest with sumptuous food and
    delicacies to please them.

  6. online therapist

    I am really enjoying the theme/design of your web site.
    Do you ever run into any browser compatibility
    problems? A handful of my blog audience havve complained
    about my site not working correctly in Explorer but looks great in Chrome.
    Do you have any solutions to help fix this issue?

  7. small business ideas

    Hello, i feel that i saw you visited my web site so i
    came to go back the choose?.I am attempting
    to find issues to enhance my website!I guess its adequate to make use of a few of your ideas!!

  8. Angel

    The final thought of overview speak about purposes as well as
    upkeep as if waist training and also corsets are merely a way to an end, as opposed to a lifestyle change/subculture neighborhood.

  9. dragon mania legends

    His prequels did establish how these events played out, but have
    universally panned as failures. It is quite easy to read the extracts from the book online
    and you must find out more information about the writer and the books before buying them.
    The topic geometry deals with the shapes and sizes
    of any objects.

  10. sexshop

    Great post. I was checking continuously this blog and I’m impressed!
    Very useful info specifically the last part 🙂 I care for such information a lot.
    I was seeking this certain information for a long time.
    Thank you and best of luck.

  11. tee shirt

    Magnificent website. A lot of helpful info here. I am sending it to a few pals
    ans also sharing in delicious. And of course, thanks to your effort!

  12. Emely

    Comply with Johnny Green on Facebook and Twitter Also, be at liberty to e-mail any considerations.

  13. colchon hinchable

    Hi, i believe that i saw you visited my weblog so i got here to go back the
    want?.I’m trying to to find things to improve my web site!I guess its adequate to make use of a few of your ideas!!

  14. reproductor blu ray

    My brother suggested I might like this blog. He used to be entirely right.
    This submit actually made my day. You cann’t consider simply how much time I
    had spent for this information! Thanks!

  15. aspirador escoba

    Your style is very unique compared to other folks
    I have read stuff from. Thank you for posting when you
    have the opportunity, Guess I will just book mark this page.

  16. colchon hinchable

    Write more, thats all I have to say. Literally, it seems as though
    you relied on the video to make your point. You clearly
    know what youre talking about, why waste your intelligence on just posting videos to your site when you
    could be giving us something enlightening to read?

  17. Sports free betting cash back

    Hi, Neat post. There is ann issue with your web ite inn internet explorer, may test this?
    IEstill is the marketplace leader and a large componebt of
    other people will omit your fantastijc writing because of this problem.

  18. top rated dashcams

    A fascinating discussion is definitely worth comment. I think
    that you ought to publish more about this subject matter,
    it might not be a taboo subject but typically people don’t discuss such issues.
    To the next! Kind regards!!

  19. scies sabre classement

    Hello very nice blog!! Man .. Excellent .. Amazing .. I’ll bookmark your
    web site and take the feeds additionally? I am happy to seek out numerous helpful info here in the publish, we’d
    like develop more strategies on this regard, thank you for sharing.
    . . . . .


    Excellent weblog here! Additionally your site so much up
    very fast! What web host are you the usage of?
    Can I am getting your affiliate hyperlink on your host? I
    desire my web site loaded up as fast as yours lol

  21. frigo portatile classifica

    I have to thank you for the efforts you have put in penning this site.
    I really hope to see the same high-grade content from you in the future as well.
    In truth, your creative writing abilities has inspired me to get my own, personal site now 😉

  22. migliore misuratore laser

    After I initially commented I seem to have clicked on the -Notify me when new comments are added- checkbox and now whenever a
    comment is added I recieve four emails with the same comment.
    Is there a way you can remove me from that service?
    Thank you!

  23. Verlene

    naturally like your website however you have to take a look at the spelling on several of your posts.

    Many of them are rife with spelling issues and I in finding it very bothersome to tell the truth nevertheless
    I’ll certainly come back again.

  24. serrurerie

    {formation de plombier {? {||||||| |||||||||plombier|vitrier|plomberie|electricité|serrurier|serrurerie|couvreur|chauffagiste|assainissement}|{||||||| |||||||||plombier|vitrier|plomberie|electricité|serrurier|serrurerie|couvreur|chauffagiste|assainissement} ?}|Pour trouver un plombier,
    faut-il avoir de bons tuyaux {? {||||||| |||||||||plombier|vitrier|plomberie|electricité|serrurier|serrurerie|couvreur|chauffagiste|assainissement}|{||||||| |||||||||plombier|vitrier|plomberie|electricité|serrurier|serrurerie|couvreur|chauffagiste|assainissement} ?}|Profession: Plombier {?
    {||||||| |||||||||plombier|vitrier|plomberie|electricité|serrurier|serrurerie|couvreur|chauffagiste|assainissement}|{||||||| |||||||||plombier|vitrier|plomberie|electricité|serrurier|serrurerie|couvreur|chauffagiste|assainissement} ?}|Un plombier dégrade mon appartement (bloc wc, carrelages) pour accéder à une partie
    commune de mon immeuble|comment Devenir plombier {? {||||||| |||||||||plombier|vitrier|plomberie|electricité|serrurier|serrurerie|couvreur|chauffagiste|assainissement}|{||||||| |||||||||plombier|vitrier|plomberie|electricité|serrurier|serrurerie|couvreur|chauffagiste|assainissement} ?}|Escroquerie plombier {?
    {||||||| |||||||||plombier|vitrier|plomberie|electricité|serrurier|serrurerie|couvreur|chauffagiste|assainissement}|{||||||| |||||||||plombier|vitrier|plomberie|electricité|serrurier|serrurerie|couvreur|chauffagiste|assainissement} ?}|facture de plombier {?
    {||||||| |||||||||plombier|vitrier|plomberie|electricité|serrurier|serrurerie|couvreur|chauffagiste|assainissement}|{||||||| |||||||||plombier|vitrier|plomberie|electricité|serrurier|serrurerie|couvreur|chauffagiste|assainissement} ?}|Si je vous dis ” sourire du plombier ” a quoi pensez vous {?
    {||||||| |||||||||plombier|vitrier|plomberie|electricité|serrurier|serrurerie|couvreur|chauffagiste|assainissement}|{||||||| |||||||||plombier|vitrier|plomberie|electricité|serrurier|serrurerie|couvreur|chauffagiste|assainissement} ?}|Perte de pression au mano – chaudière au fioul – deux plombiers, deux versions {?
    {||||||| |||||||||plombier|vitrier|plomberie|electricité|serrurier|serrurerie|couvreur|chauffagiste|assainissement}}


Leave a Reply

  • (will not be published)