Example
A simple HTML5 video:
<video src="movie.ogg" controls="controls">
Your browser does not support the video tag.
</video>
Definition and usage
The <video> tag defines a video, such as a movie clip or other video stream.
Differences between HTML 4.01 and HTML 5
The <video> tag is a new tag in HTML 5.
Tips and Notes
Tip: You can place text content between the opening tag and the closing tag so that older browsers can display a message that the tag is not supported.
Properties
new : New attribute in HTML5.
| Properties | 值 | Description |
|---|---|---|
| autoplay | autoplay | If this attribute is present, the video will be played as soon as it is ready. |
| controls | controls | If present, displays a control, such as a play button, to the user. |
| height | pixels | Set the height of the video player. |
| loop | loop | If this attribute is present, playback of the media file will start again after it has finished playing. |
| muted | muted | Specifies that the video's audio output should be muted. |
| poster | URL | Specifies the image that is displayed while the video is downloading, or before the user clicks the play button. |
| preload | preload | If this attribute is present, the video is loaded when the page loads and is ready to be played. If "autoplay" is used, this attribute is ignored. |
| src | url | The URL of the video to play. |
| width | pixels | Set the width of the video player. |