SourceBuffer: sự kiện bắt đầu cập nhật
Khả dụng hạn chế
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Note: This feature is available in Dedicated Web Workers.
Sự kiện updatestart của giao diện SourceBuffer báo hiệu sự bắt đầu của một thao tác appendBuffer() hoặc remove(). Thuộc tính updating chuyển đổi từ false sang true.
Cú pháp
Sử dụng tên sự kiện trong các phương thức như addEventListener() hoặc đặt thuộc tính xử lý sự kiện.
js
addEventListener("updatestart", (event) => { })
onupdatestart = (event) => { }
Loại sự kiện
Một Event chung.
Ví dụ
>Lắng nghe sự kiện updatestart
js
const sourceBuffer = source.addSourceBuffer(mimeCodec);
sourceBuffer.addEventListener("updatestart", () => {
downloadStatus.textContent = "Modifying buffer...";
});
sourceBuffer.addEventListener("updateend", () => {
downloadStatus.textContent = "Modification complete";
});
Thông số kỹ thuật
| Thông số kỹ thuật |
|---|
| Media Source Extensions™> # dfn-updatestart> |
| Media Source Extensions™> # dom-sourcebuffer-onupdatestart> |