HTML: The Markup Language

videovideo NEW # T

The video element represents a video or movie.

Permitted content #

Transparent, with the following specific structure:

a src attribute, or zero or more source elements followed by flow content

or

a src attribute, or zero or more source elements followed by phrasing content

Permitted attributes #

Descriptions for attributes specific to this element #

autoplay = "autoplay" or "" (empty string) or empty
Instructs the UA to automatically begin playback of the video as soon as it can do so without stopping.
preload = "preload" or "" (empty string) or empty
Instructs the UA that the author believes that downloading the entire video optimistically will be worthwhile.
controls = "controls" or "" (empty string) or empty
Instructs the UA to expose a user interface for controlling playback of the video.
loop = "loop" or "" (empty string) or empty
Instructs the UA to seek back to the start of the video upon reaching the end.
poster = URI
The address of an image file for the UA to show while no video data is available.
height = positive integer
The height of the video, in CSS pixels.
width = positive integer
The width of the video, in CSS pixels.
src = URI
The URL for the video.

Additional constraints and admonitions #

Tag omission #

A video element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain phrasing elements, any element that can contain flow elements

DOM interface #

interface HTMLVideoElement : HTMLMediaElement {
           attribute DOMString width;
           attribute DOMString height;
  readonly attribute unsigned long videoWidth;
  readonly attribute unsigned long videoHeight;
           attribute DOMString poster;
};