HTML5视频尺寸

艾略特:

我正在尝试获取要用JavaScript覆盖到页面上的视频的尺寸,但是它返回的是海报图像的尺寸,而不是实际的视频,因为它似乎是在加载视频之前计算出来的。

ŠimeVidas:
<video id="foo" src="foo.mp4"></video>

var vid = document.getElementById("foo");
vid.videoHeight; // returns the intrinsic height of the video
vid.videoWidth; // returns the intrinsic width of the video

规格:https//html.spec.whatwg.org/multipage/embedded-content.html#the-video-element

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章