HTML and CSS Reference
In-Depth Information
As on an <img> , this attribute points to the fi le to be displayed.
However, because not all browsers can play the same formats,
in production environments you need to have more than one
source fi le. We'll cover this in the next section. Using a single
source fi le with the src attribute is only really useful for rapid
prototyping or for intranet sites where you know the user's
browser and which codecs it supports.
Codecs—the horror, the horror
Early drafts of the HTML5 specification mandated that all browsers
should at least have built-in support for multimedia in two codecs:
Ogg Vorbis for audio and Ogg Theora for movies. Vorbis is a codec
used by services like Spotify, among others, and for audio samples
in games like Microsoft Halo, it's often used with Theora for video
and combined together in the Ogg container format.
However, these codecs were dropped from the HTML5 spec
after Apple and Nokia objected, so the spec makes no rec-
ommendations about codecs at all. This leaves us with a
fragmented situation. Opera and Firefox support Theora and
Vorbis. Safari doesn't, preferring instead to provide native sup-
port for the H.264 video codec and MP3 audio. Microsoft has
announced that IE9 will also support H.264, which is also sup-
ported on iPhone and Android. Google Chrome supports Theora
and H.264 video, and Vorbis and MP3 audio. Confused?
As we were fi nishing this topic, Google announced it is open-
sourcing a video codec called VP8. This is a very high-quality
codec, and when combined with Vorbis in a container format
based on the Matroska format, it's collectively known as "webM".
Opera, Firefox and Chrome have announced it will support it. IE9
will, if the codec is separately installed. VP8 will be included in Ado-
be's Flash Player and every YouTube video will be in webM format.
Like Theora, it's a royalty-free codec. In this chapter, you can
substitute .ogv examples with .webm for high quality video, once
browser support is there.
The rule is: provide both royalty-free (webM or Theora) and
H.264 video in your pages, and both Vorbis and MP3 audio so
Search WWH ::

Custom Search