Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. SourceBufferList

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 inDedicated Web Workers.

TheSourceBufferList interface represents a simple container list for multipleSourceBuffer objects.

The source buffer list containing theSourceBuffers appended to a particularMediaSource can be retrieved using theMediaSource.sourceBuffers property.

The individual source buffers can be accessed using thebracket notation[].

EventTarget SourceBufferList

Instance properties

SourceBufferList.lengthRead only

Returns the number ofSourceBuffer objects in the list.

Instance methods

Inherits methods from its parent interface,EventTarget.

Events

addsourcebuffer

Fired when aSourceBuffer is added to the list.

removesourcebuffer

Fired when aSourceBuffer is removed from the list.

Examples

This example shows how to access the active source buffers of theMediaSource connected to an already playingHTMLVideoElement.

js
// Video is an already playing video using a MediaSource srcObjectconst 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

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp