HTML and CSS Reference
Notice that in the above snippet, a controls attribute is included. h at's so users can stop it
if they want. If you set up a loop with autoplay and embed it in your page, you may lose a lot
of viewers. If you create a loop advertisement, don't expect people to be attracted to the
advertised service or product — they'll notice it, but not in a good way.
h ere is a certain type of loop, more noted in music than in video, that can be useful. If it's
short enough and doesn't have big movements, a loop can take up very few resources and
reuse the same video stored in a cache. A demonstration of a process or even an ad that is not
annoying can be used in this fashion.
Like the loop attribute, the autoplay attribute needs to be used with some forethought
when employed with video. h e autoplay is a combination of preload and automatically
starting the video playing. h e format is a Boolean one and setting the autoplay in the
<video> tag is all it takes to start it.
< video poster = ”wait.jpg” autoplay >
< source src = ”phantom.3gp” >
</ video >
In the above snippet, the user has no control to stop the video from playing, but without a
loop attribute, it will just play once and stop. If the page is meant to be nothing but the video,
it's fairly safe to use autoplay without a controller. Also, the snippet has a poster to let the
view know what's coming, just in case there's a long load. In the context of a Web site when
using autoplay , be sure to include a link for the next page just in case the user doesn't want
to view the video more than once.
h e controls attribute generates a graphic control panel beneath the video. It allows the
user to perform the following functions:
Start the video
Stop the video
Mute the video
Control the sound volume
h e controls attribute is a Boolean and is implemented as shown in the following snippet:
< video controls >
< source src = ”multiformats/mbAux1small.webm” >
</ video >