Firefox Tomorrow

web api instance method

MediaSource: removeSourceBuffer() method

View on MDN ↗

Available in workers

The removeSourceBuffer() method of the MediaSource interface removes the given SourceBuffer from the SourceBufferList associated with this MediaSource object.

Syntax

removeSourceBuffer(sourceBuffer)

Parameters

Return value

None (undefined).

Exceptions

Examples

for (let i = 0; i < 10; i++) {
  const sourceBuffer = mediaSource.addSourceBuffer(mimeCodec);
}

mediaSource.removeSourceBuffer(mediaSource.sourceBuffers[0]);

Specifications

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.

See also