{{ APIRef("HTML DOM") }}
The HTMLVideoElement
interface provides special properties and methods for manipulating video objects. It also inherits properties and methods of {{domxref("HTMLMediaElement")}} and {{domxref("HTMLElement")}}.
The list of supported media formats vary from one browser to the other.
Inheritance chain
{{InheritanceDiagram(600, 140)}} {{EmbedLiveSample("Inheritance_chain", 600, 140)}}
Properties
Inherits properties from its parent, {{domxref("HTMLMediaElement")}}, and {{domxref("HTMLElement")}}.
- {{domxref("HTMLVideoElement.height")}}
- Is a {{ domxref("DOMString") }} that reflects the {{ htmlattrxref("height", "video") }} HTML attribute, which specifies the height of the display area, in CSS pixels.
- {{domxref("HTMLVideoElement.poster")}}
- Is a {{ domxref("DOMString") }} that reflects the {{ htmlattrxref("poster", "video") }} HTML attribute, which specifies an image to show while no video data is available.
- {{domxref("HTMLVideoElement.videoHeight")}} {{readonlyInline}}
- Returns an
unsigned long
containing the intrinsic height of the resource in CSS pixels, taking into account the dimensions, aspect ratio, clean aperture, resolution, and so forth, as defined for the format used by the resource. If the element's ready state isHAVE_NOTHING
, the value is0
. - {{domxref("HTMLVideoElement.videoWidth")}} {{readonlyInline}}
- Returns an
unsigned long
containing the intrinsic width of the resource in CSS pixels, taking into account the dimensions, aspect ratio, clean aperture, resolution, and so forth, as defined for the format used by the resource. If the element's ready state isHAVE_NOTHING
, the value is0
. - {{domxref("HTMLVideoElement.width")}}
- Is a {{ domxref("DOMString") }} that reflects the {{ htmlattrxref("width", "video") }} HTML attribute, which specifies the width of the display area, in CSS pixels.
Gecko-specific properties
- {{domxref("HTMLVideoElement.mozParsedFrames")}} {{readonlyInline}}{{non-standard_inline}}
- Returns an
unsigned long
with the count of video frames that have been parsed from the media resource. - {{domxref("HTMLVideoElement.mozDecodedFrames")}} {{readonlyInline}}{{non-standard_inline}}
- Returns an
unsigned long
with the count of parsed video frames that have been decoded into images. - {{domxref("HTMLVideoElement.mozPresentedFrames")}} {{readonlyInline}}{{non-standard_inline}}
- Returns an
unsigned long
with the count of decoded frames that have been presented to the rendering pipeline for painting. - {{domxref("HTMLVideoElement.mozPaintedFrames")}} {{readonlyInline}}{{non-standard_inline}}
- Returns an
unsigned long
with the count of presented frames which were painted on the screen. - {{domxref("HTMLVideoElement.mozFrameDelay")}} {{readonlyInline}}{{non-standard_inline}}
- Returns an
double
with the time which the last painted video frame was late by, in seconds. - {{domxref("HTMLVideoElement.mozHasAudio")}} {{readonlyInline}}{{non-standard_inline}}
- Returns a {{domxref("Boolean")}} indicating if there is some audio associated with the video.
Methods
Inherits methods from its parent, {{domxref("HTMLMediaElement")}}, and {{domxref("HTMLElement")}}.
- {{domxref("HTMLVideoElement.getVideoPlaybackQuality()")}} {{experimental_inline}}
- Returns a {{domxref("VideoPlaybackQuality")}} objects that contains the current playback metrics.
Specifications
Specification | Status | Comment |
---|---|---|
{{SpecName('Media Source Extensions', '#idl-def-HTMLVideoElement', 'Extensions to HTMLVideoElement')}} | {{Spec2("Media Source Extensions")}} | Added the getVideoPlaybackQuality() method. |
{{SpecName('HTML WHATWG', "the-video-element.html#the-video-element", "HTMLAreaElement")}} | {{Spec2('HTML WHATWG')}} | No change from {{SpecName('HTML5 W3C')}}. |
{{SpecName('HTML5 W3C', "embedded-content-0.html#the-video-element", "HTMLAreaElement")}} | {{Spec2('HTML5 W3C')}} | Initial definition. |
Browser compatibility
{{ CompatibilityTable() }}
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | {{CompatVersionUnknown}} | {{ CompatGeckoDesktop("2.0") }} | 9.0 | 10.50 | {{CompatVersionUnknown}} |
mozParsedFrames mozDecodedFrames mozPresentedFrames mozPaintedFrames mozFrameDelay {{non-standard_inline}} |
{{CompatNo}} | {{ CompatGeckoDesktop("5.0") }} | {{CompatNo}} | {{CompatNo}} | {{CompatNo}} |
mozHasAudio {{non-standard_inline}} |
{{CompatNo}} | {{ CompatGeckoDesktop("15.0")}} | {{CompatNo}} | {{CompatNo}} | {{CompatNo}} |
getVideoPlaybackQuality() {{experimental_inline}} |
{{CompatUnknown}} | {{ CompatGeckoDesktop("25.0")}} Behind the media.mediasource.enabled preference, defaulting to false . |
{{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} |
Feature | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Basic support | {{CompatVersionUnknown}} | {{ CompatGeckoMobile("2.0") }} | 9.0 | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} |
mozParsedFrames mozDecodedFrames mozPresentedFrames mozPaintedFrames mozFrameDelay {{non-standard_inline}} |
{{CompatNo}} | {{ CompatGeckoMobile("5.0") }} | {{CompatNo}} | {{CompatNo}} | {{CompatNo}} |
mozHasAudio {{non-standard_inline}} |
{{CompatNo}} | {{ CompatGeckoMobile("15.0")}} | {{CompatNo}} | {{CompatNo}} | {{CompatNo}} |
getVideoPlaybackQuality() {{experimental_inline}} |
{{CompatUnknown}} | {{ CompatGeckoMobile("25.0")}} Behind the media.mediasource.enabled preference, defaulting to false . |
{{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} |
See also
- HTML element implementing this interface: {{ HTMLElement("video") }}.
- Demo of video paint statistics
- Supported media formats