Name
Video — an HTML <video> element
Inherits from
Node, Element, MediaElement
Synopsis
A Video object represents an HTML <video>
element. <video>
and <audio>
elements are very similar
and their common properties and methods are documented in MediaElement. This page documents a handful of
additional properties that are specific to Video objects.
Properties
DOMSettableTokenList
audio
This property specifies audio options for the video. The options are specified as a space-separated list of tokens on the HTML
audio
attribute, and the set is mirrored in JavaScript as a DOMSettableTokenList. At the time of this writing, however, the HTML5 standard defines only one legal token (“muted”), and you can treat this property as a string.unsigned long
height
The onscreen height of the
<video>
element, in CSS pixels. Mirrors the HTMLheight
attribute.string
poster
The URL of an image to be displayed as a “poster frame” before the video begins playing. Mirrors the HTML
poster
attribute.readonly unsigned long
videoHeight
readonly unsigned long
videoWidth
These properties return the intrinsic width and height of the video (i.e., the size of its frames) in CSS pixels. These properties will be zero until the
<video>
element has loaded the video metadata (whilereadyState
is stillHAVE_NOTHING
and the loadedmetadata event has not been dispatched).unsigned long
width
The desired onscreen width of the
<video>
element, in CSS pixels. Mirrors the HTMLwidth
attribute.
Get JavaScript: The Definitive Guide, 6th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.