Media Source Extensionswindow_and_dedicated
The updatestart event of the SourceBuffer interface signals the beginning of an SourceBuffer.appendBuffer or SourceBuffer.remove operation. The SourceBuffer.updating attribute transitions from false to true.
Syntax
Use the event name in EventTarget/addEventListener:
addEventListener("updatestart", (event) => { })
Alternatively, assign to the event handler property of the interface:
onupdatestart = (event) => { }
Event type
A generic Event.
Examples
Listening for the updatestart event
const sourceBuffer = source.addSourceBuffer(mimeCodec);
sourceBuffer.addEventListener("updatestart", () => {
downloadStatus.textContent = "Modifying buffer...";
});
sourceBuffer.addEventListener("updateend", () => {
downloadStatus.textContent = "Modification complete";
});
Specifications
Browser compatibility
See also
- SourceBuffer.appendBuffer()
- SourceBuffer.remove()
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
