HTML and CSS Reference
In-Depth Information
This is a huge addition to the HTML specification, because video can now be integ-
rated anywhere other HTML elements can be used. For instance, CSS and JavaScript
can interact with the video. However, implementing
video
has not been without its
hurdles. Notably, a standard video format has not emerged, which leads to the need to
encode video in different formats to handle all major web browsers. Let's begin our dis-
cussion there.
Note
The
video
element has quite good support across major video browsers, but if
you want to provide support for older browsers, consider a solution such as that found
video
(and
audio
) element's functionality for older browsers.
Video formats
A video file is potentially a very large (in file size) piece of content to include on a web
page. Outside of the Web, depending on the length and quality a video, a particular clip
could easily stretch into gigabytes in size. Therefore, to display on the Web, a suitable
form of compression needs to be applied to the video to reduce the size to make delivery
over the Internet feasible. The form of compression applied to a video is referred to as
a
codec
. Since video is a multimedia format, in that it can contain video
and
audio, the
codec is only part of what makes up a video file. The video and audio are placed togeth-
er in what is known as a
container
format, which is what the video file actually is. There
are three major container formats for video on the Web: WebM, Ogg, and MPEG-4. The
container format will contain a codec for video compression and a codec for audio com-
pression, plus any metadata about the video, such as subtitles. The codecs used inside a
particular container format can vary, but the commonly used ones on the Web are shown
in
Table 5-2
, along with browser support for these formats.
Search WWH ::
Custom Search