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.
The SourceBufferList interface represents a simple container list for multiple SourceBuffer objects.
The source buffer list containing the SourceBuffers appended to a particular MediaSource can be retrieved using the MediaSource.sourceBuffers property.
The individual source buffers can be accessed using the bracket notation [].
SourceBufferList.length Read only
Returns the number of SourceBuffer objects in the list.
Inherits methods from its parent interface, EventTarget.
addsourcebufferFired when a SourceBuffer is added to the list.
removesourcebufferFired when a SourceBuffer is removed from the list.
This example shows how to access the active source buffers of the MediaSource connected to an already playing HTMLVideoElement.
// Video is an already playing video using a MediaSource srcObject
const video = document.querySelector("video");
const mediaSource = video.srcObject;
const sourceBufferList = mediaSource.activeSourceBuffers;
for (const sourceBuffer of sourceBufferList) {
// Do something with each SourceBuffer, such as call abort()
sourceBuffer.abort();
}
| Specification |
|---|
| Media Source Extensions™> # sourcebufferlist> |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
SourceBufferList |
3123–31 | 12 | 42 | 15 | 8 | 3125–31 | 41 | 14 | 13Exposed in Mobile Safari on iPad but not on iPhone. |
3.02.0–3.0 | 4.4.34.4–4.4.3 | 13Exposed in Mobile Safari on iPad but not on iPhone. |
addsourcebuffer_event |
5331–53Theonaddsourcebuffer event handler property is not supported. |
1712–17Theonaddsourcebuffer event handler property is not supported. |
42 | 4018–40Theonaddsourcebuffer event handler property is not supported. |
10.18–10.1Theonaddsourcebuffer event handler property is not supported. |
5331–53Theonaddsourcebuffer event handler property is not supported. |
41 | 4118–41Theonaddsourcebuffer event handler property is not supported. |
13Exposed in Mobile Safari on iPad but not on iPhone. |
6.02.0–6.0Theonaddsourcebuffer event handler property is not supported. |
534.4.3–53Theonaddsourcebuffer event handler property is not supported. |
13Exposed in Mobile Safari on iPad but not on iPhone. |
length |
23 | 12 | 42 | 15 | 8 | 33 | 41 | 14 | 13Exposed in Mobile Safari on iPad but not on iPhone. |
3.0 | 4.4.3 | 13Exposed in Mobile Safari on iPad but not on iPhone. |
removesourcebuffer_event |
5331–53Theonremovesourcebuffer event handler property is not supported. |
1712–17Theonremovesourcebuffer event handler property is not supported. |
42 | 4018–40Theonremovesourcebuffer event handler property is not supported. |
10.18–10.1Theonremovesourcebuffer event handler property is not supported. |
5331–53Theonremovesourcebuffer event handler property is not supported. |
41 | 4118–41Theonremovesourcebuffer event handler property is not supported. |
13Exposed in Mobile Safari on iPad but not on iPhone. |
6.02.0–6.0Theonremovesourcebuffer event handler property is not supported. |
534.4.3–53Theonremovesourcebuffer event handler property is not supported. |
13Exposed in Mobile Safari on iPad but not on iPhone. |
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/SourceBufferList