HTML <video> Tag

Description


The <video> HTML element is used to specify video on an HTML document. For example, you could embed a music video on your web page for your visitors to listen to and watch.
Any content between the opening and closing <video> tags is fallback content. This content is displayed only by browsers that don't support the <video> tag.

Properties

Permitted Parents
Any element that accepts embedded content
Content
<source>, <track>, and text
Start/End Tags
Start tag: required, End tag: required

Example

<video width="300" height="240" controls>
<source src="audio/toy.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>

Attributes

Attribute Definition
autoplay Specifies that the video will start playing as soon as it is ready
buffered An attribute you can read to determine the time ranges of the buffered media.
controls Specifies that video controls should be displayed (such as a play/pause button etc).
height Sets the height of the video player
loop Specifies that the video will start over again, every time it is finished
muted Specifies that the audio output of the video should be muted
poster Specifies an image to be shown while the video is downloading, or until the user hits the play button
preload Specifies if and how the author thinks the video should be loaded when the page loads
src Specifies the URL of the video file
width Sets the width of the video player

Global Attributes

The <video> tag also supports the Global Attributes in HTML5

Event Attributes

The <video> tag also supports the Event Attributes in HTML5

Browser Support

Desktop
Explorer Edge Chrome Firefox Opera Safari
9Yes33.510.53.1
Tablets / Mobile
Android Chrome Firefox Opera Safari Samsung
YesYes4YesYesYes

Last updated by CSSPortal on: 6th December 2019