sourceBuffer.addEventListener("bufferedchange", (event) => {
console.log(event instanceof BufferedChangeEvent); // true
console.log(event.type); // "bufferedchange"
console.log(event.addedRanges); // TimeRanges — ranges added to the buffer
console.log(event.removedRanges); // TimeRanges — ranges removed from the buffer
});BufferedChangeEvent: BufferedChangeEvent() constructor
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.