as

Settings
Sign out
Notifications
Alexa
亚马逊应用商店
Ring
AWS
文档
Support
Contact Us
My Cases
新手入门
设计和开发
应用发布
参考
支持
感谢您的访问。此页面目前仅提供英语版本。我们正在开发中文版本。谢谢您的理解。

SourceBuffer

For additional information, see https://www.w3.org/TR/media-source-2/#sourcebuffer.

Extends

Properties

mode

mode: AppendMode

Get or set the append mode. For additional information, see https://www.w3.org/TR/media-source-2/#dom-sourcebuffer-mode.


updating

readonly updating: boolean

Checks if Source Buffer is upating track buffers. For additional information, see https://www.w3.org/TR/media-source-2/#dom-sourcebuffer-updating.


buffered

readonly buffered: TimeRanges

Gets the Time ranges of the buffered media. For additional information, see https://www.w3.org/TR/media-source-2/#dom-sourcebuffer-buffered.


timestampOffset

timestampOffset: number

Get or set the timestamp offset to be applied to every coded frame. For additional information, see https://www.w3.org/TR/media-source-2/#dom-sourcebuffer-timestampoffset.


audioTracks

readonly audioTracks: AudioTrackList

Gets the audio track list. For additional information, see https://www.w3.org/TR/media-source-2/#dom-sourcebuffer-audiotracks.


videoTracks

readonly videoTracks: VideoTrackList

Gets the video track list. For additional information, see https://www.w3.org/TR/media-source-2/#dom-sourcebuffer-videotracks.


textTracks

readonly textTracks: TextTrackList

Gets the text track list. For additional information, see https://www.w3.org/TR/media-source-2/#dom-sourcebuffer-texttracks.


appendWindowStart

appendWindowStart: number

Get or Set the append window start position in seconds. For additional information, see https://www.w3.org/TR/media-source-2/#dom-sourcebuffer-appendwindowstart.


appendWindowEnd

appendWindowEnd: number

Get or set the append window end position in seconds. For additional information, see https://www.w3.org/TR/media-source-2/#dom-sourcebuffer-appendwindowend.


onupdatestart

onupdatestart: EventListener

For additional information, see https://www.w3.org/TR/media-source-2/#dom-sourcebuffer-onupdatestart


onupdate

onupdate: EventListener

For additional information, see https://www.w3.org/TR/media-source-2/#dom-sourcebuffer-onupdate


onupdateend

onupdateend: EventListener

For additional information, see https://www.w3.org/TR/media-source-2/#dom-sourcebuffer-onupdateend


onerror

onerror: EventListener

For additional information, see https://www.w3.org/TR/media-source-2/#dom-sourcebuffer-onerror


onabort

onabort: EventListener

For additional information, see https://www.w3.org/TR/media-source-2/#dom-sourcebuffer-onabort

Methods

appendBuffer()

appendBuffer(data: ArrayBuffer | Uint8Array<ArrayBufferLike>): void

Append the media segment. For additional information, see https://www.w3.org/TR/media-source-2/#dom-sourcebuffer-appendbuffer.

Parameters

data

ArrayBuffer | Uint8Array<ArrayBufferLike>


abort()

abort(): void

Abort the source buffer operations. For additional information, see https://www.w3.org/TR/media-source-2/#dom-sourcebuffer-abort.


changeType()

changeType(type: string): void

Change the mime type of the source buffer.

https://www.w3.org/TR/media-source-2/#dom-sourcebuffer-changetype

Parameters

type

string


remove()

remove(start: number, end: number): void

Remove the media samples from the internal track buffer queue between start and end timestamp positions. For additional information, see https://www.w3.org/TR/media-source-2/#dom-sourcebuffer-remove.

Parameters

start

number

end

number


Last updated: Jul 22, 2026