"> " />
Easy Tutorial
❮ Att Col Align Att Command Radiogroup ❯

HTML <video> Tag

Example

Play a video:

&lt;video width="320" height="240" controls>
    <source src="movie.mp4" type="video/mp4">
    <source src="movie.ogg" type="video/ogg">
    Your browser does not support the video tag.
</video>

Browser Support

The numbers in the table specify the first browser version that supports the attribute.

Element
<video> 4.0 9.0 3.5 4.0 10.5

Tag Definition and Usage

The <video> tag defines a video, such as a movie clip or other video streams.

Currently, the <video> element supports three video formats: MP4, WebM, Ogg.

Browser MP4 WebM Ogg
Internet Explorer YES NO NO
Chrome YES YES YES
Firefox YES <br>Starting from Firefox 21 <br>Linux from Firefox 30 YES YES
Safari YES NO NO
Opera YES <br>Starting from Opera 25 YES YES

Video Format MIME Types

Format MIME-type
MP4 video/mp4
WebM video/webm
Ogg video/ogg

Differences Between HTML 4.01 and HTML5

The <video> tag is new in HTML5.


Tips and Notes

Tip: Text content can be placed between the <video> and </video> tags, which will be displayed by browsers that do not support the <video> element.


Optional Attributes

Attribute Value Description
autoplay New autoplay If present, the video will start playing as soon as it is ready.
controls New controls If present, controls such as a play button are displayed to the user.
height New pixels Sets the height of the video player.
loop New loop If present, the media file will start playing again after it finishes.
muted New muted If present, the audio output of the video is muted.
poster New URL Specifies an image to be shown while the video is downloading, or until the user hits the play button.
preload New auto <br>metadata <br>none If present, the video is loaded on page load and ready to play. If "autoplay" is used, this attribute is ignored.
src New URL The URL of the video to be played.
width New pixels Sets the width of the video player.

Global Attributes

The <video> tag supports HTML's global attributes.


Event Attributes

The <video> tag supports HTML's event attributes.

❮ Att Col Align Att Command Radiogroup ❯