--- title: SourceBuffer.appendBuffer() slug: Web/API/SourceBuffer/appendBuffer translation_of: Web/API/SourceBuffer/appendBuffer ---
{{draft}}{{APIRef("Media Source Extensions")}}{{SeeCompatTable}}
appendBuffer()方法将媒体片段数据添加到SourceBuffer对象中,其中媒体片段用{{domxref("ArrayBuffer")}} 或 ArrayBufferView 对象存储 。

Syntax

sourceBuffer.appendBuffer(source);

Parameters

source
一个 {{domxref("BufferSource")}} 对象({{domxref("ArrayBufferView")}} 或 {{domxref("ArrayBuffer")}}),存储了你要添加到 SourceBuffer 中去的媒体片段数据。

Return value

undefined.

Exceptions

None.

Example

TBD.

Specifications

Specification Status Comment
{{SpecName('Media Source Extensions', '#widl-SourceBuffer-appendBuffer-void-ArrayBuffer-data', 'appendBuffer()')}} {{Spec2('Media Source Extensions')}} Initial definition.

Browser compatibility

{{Compat("api.SourceBuffer.appendBuffer")}}

See also