HTMLVideoElement.videoWidth

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.

HTMLVideoElement 接口提供只读的 videoWidth 属性,指示视频的 固有宽度,使用 css 的像素值表示。 简单来说,这是媒体的初始宽度。

参见 HTMLVideoElement.videoHeight > About intrinsic width and height 查看更多细节。

属性

整数值,以 CSS 的像素值指定视频的固有宽度。 如果元素的 readyStateHTMLMediaElement.HAVE_NOTHING,则此属性的值为 0,因为视频和开头帧的大小并不能知道。

规范

Specification
HTML
# dom-video-videowidth-dev

浏览器兼容性

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
videoWidth

Legend

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

Full support
Full support