HTML and CSS Reference
In-Depth Information
NoTE At time of writing,
Chrome still supports
H.264 but announced it will be
discontinued. Therefore, assume
it won't be supported.
TABLE 4.1 Video codec support in modern browsers.
wEBM
(Vp8 codEc)
Mp4
(H.264 codEc)
ogV
(ogg THEoRA
codEc)
Opera
Ye s
No
Ye s
Firefox
Ye s
No
Ye s
Chrome
Ye s
Ye s — s e e N o t e , support
will be discontinued
Ye s
IE9 +
Ye s ( b u t c o d e c m u s t
be installed manually)
Ye s
No
Safari
No
Ye s
No
Marvel at the amazing coincidence that the only two browsers
that support H.264 are members of the organization that col-
lects royalties for using the codec ( www.mpegla.com/main/
programs/AVC/Pages/Licensors.aspx ).
A similarly fragmented situation exists with audio codecs,
for similar royalty-related reasons (see Table 4.2 ).
TABLE 4.2 Audio codec support in modern browsers.
.ogg/ .ogV
(VoRBIS codEc)
Mp3
Mp4/ M4A
(AAc codEc)
wAV
Opera
Ye s
No
No
Ye s
Firefox
Ye s
No
No
Ye s
Chrome
Ye s
Ye s
Ye s
Ye s
IE9 +
No
Ye s
Ye s
No
Safari
No
Ye s
Ye s
Ye s
The rule is: provide both a royalty-free WebM and an H.264
video, and both a Vorbis and an MP3 version of your audio, so
that nobody gets locked out of your content. Let's not repeat the
mistakes of the old “Best viewed in Netscape Navigator” badges
on sites, or we'll come round and pin a “n00b” badge to your
coat next time you're polishing your FrontPage CD.
NoTE It's possible to
polyfill MP3 support into
Firefox. JSmad ( jsmad.org) is a
JavaScript library that decodes
MP3s on the fly and recon-
structs them for output using the
Audio Data API, although we
wonder about performance on
lower-spec devices. Such an API
is out-of-the-scope of this
book—though we've included
things like geolocation which
aren't part of HTML5, single-
vendor APIs are stretching the
definition too far.
Multiple <source> elements
To d To t h i s , y To u n e e d t To e n c To d e y To u r m u l t i m e d i a t w i c e : To n c e
as WebM and once as H.264 in the case of video, and in both
Vorbis and MP3 for audio. Then, you tie these separate versions
of the file to the media element.
 
 
Search WWH ::




Custom Search