PageResource.com - Web Development Tutorials

HTML5 Video Tutorial

The good news is that with the <video> tag you no longer need plugins. The not so great news is that at the moment different browsers support different formats.  If you are going to use the <video> tag, it is best to offer different versions of your video so that the browser can choose the appropriate one.

         -> See live example Here

There are three formats that are supported by different browsers. They are:

Ogg/ogv (Theora video codec and Vorbis audio codec)

MPEG4 (H.264 video codec and AAC audio codec)

WebM (VP8 video codec and Vorbis audio codec)

Here is an example of a how to post a video with a fixed width and height. The example as you can see also allow for a control bar and automatic looping of the video.

<video width= "320px" height= "240px" controls= "controls" loop= "loop" >

<source src= "multimedia/nebula.ogv" />

<source src= "multimedia/nebula.mp4" />

</video>

As of now the style and resizing options (fullscreen/pop out) are browser dependent.  Here is what the video will look like in a browser that supports the HTML5 <video> tag. (The example is just an image not a working video file.)

Take a closer look at the Video Tag Attributes.

One Response to “HTML5 Video Tutorial”

  1. paul Says:

    live example does NOT work in FireFox 7 ( other html5 sites DO work ). It DOES work on my ie 9.

    [Reply]

Leave a Reply


Copyright © The Web Design Resource. All rights reserved. | Contact Us | Privacy Policy