HTML <video> Tag


The video element is used to embed video material, such as a movie clip or other video streams, in a document.

The <video> element contains one or more <source> tags, each of which has a distinct video source. The browser will use the first source that it recognizes.

Only browsers that do not support the <video> element will see the text between the <video> and </video> tags.

In HTML, three video formats are supported: MP4, WebM, and OGG.

Syntax

Example

Preview

Attributes

Attribute Value Description
autoplay autoplay The video will begin playing as soon as it is ready, according to this setting.
controls controls Specifies whether or not video controls (such as a play/pause button) should be shown.
height pixels Set the video player's height.
loop loop Specifies that the video will begin again whenever it is completed.
muted muted Specifies that the video's audio output should be muted.
poster URL Specifies an image that will be displayed while the movie is downloading or until the user presses the play button.
preload auto 
metadata 
none
Specifies whether or not the author believes the video should be loaded when the page loads.
src URL Specifies the video file's URL.
width pixels This property determines the width of the video player.

Supported Browsers

Element Chrome Firefox Safari Edge / IE Opera
<video> 4.0 3.5 3.1 9.0 11.5