HTML and CSS Reference
In-Depth Information
Also note in the preceding snippet the use of the poster attribute, which is set to display an
image in place of the linked object in case it takes a few moments to load. Other video element-
specific attributes like autobuffer can be used to advise the browser to download media
content in the background to improve playback, and autoplay , which when set, will start the
media as soon as it can. A complete example of the video element in action is shown here:
<!DOCTYPE html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title> HTML5 video example </title>
<h1> Simple Video Examples </h1>
<video src=""
width="640" height="360" controls>
<strong> HTML5 video element not supported </strong>
<video width="640" height="360" controls poster="loading.png">
<source src="" type="video/mp4">
<source src="" type="video/ogg">
<strong> HTML5 video element not supported </strong>
The reference section in Chapter 3 shows the complete list of attributes for the video
element supported as of late 2009. Be warned, though, that if the various media markup
efforts of the late 1990s repeat themselves, it is quite likely that there will be an explosion of
attributes, many of which may be specific to a particular browser or media format.
HTML5's audio element is quite similar to the video element. The element should support
common sound formats such as WAV files:
<audio src=""></audio>
In this manner, the audio element looks pretty much the same as Internet Explorer's
proprietary bgsound element. Having the fallback content rely on that proprietary tag
might not be a bad idea:
<bgsound src="">
Search WWH ::

Custom Search