HTML and CSS Reference
In-Depth Information
As with audio, you can enable the
standard controls with an attribute:
<video src="00092.webm"
controls preload="metadata">
As with the <audio> element, the preload
attribute provides a hint to the browser
about how likely this video is to be
played by the user.
If you add the autoplay attribute, on
desktop browsers, the video will
download and start playing as soon
as possible:
<video src="00092.webm"
controls autoplay loop>
The controls are available, but they auto-
hide as the video starts playing.
As with the <audio> element, loop only works on the most recent browser
versions, but it can be simulated with the same bit of JavaScript:
Also as with the <audio> element, the <video> element can contain fall-
back content. At the end of this chapter, we'll look at using that content
to embed an alternative player for your videos using a plug-in, falling
back to HTML4 technologies for browsers that don't support HTML5 .
The <video> element also has its own specific attributes: poster , width ,
height , and audio . Let's look at each of those in turn.
The poster attribute lets you control what's shown in the <video> ele-
ment when a video isn't playing. By default, browsers show the first
frame of the video, but you can supply your own image:
Search WWH ::

Custom Search