HTMLVideoElement: poster 属性
HTMLVideoElement 接口的 poster 属性是一个字符串,它反映了当没有视频数据可用时要显示的图片的 URL。如果该属性不代表有效的 URL,则不会显示海报帧。
它反映了 <video> 元素的 poster 属性。
值
字符串。
示例
html
<video
id="media"
src="https://example.com/video.mp4"
poster="https://example.com/poster.jpg"></video>
js
const el = document.getElementById("media");
console.log(el.poster); // Output: "https://example.com/poster.jpg"
规范
| 规范 |
|---|
| HTML # dom-video-poster |
浏览器兼容性
加载中…