HTML <video> Tag


Play a video:

<video width="320" height="240" controls>
  <source src="movie.mp4" type="video/mp4">
  <source src="movie.ogg" type="video/ogg">
  Your program does not bolster the video tag.
Try it yourself »

Definition and Usage

The <video> tag indicates video, for example, a film cut or other video streams.

Currently, there are 3 bolstered video designs for the <video> component: MP4, WebM, and Ogg:

Browser MP4 WebM Ogg
Internet Explorer YES NO NO
Firefox YES
from Firefox 21
from Firefox 30 for Linux
Safari YES NO NO
Opera YES
From Opera 25
  • MP4 = MPEG 4 records with H264 video codec and AAC sound codec
  • WebM = WebM records with VP8 video codec and Vorbis sound codec
  • Ogg = Ogg records with Theora video codec and Vorbis sound codec

MIME Types for Video Formats

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

Browser Support

The numbers in the table indicate the main program form that completely bolsters the element.

<video> 4.0 12.0 9.0 3.5 4.0 10.5

Differences Between HTML 4.01 and HTML5

The <video> tag is new in HTML5.

Tips and Notes

Tip: Any content between the <video> and </video> labels will be shown in programs that don't bolster the <video> element.

Optional Attributes

= New in HTML5.

Attribute Value Description
autoplay autoplay Specifies that the video will begin playing when it is ready
controls controls Specifies that video controls ought to be shown, (for example, a play/delay catch etc).
height pixels Sets the stature of the video player
loop loop Specifies that the video will begin once again once more, every time it is finished
muted muted Specifies that the sound yield of the video ought to be muted
poster URL Specifies a picture to be appeared while the video is downloading, or until the client hits the play button
preload auto
Specifies if and how the creator figures the video ought to be stacked when the page loads
src URL Specifies the URL of the video file
width pixels Sets the width of the video player