HTMLMediaElement: seekable 屬性
HTMLMediaElement 物件的只讀屬性 seekable 會返回一個新的靜態的、規範化的 TimeRanges 物件,該物件表示使用者代理在訪問 seekable 屬性時,能夠跳轉到的媒體資源的範圍(如果有的話)。
值
一個代表媒體資源中使用者代理當前可以跳轉到的範圍(如果有的話)的、新的靜態的、規範化的 TimeRanges 物件。
示例
js
const video = document.querySelector("video");
const timeRangesObject = video.seekable;
const timeRanges = [];
// Go through the object and output an array
for (let count = 0; count < timeRangesObject.length; count++) {
timeRanges.push([timeRangesObject.start(count), timeRangesObject.end(count)]);
}
規範
| 規範 |
|---|
| HTML # dom-media-seekable-dev |
| Media Source Extensions™ # htmlmediaelement-extensions-seekable |
瀏覽器相容性
載入中…
另見
HTMLMediaElement:用於定義HTMLMediaElement.seekable屬性的介面- Media Source API
- 媒體緩衝、查詢和時間範圍