SourceBufferList

Limited availability

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 [].

EventTarget SourceBufferList

Instance properties

SourceBufferList.length Read only

Returns the number of SourceBuffer objects in the list.

Instance methods

Inherits methods from its parent interface, EventTarget.

Events

addsourcebuffer

Fired when a SourceBuffer is added to the list.

removesourcebuffer

Fired when a SourceBuffer is removed from the list.

Examples

This example shows how to access the active source buffers of the MediaSource connected to an already playing HTMLVideoElement.

js
// 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();
}

Specifications

Specification
Media Source Extensions™
# sourcebufferlist

Browser compatibility

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
Chrome – No support
Chrome 23 – 30 (Release date: 2012-11-06)
prefix
prefix Implemented with the vendor prefix: WebKit
Chrome – Full support
Chrome 31 (Release date: 2013-11-12)
footnote Full support
Edge – Full support
Edge 12 (Release date: 2015-07-29)
footnote Full support
Firefox – Full support
Firefox 42 (Release date: 2015-11-03)
footnote Full support
Opera – Full support
Opera 15 (Release date: 2013-07-02)
footnote Full support
Safari – Full support
Safari 8 (Release date: 2014-10-16)
footnote Full support
Chrome Android – No support
Chrome Android 25 – 30 (Release date: 2013-02-27)
prefix
prefix Implemented with the vendor prefix: WebKit
Chrome Android – Full support
Chrome Android 31 (Release date: 2013-11-14)
footnote Full support
Firefox for Android – Full support
Firefox for Android 41 (Release date: 2015-09-22)
footnote Full support
Opera Android – Full support
Opera Android 14 (Release date: 2013-05-21)
footnote Full support
Safari on iOS – Partial support
Safari on iOS 13 (Release date: 2019-09-19)
footnote Partial support
footnote Exposed in Mobile Safari on iPad but not on iPhone.
footnote See bug 200147
Samsung Internet – No support
Samsung Internet 2 – 2.1 (Release date: 2014-10-17)
prefix
prefix Implemented with the vendor prefix: WebKit
Samsung Internet – Full support
Samsung Internet 3 (Release date: 2015-04-10)
footnote Full support
WebView Android – No support
WebView Android 4.4 – 4.4 (Release date: 2013-12-09)
prefix
prefix Implemented with the vendor prefix: WebKit
WebView Android – Full support
WebView Android 4.4.3 (Release date: 2014-06-02)
footnote Full support
WebView on iOS – Partial support
WebView on iOS 13 (Release date: 2019-09-19)
footnote Partial support
footnote Exposed in Mobile Safari on iPad but not on iPhone.
footnote See bug 200147
addsourcebuffer event
Chrome – Partial support
Chrome 31 – 52 (Release date: 2013-11-12)
footnote Partial support
footnote The onaddsourcebuffer event handler property is not supported.
Chrome – Full support
Chrome 53 (Release date: 2016-08-31)
footnote Full support
Edge – Partial support
Edge 12 – 16 (Release date: 2015-07-29)
footnote Partial support
footnote The onaddsourcebuffer event handler property is not supported.
Edge – Full support
Edge 17 (Release date: 2018-04-30)
footnote Full support
Firefox – Full support
Firefox 42 (Release date: 2015-11-03)
footnote Full support
Opera – Partial support
Opera 18 – 39 (Release date: 2013-11-19)
footnote Partial support
footnote The onaddsourcebuffer event handler property is not supported.
Opera – Full support
Opera 40 (Release date: 2016-09-20)
footnote Full support
Safari – Partial support
Safari 8 – 10 (Release date: 2014-10-16)
footnote Partial support
footnote The onaddsourcebuffer event handler property is not supported.
Safari – Full support
Safari 10.1 (Release date: 2017-03-27)
footnote Full support
Chrome Android – Partial support
Chrome Android 31 – 52 (Release date: 2013-11-14)
footnote Partial support
footnote The onaddsourcebuffer event handler property is not supported.
Chrome Android – Full support
Chrome Android 53 (Release date: 2016-09-07)
footnote Full support
Firefox for Android – Full support
Firefox for Android 41 (Release date: 2015-09-22)
footnote Full support
Opera Android – Partial support
Opera Android 18 – 37 (Release date: 2013-11-20)
footnote Partial support
footnote The onaddsourcebuffer event handler property is not supported.
Opera Android – Full support
Opera Android 41 (Release date: 2016-10-25)
footnote Full support
Safari on iOS – Partial support
Safari on iOS 13 (Release date: 2019-09-19)
footnote Partial support
footnote Exposed in Mobile Safari on iPad but not on iPhone.
Samsung Internet – Partial support
Samsung Internet 2 – 5.4 (Release date: 2014-10-17)
footnote Partial support
footnote The onaddsourcebuffer event handler property is not supported.
Samsung Internet – Full support
Samsung Internet 6 (Release date: 2017-08-23)
footnote Full support
WebView Android – Partial support
WebView Android 4.4.3 – 52 (Release date: 2014-06-02)
footnote Partial support
footnote The onaddsourcebuffer event handler property is not supported.
WebView Android – Full support
WebView Android 53 (Release date: 2016-09-07)
footnote Full support
WebView on iOS – Partial support
WebView on iOS 13 (Release date: 2019-09-19)
footnote Partial support
footnote Exposed in Mobile Safari on iPad but not on iPhone.
Available in workers
Experimental
Chrome – Full support
Chrome 108 (Release date: 2022-11-29)
footnote Full support
Edge – Full support
Edge 108 (Release date: 2022-12-05)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 94 (Release date: 2022-12-15)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – Full support
Chrome Android 108 (Release date: 2022-11-29)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 73 (Release date: 2023-01-17)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Full support
Samsung Internet 21 (Release date: 2023-05-19)
footnote Full support
WebView Android – Full support
WebView Android 108 (Release date: 2022-11-29)
footnote Full support
WebView on iOS – No support
WebView on iOS
footnote No support
length
Chrome – Full support
Chrome 23 (Release date: 2012-11-06)
footnote Full support
Edge – Full support
Edge 12 (Release date: 2015-07-29)
footnote Full support
Firefox – Full support
Firefox 42 (Release date: 2015-11-03)
footnote Full support
Opera – Full support
Opera 15 (Release date: 2013-07-02)
footnote Full support
Safari – Full support
Safari 8 (Release date: 2014-10-16)
footnote Full support
Chrome Android – Full support
Chrome Android 33 (Release date: 2014-02-26)
footnote Full support
Firefox for Android – Full support
Firefox for Android 41 (Release date: 2015-09-22)
footnote Full support
Opera Android – Full support
Opera Android 14 (Release date: 2013-05-21)
footnote Full support
Safari on iOS – Partial support
Safari on iOS 13 (Release date: 2019-09-19)
footnote Partial support
footnote Exposed in Mobile Safari on iPad but not on iPhone.
Samsung Internet – Full support
Samsung Internet 3 (Release date: 2015-04-10)
footnote Full support
WebView Android – Full support
WebView Android 4.4.3 (Release date: 2014-06-02)
footnote Full support
WebView on iOS – Partial support
WebView on iOS 13 (Release date: 2019-09-19)
footnote Partial support
footnote Exposed in Mobile Safari on iPad but not on iPhone.
Available in workers
Experimental
Chrome – Full support
Chrome 108 (Release date: 2022-11-29)
footnote Full support
Edge – Full support
Edge 108 (Release date: 2022-12-05)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 94 (Release date: 2022-12-15)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – Full support
Chrome Android 108 (Release date: 2022-11-29)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 73 (Release date: 2023-01-17)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Full support
Samsung Internet 21 (Release date: 2023-05-19)
footnote Full support
WebView Android – Full support
WebView Android 108 (Release date: 2022-11-29)
footnote Full support
WebView on iOS – No support
WebView on iOS
footnote No support
removesourcebuffer event
Chrome – Partial support
Chrome 31 – 52 (Release date: 2013-11-12)
footnote Partial support
footnote The onremovesourcebuffer event handler property is not supported.
Chrome – Full support
Chrome 53 (Release date: 2016-08-31)
footnote Full support
Edge – Partial support
Edge 12 – 16 (Release date: 2015-07-29)
footnote Partial support
footnote The onremovesourcebuffer event handler property is not supported.
Edge – Full support
Edge 17 (Release date: 2018-04-30)
footnote Full support
Firefox – Full support
Firefox 42 (Release date: 2015-11-03)
footnote Full support
Opera – Partial support
Opera 18 – 39 (Release date: 2013-11-19)
footnote Partial support
footnote The onremovesourcebuffer event handler property is not supported.
Opera – Full support
Opera 40 (Release date: 2016-09-20)
footnote Full support
Safari – Partial support
Safari 8 – 10 (Release date: 2014-10-16)
footnote Partial support
footnote The onremovesourcebuffer event handler property is not supported.
Safari – Full support
Safari 10.1 (Release date: 2017-03-27)
footnote Full support
Chrome Android – Partial support
Chrome Android 31 – 52 (Release date: 2013-11-14)
footnote Partial support
footnote The onremovesourcebuffer event handler property is not supported.
Chrome Android – Full support
Chrome Android 53 (Release date: 2016-09-07)
footnote Full support
Firefox for Android – Full support
Firefox for Android 41 (Release date: 2015-09-22)
footnote Full support
Opera Android – Partial support
Opera Android 18 – 37 (Release date: 2013-11-20)
footnote Partial support
footnote The onremovesourcebuffer event handler property is not supported.
Opera Android – Full support
Opera Android 41 (Release date: 2016-10-25)
footnote Full support
Safari on iOS – Partial support
Safari on iOS 13 (Release date: 2019-09-19)
footnote Partial support
footnote Exposed in Mobile Safari on iPad but not on iPhone.
Samsung Internet – Partial support
Samsung Internet 2 – 5.4 (Release date: 2014-10-17)
footnote Partial support
footnote The onremovesourcebuffer event handler property is not supported.
Samsung Internet – Full support
Samsung Internet 6 (Release date: 2017-08-23)
footnote Full support
WebView Android – Partial support
WebView Android 4.4.3 – 52 (Release date: 2014-06-02)
footnote Partial support
footnote The onremovesourcebuffer event handler property is not supported.
WebView Android – Full support
WebView Android 53 (Release date: 2016-09-07)
footnote Full support
WebView on iOS – Partial support
WebView on iOS 13 (Release date: 2019-09-19)
footnote Partial support
footnote Exposed in Mobile Safari on iPad but not on iPhone.
Available in workers
Experimental
Chrome – Full support
Chrome 108 (Release date: 2022-11-29)
footnote Full support
Edge – Full support
Edge 108 (Release date: 2022-12-05)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 94 (Release date: 2022-12-15)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – Full support
Chrome Android 108 (Release date: 2022-11-29)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 73 (Release date: 2023-01-17)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Full support
Samsung Internet 21 (Release date: 2023-05-19)
footnote Full support
WebView Android – Full support
WebView Android 108 (Release date: 2022-11-29)
footnote Full support
WebView on iOS – No support
WebView on iOS
footnote No support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
Partial support
Partial support
No support
No support
Experimental. Expect behavior to change in the future.
Requires a vendor prefix or different name for use.
Has more compatibility info.

See also