as

Settings
Sign out
Notifications
Alexa
亚马逊应用商店
AWS
文档
Support
Contact Us
My Cases
新手入门
设计和开发
应用发布
参考
支持

SourceBuffer

SourceBuffer

有关更多信息,请参阅https://www.w3.org/TR/media-source-2/#sourcebuffer(仅提供英文版)。

扩展

属性

appendWindowEnd

appendWindowEnd: number

获取或设置附加窗口的结束位置(以秒为单位)。有关更多信息,请参阅https://www.w3.org/TR/media-source-2/#dom-sourcebuffer-appendwindowend(仅提供英文版)。


appendWindowStart

appendWindowStart: number

获取或设置附加窗口的开始位置(以秒为单位)。有关更多信息,请参阅https://www.w3.org/TR/media-source-2/#dom-sourcebuffer-appendwindowstart(仅提供英文版)。


audioTracks

readonly audioTracks: AudioTrackList

获取音频轨道列表。有关更多信息,请参阅https://www.w3.org/TR/media-source-2/#dom-sourcebuffer-audiotracks(仅提供英文版)。


buffered

readonly buffered: TimeRanges

获取缓冲媒体的时间范围。有关更多信息,请参阅https://www.w3.org/TR/media-source-2/#dom-sourcebuffer-buffered(仅提供英文版)。


mode

mode: AppendMode

获取或设置附加模式。有关更多信息,请参阅https://www.w3.org/TR/media-source-2/#dom-sourcebuffer-mode(仅提供英文版)。


onabort

onabort: EventListener

有关更多信息,请参阅https://www.w3.org/TR/media-source-2/#dom-sourcebuffer-onabort(仅提供英文版)。


onerror

onerror: EventListener

有关更多信息,请参阅https://www.w3.org/TR/media-source-2/#dom-sourcebuffer-onerror(仅提供英文版)。


onupdate

onupdate: EventListener

有关更多信息,请参阅https://www.w3.org/TR/media-source-2/#dom-sourcebuffer-onupdate(仅提供英文版)。


onupdateend

onupdateend: EventListener

有关更多信息,请参阅https://www.w3.org/TR/media-source-2/#dom-sourcebuffer-onupdateend(仅提供英文版)


onupdatestart

onupdatestart: EventListener

有关更多信息,请参阅https://www.w3.org/TR/media-source-2/#dom-sourcebuffer-onupdatestart(仅提供英文版)。


textTracks

readonly textTracks: TextTrackList

获取文本轨道列表。有关更多信息,请参阅https://www.w3.org/TR/media-source-2/#dom-sourcebuffer-texttracks(仅提供英文版)。


timestampOffset

timestampOffset: number

获取或设置应用于每个编码帧的时间戳偏移量。有关更多信息,请参阅https://www.w3.org/TR/media-source-2/#dom-sourcebuffer-timestampoffset(仅提供英文版)。


updating

readonly updating: boolean

检查源缓冲区是否在更新轨道缓冲区。有关更多信息,请参阅https://www.w3.org/TR/media-source-2/#dom-sourcebuffer-updating(仅提供英文版)。


videoTracks

readonly videoTracks: VideoTrackList

获取视频轨道列表。有关更多信息,请参阅https://www.w3.org/TR/media-source-2/#dom-sourcebuffer-videotracks(仅提供英文版)。

方法

abort()

abort(): void

中止源缓冲区操作。有关更多信息,请参阅https://www.w3.org/TR/media-source-2/#dom-sourcebuffer-abort(仅提供英文版)。

返回值

void


addEventListener()

addEventListener(type, listener, options?): void

添加事件侦听器。

参数

type

string

要侦听的事件。

listener

EventListener

事件处理程序函数。

options?

忽略。

boolean AddEventListenerOptions

返回值

void

继承自

EventTarget.addEventListener


appendBuffer()

appendBuffer(data): void

附加媒体片段。有关更多信息,请参阅https://www.w3.org/TR/media-source-2/#dom-sourcebuffer-appendbuffer(仅提供英文版)。

参数

data
ArrayBuffer Uint8Array<ArrayBufferLike>

返回值

void


dispatchEvent()?

optional dispatchEvent(event): boolean

向目标分发事件

参数

event

Event

发出事件信号的事件。

返回值

boolean

待办事项

在实现中添加和定义,暂时将其保留为可选。

继承自

EventTarget.dispatchEvent


remove()

remove(start, end): void

从内部轨道缓冲队列中删除介于开始和结束时间戳位置之间的媒体样本。有关更多信息,请参阅https://www.w3.org/TR/media-source-2/#dom-sourcebuffer-remove(仅提供英文版)。

参数

start

number

end

number

返回值

void


removeEventListener()

removeEventListener(type, listener, options?): void

删除事件侦听器。

参数

type

string

要侦听的事件。

listener

EventListener

要删除的事件处理程序函数。

options?

忽略。

boolean EventListenerOptions

返回值

void

继承自

EventTarget.removeEventListener


Last updated: 2025年10月2日