HTML and CSS Reference
As on an <img> , the src attribute points to audio or video
resource, which the browser will play if it supports the specific
codec/container format. Using a single source file with the src
attribute is really only useful for rapid prototyping or for intranet
sites where you know the user's browser and which codecs
However, because not all browsers can play the same formats,
in production environments you need to have more than one
source file. We'll cover this in the next section.
NoTE So long as the http
endpoint is a streaming
resource on the Web, you can
just point the <video> or
<audio> element at it to
stream the content.
Early drafts of the HTML5 specification mandated that all brows-
ers should have built-in support for multimedia in at least two
codecs: Ogg Vorbis for audio and Ogg Theora for movies. Vor-
bis is a codec used by services like Spotify, among others, and
for audio samples in games like Microsoft Halo.
However, these requirements for default format support were
dropped from the HTML5 spec after Apple and Nokia objected,
so the spec makes no recommendations about codecs at all.
This leaves us with a fragmented situation, with different brows-
ers opting for different formats, based on their ideological and
Currently, there are two main container/codec combinations
that developers need to be aware of: the new WebM format
that Google bought for $104 million and open licensed, and the
ubiquitous MP4 format that contains the royalty-encumbered
H.264 codec. H.264 is royalty-encumbered because, in some
circumstances, you must pay its owners if you post videos that
use that codec. We're not lawyers so can't give you guidance on
which circumstances apply to you. Go to www.mpegla.com and
have your people talk to their people's people.
In our handy cut-out-and-lose chart ( Table 4.1 ), we also include
the Ogg Theora codec for historical reasons—but it's really
only useful if you want to include support for older versions
of browsers with initial <video> element support like Firefox 3.x
and Opera 10.x.