IE9, Video and HTML5

There is an interesting post (mainly concentrating on various patent issues) on the IE blog that IE will support the H.264 video standard (note that IE9 will also support Google’s WebM format that was looking the best bet until recently through an additional install).

This got me thinking about HTML5 and Video – is this something you should use now?

Hmm well lets start at the beginning.. Html5 contains a Video tag (there is also an Audio one thats very similar) giving you the ability to embed video on a web page.

The below code shows an example of how to do this:

<video id=”Video”   height=”500″ width=”500″>
<source src=”billyBrowsers.ogg” type=’video/ogg; codecs=”theora, vorbis”‘>

Pretty easy huh? There are also a number of other attributes you can add to the Video element such as loop (guess what this does!), controls (left up to the browser to render playback controls).

This has a number of advantages:

  • No plug-in required! (although codec’s are necessary – see IE blog link above)
  • Can be indexed by search engines
  • Video is a DOM element so can be manipulated – Mozilla have a cool example of this.

However not all browsers support HTML 5 yet so whats a dev to do?

Hmm well hopefully you are designing your application using the philosophy of progressive enhancement and one way to outsource the complexity of this is to use a third party player such as SublimeVideo or Open Standard Media player that will attempt to use HTML 5 to play content and fall-back to Flash if necessary.