HTMLMediaElement: thuộc tính seekable
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.
Thuộc tính seekable chỉ đọc của các đối tượng HTMLMediaElement trả về một normalized TimeRanges object tĩnh mới đại diện cho phạm vi của tài nguyên phương tiện, nếu có, mà tác nhân người dùng có thể tìm kiếm tại thời điểm thuộc tính seekable được truy cập.
Giá trị
Một normalized TimeRanges object tĩnh mới đại diện cho phạm vi của tài nguyên phương tiện, nếu có, mà tác nhân người dùng có thể tìm kiếm tại thời điểm thuộc tính seekable được truy cập.
Ví dụ
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)]);
}
Đặc tả kỹ thuật
| Specification |
|---|
| HTML> # dom-media-seekable-dev> |
| Media Source Extensions™> # htmlmediaelement-extensions-seekable> |
Tương thích trình duyệt
Xem thêm
HTMLMediaElement: Giao diện dùng để định nghĩa thuộc tínhHTMLMediaElement.seekable- Media Source API
- Media buffering, seeking, and time ranges