HTML and CSS Reference
In-Depth Information
As you can see in Table 5-2 , currently there is not a single format that can be used
across all major web browsers. It's a shame that Microsoft and Apple have not rallied
behind WebM or Ogg, 8 but the reality of the current landscape of native browser video
is such that web developers have to deal with delivering multiple formats for the same
video file, if broad browser compatibility is a concern. We'll see how to do this after
we've had a look at licensing issues.
The licensing issue
In addition to browser support issues, there is another issue to be aware of in regard
to codecs. The codecs in MPEG-4, H.264, and ACC contain patented technology. This
means certain uses of these formats are subject to royalty fees by the MPEG LA con-
sortium, which holds the rights to these patents. You'll be fine streaming these videos
for free on the Web, but it will be a different scenario if you wanted to charge users
to view videos in this format or provided technology that decoded or encoded video in
these formats. WebM and Ogg, on the other hand, are both open formats, unencumbered
by any known patents.
Handling video sources
If you're delivering only one video, the markup is about as easy as placing an image
on the page. The video file is supplied in the src attribute. Like img , a width and
height are also advisable to set, but make sure it matches the aspect ratio of the video
7 Don't lose all faith in the information I'm providing if you launch Google Chrome and find it
doesn't run MPEG-4 video. Support has traditionally been included in Chrome, but Google has
since pledged to remove support for H.264-encoded video in favor of the other two open formats,
so going forward it can't reliably be said to support this format.
8 There are ways to make Internet Explorer 9 and Safari support at least WebM, but it requires in-
stalling additional software that does not ship with the browsers, which is by no means an option
to rely on when deciding how to deliver your video content to users in these browsers.
However, this does not provide any fallback content for browsers that don't support
the WebM format or for browsers that don't support the video element. To provide
multiple source files for the video, another element, the source element, is used to
provide alternative content. The source element has three attributes: src , type , and
Search WWH ::

Custom Search