References

Collection of references for web development.

HTML video tag

Description

The HTML <video> element represents an embedded video, the <video> element only supports the ogg, mp4 and webm formats.

Attributes

Attribute Value Description
autoplay boolean Specifies whether the media source should automatically play or not.
buffered TimeRanges Object Determines which time ranges of the media have been buffered.
controls boolean Specifies whether the browser should show controls for the user.
crossorigin anonymous
use-credentials
Allow data from third-party websites that allow cross-origin access so you can reuse it.
height number Specifies the height of the element, default is measured in pixels.
loop boolean If true, the media will continuously start from beginning when it has reached its end.
muted boolean Specifies whether the media should be silenced or not.
played TimeRanges Object Determines the time ranges of the media that have been played.
playsinline boolean Specifies whether the video should be played inline or not.
poster URL Specifies the image to display before the user plays the video.
preload auto
metadata
none
Specifies how the author will think how the media should be loaded.
src URL The URL of the file to embed in the document.
width number Specifies the width of the element, default is measured in pixels.

Example

<video src="video.mp4" width="320" height="240" controls autoplay>Your browser does not support the video tag.</video>

Example #2

<video width="320" height="240" controls>
	<source src="video.mp4" type="video/mp4">
	<source src="video.ogg" type="video/ogg">
	<source src="video.webm" type="video/webm">
</video>