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>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title> HTML5 video example </title>
</head>
<body>
<h1> Simple Video Examples </h1>
<video src="http://htmlref.com/ch2/html_5.mp4"
width="640" height="360" controls>
<strong> HTML5 video element not supported </strong>
</video>
<br><br><br>
<video width="640" height="360" controls poster="loading.png">
<source src="http://htmlref.com/ch2/html_5.mp4" type="video/mp4">
<source src="http://htmlref.com/ch2/html_5.ogv" type="video/ogg">
<strong> HTML5 video element not supported </strong>
</video>
</body>
</html>
O NLINE http://htmlref.com/ch2/video.html
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.
<audio>
HTML5's audio element is quite similar to the video element. The element should support
common sound formats such as WAV files:
<audio src="http://htmlref.com/ch2/music.wav"></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:
<audio>
<bgsound src="http://htmlref.com/ch2/music.wav">
</audio>
Search WWH ::




Custom Search