HTMLVideoElement

Baseline Widely available *

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

* Some parts of this feature may have varying levels of support.

HTMLVideoElement интерфейс предоставляет специальные свойства и методы для манипулирования видео объектов. Он также наследует свойства и методы HTMLMediaElement и HTMLElement.

Список поддерживаемых форматов медиа варьируются из одного браузера в другой. Вы должны либо предоставить ваше видео в одном формате которые поддерживаются всеми актуальными браузерами, или предоставить множественные источники видео в достаточно разных форматах чтобы все браузеры которые вам нужны поддерживали их.

must be a string

Свойства

Inherits properties from its parent, HTMLMediaElement, and HTMLElement.

HTMLVideoElement.height

Is a DOMString that reflects the height HTML attribute, which specifies the height of the display area, in CSS pixels.

HTMLVideoElement.poster

Is a DOMString that reflects the poster HTML attribute, which specifies an image to show while no video data is available.

HTMLVideoElement.videoHeight Только для чтения

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 is HAVE_NOTHING, the value is 0.

HTMLVideoElement.videoWidth Только для чтения

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 is HAVE_NOTHING, the value is 0.

HTMLVideoElement.width

Is a DOMString that reflects the width HTML attribute, which specifies the width of the display area, in CSS pixels.

Gecko-специфичные свойства

HTMLVideoElement.mozParsedFrames Только для чтения Не стандартно

Returns an unsigned long with the count of video frames that have been parsed from the media resource.

HTMLVideoElement.mozDecodedFrames Только для чтения Не стандартно

Returns an unsigned long with the count of parsed video frames that have been decoded into images.

HTMLVideoElement.mozPresentedFrames Только для чтения Не стандартно

Returns an unsigned long with the count of decoded frames that have been presented to the rendering pipeline for painting.

HTMLVideoElement.mozPaintedFrames Только для чтения Не стандартно

Returns an unsigned long with the count of presented frames which were painted on the screen.

HTMLVideoElement.mozFrameDelay Только для чтения Не стандартно

Returns an double with the time which the last painted video frame was late by, in seconds.

HTMLVideoElement.mozHasAudio Только для чтения Не стандартно

Returns a Boolean indicating if there is some audio associated with the video.

Методы

Inherits methods from its parent, HTMLMediaElement, and HTMLElement.

HTMLVideoElement.getVideoPlaybackQuality() Экспериментальная возможность

Returns a VideoPlaybackQuality objects that contains the current playback metrics.

Спецификации

Specification
HTML
# htmlvideoelement

Совместимость с браузерами

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
HTMLVideoElement
cancelVideoFrameCallback
disablePictureInPicture
enterpictureinpicture event
getVideoPlaybackQuality
height
leavepictureinpicture event
mozDecodedFrames
DeprecatedNon-standard
mozFrameDelay
DeprecatedNon-standard
mozHasAudio
DeprecatedNon-standard
mozPaintedFrames
DeprecatedNon-standard
mozParsedFrames
DeprecatedNon-standard
mozPresentedFrames
DeprecatedNon-standard
playsInline
poster
requestPictureInPicture
requestVideoFrameCallback
resize event
videoHeight
videoWidth
width

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
Partial support
Partial support
No support
No support
Non-standard. Check cross-browser support before using.
Deprecated. Not for use in new websites.
See implementation notes.
Has more compatibility info.

Смотрите также