|
|
|
|
|
Audio |
|
|
<audio controls> |
he controls attribute adds audio controls, like play, pause, and
volume. |
|
<source src="horse.mp3" type="audio/mpeg"> |
Multiple <source> elements can link to different audio files. The browser
will use the first recognized format. |
|
<source src="horse.wav" type="audio/wav"> |
|
|
<source src="horse.ogg" type="audio/ogg"> |
Text between the <audio> and </audio> tags will
display in browsers that do not support the <audio> element. |
|
Your browser does not support the audio element. |
Currently, there are 3 supported file formats for the
<audio> element: MP3, Wav, and Ogg |
|
</audio> |
|
|
Video |
|
|
<video width="320" height="240" controls autoplay> |
The controls attribute adds video controls, like play, pause, and
volume. |
|
<source src="movie.mp4" type="video/mp4"> |
It is a good idea to always include width and height attributes. |
|
<source src="movie.ogg" type="video/ogg"> |
If height and width are not set, the browser does not know
the size of the video. The effect will be that the page will change (or
flicker) while the video loads. |
|
<source src="movie.webm" type="video/webm"> |
Text between the <video> and </video> tags will
only display in browsers that do not support the <video> element. |
|
Your browser does not support the video tag. |
Multiple <source> elements can link to different video files. The browser
will use the first recognized format. |
|
</video> |
Currently, there are 3 supported video formats for the
<video> element: MP4, WebM, and Ogg |
|
Audio/Video
DOM |
|
Properties |
controls |
|
Sets or returns whether the audio/video should display
controls (like play/pause etc.) |
|
autoplay |
|
Sets or returns whether the audio/video should start playing
as soon as it is loaded |
|
loop |
|
Sets or returns whether the audio/video should start over
again when finished |
|
Methods |
|
|
Events |
|
|
|
|
|
|