HTML and CSS Reference
At this time, the iOS supports H.264, and the Android OS supports H.264 and WebM (though
without hardware acceleration). Since Google is making a move away from H.264, we can
assume the Android OS will, eventually, drop support for H.264. Maybe. In addition, the up-
coming release of Windows Phone 7 from Microsoft, codenamed “Mango”, supposedly in-
cludes support for HTML5 video. Since Windows Phone 7 is Microsoft, we have to assume
it will have H.264 support. Nokia is transitioning to Windows Phone 7, but is not offering
HTML5 video and audio in its next release of its built-in Symbian operating system. However,
you can run Opera Mobile on Symbian/S60, and get HTML5 video and audio support. Opera
supports only Ogg and WebM. Blackberry supports H.264 video, but not the HTML5 video
element—you'll have to use a link.
What we can take away from all of this is that to support mobile devices, you'll need to
provide appropriately sized video files, as well as include support for both WebM/Ogg Theora
and H.264. But not just any H.264. You need to provide videos encoded with the right profile.
Media Profiles and Codec Parameters
Since H.264 was designed to meet the needs of large television sets to small mobile phones,
H.264 incorporates a concept known as a profile. Each profile defines a set of optional fea-
tures, balanced against the file size. The more the video relies on the hardware, the smaller the
file size. H.264 supports 17 profiles, but the ones we're interested in are baseline , main , ex-
tended , and high. As you would expect, the hardware requirements for each increases from
baseline to high.
Different devices support different protocols. Microsoft supports all H.264 profiles, but Safari
only supports the main profile, because that's all QuickTime supports by default. Mobile
devices, such as those running iOS and the Android OS, run the baseline profile. If your site
needs to provide both mobile and larger videos, you may want to encode several versions with
different H.264 videos. It's actually simple to ensure the right encoding, because most conver-
sion tools provide device profile presets (more on this later in the chapter).
The WHATWG Wiki provides a page giving several different type codec parameters, at ht-
In order to ensure that each device knows which video works best for it (without having to
load the video's metadata and extract the information), you can provide the information direc-
tly in the source element's type attribute. An example of the syntax to use is the following,
for an Ogg Theora video file: