A word or two on HTML5 video
What is HTML5?
HTML5 is being developed as the next major revision of HTML (HyperText Markup Language), the core markup language of the World Wide Web. It aims to reduce the need for proprietary plug-in-based rich internet application (RIA) technologies such as Adobe Flash, Microsoft Silverlight, and Sun JavaFX.
Source: Wikipedia
As part of this initiative the HTML video tag is being introduced as well in order to unify the way video is distributed on the web. Currently most online video is distributed via Adobe’s Flash platform, on the contrary of what Apple and Steve Jobs would like you to believe, but we will not go deeper into that debate.
The HTML5 video tag is already supported in several browsers, the latest versions of Firefox, Safari (on all iDevices), Chrome and Opera. It would be great if you had the chance to serve video to all those browsers with the same code, same codecs, but guess what – you can’t, these are standards after all :)
Embedding media in HTML5
Embedding media in HTML5 is fairly simple and straightforward. You just need to use the <video> tag along with the <source> tag to define the path to your media content.
<video controls>
<source src="foo.ogg">
The text written here will be displayed if your browser does not support the <code>video</code> element.
</video>
So far everything looks great, but if I tell you that there is also an option to add many sources in order to assure playback in different browsers the thing starts to smell fishy right.
<video controls>
<source src="foo.ogg" type="video/ogg">
<source src="foo.mp4">
The text written here will be displayed if your browser does not support the <code>video</code> element.
</video>
By adding another source, you can specify the fallback file for browsers that do not chew up videos contained in the ogg () container (usually encoded with the Theora codec).
For more info on how to include HTML5 video and 1001 detail you should read Mozilla’s guide (where I borrowed these examples).
Fragmentation
This is how HTML5 video is supported at the moment of writing (source):
- Mozilla Firefox (3.5 and later) supports Theora video and Vorbis audio in an Ogg container.
- Opera (10.5 and later) supports Theora video and Vorbis audio in an Ogg container.
- Google Chrome (3.0 and later) supports Theora video and Vorbis audio in an Ogg container. Chrome also supports H.264 video (all profiles) and AAC audio (all profiles) in an MP4 container.
- Safari on Macs and Windows PCs (3.0 and later) will support anything that QuickTime supports “out of the box.” This is a long list, but it does not include Theora video, Vorbis audio, or the Ogg container. However, QuickTime does support H.264 video (main profile) and AAC audio in an MP4 container.
- Mobile phones like Apple’s iPhone and Google Android phones support H.264 video (baseline profile) and AAC audio (“low complexity” profile) in an MP4 container.
- Adobe Flash (9.0.60.184 and later) supports H.264 video (all profiles) and AAC audio (all profiles) in an MP4 container.
- Internet Explorer has no HTML5 video support at all (surprised?), but virtually all Internet Explorer users have the Adobe Flash plugin.
Just look at the table if you didn’t get it:
| Codecs/container | Firefox | Opera | Chrome | Safari | iPhone | Android |
|---|---|---|---|---|---|---|
| Theora+Vorbis+Ogg | ✓ | ✓ | ✓ | - | - | - |
| H.264+AAC+MP4 | - | - | ✓ | ✓ | ✓ | ✓ |
To put it simple – if you want your video to play in every browser (on every device) you need to encode it in two different formats (Theora+Vorbis in Ogg for Firefox, Opera and Chrome & H.264+AAC in MP4 for Safari, Mobile Webkit on Android and Flash).
Serving content
All these videos can be hosted on common web servers, the same that you use to host your static files.
Are you feeling dizzy yet? We still have to work out live video streaming, but we will do that in another post (coming soon).







In order to spend some time off-work and relax together we went spent our Sunday shooting other geeks in a 
