HTML and CSS Reference
In-Depth Information
In addition to the attributes discussed so far, you can use the height and width attributes to control
the dimensions of the video player.
n Note HTML5 <audio> and <video> elements don't hide the location of the media file from the end user. Just
like an image, you can easily save a media file that's being played by looking at the web page's HTML source and
grabbing the file URL or by right-clicking the video player and choosing the Save As menu option.
Supported Audio and Video Formats
In the preceding sections, you worked with the <audio> and <video> tags to display audio and video files.
These tags are simple to use, but there is a gray area that you need to be aware of as a web developer: audio
and video formats . Although HTML5 provides native support for audio and video playback, this support
isn't uniform across all browsers. Different browsers don't agree on the audio and video file formats that
can be played. For example, IE9 and Chrome play MP4 files just fine; but if you try to play them in Firefox,
you get the error “Video format or MIME type is not supported” (see Figure 3-5).
Figure 3-5. Firefox is unable to play MP4 files.
n Note You may wonder why not all browsers support all of the popular media formats. There are various reasons
for this lack of support including licensing issues, patenting issues, open standards, and so on. Detailed discussion of
these issues is beyond the scope of this topic.
Before examining browsers and their supported formats, it's worthwhile to look at some of the widely
used media formats on the Web because all the leading browsers support one or more of these formats.
Table 3-1 lists the file formats supported by the leading browsers.
 
Search WWH ::




Custom Search