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 |
瀏覽器相容性
載入中…