blob: 6127a477a78e6623743b1af023abb8826683e122 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
---
title: SourceBuffer.appendBuffer()
slug: Web/API/SourceBuffer/appendBuffer
translation_of: Web/API/SourceBuffer/appendBuffer
---
<div>{{draft}}{{APIRef("Media Source Extensions")}}{{SeeCompatTable}}</div>
<div><code><strong>appendBuffer()</strong></code>方法将媒体片段数据添加到<code>SourceBuffer</code>对象中,其中媒体片段用{{domxref("ArrayBuffer")}} 或 <code>ArrayBufferView</code> 对象存储 。</div>
<h2 id="Syntax">Syntax</h2>
<pre class="brush: js"><em>sourceBuffer</em>.appendBuffer(<em>source</em>);
</pre>
<h3 id="Parameters">Parameters</h3>
<dl>
<dt><code>source</code></dt>
<dd>一个 {{domxref("BufferSource")}} 对象({{domxref("ArrayBufferView")}} 或 {{domxref("ArrayBuffer")}}),存储了你要添加到 SourceBuffer 中去的媒体片段数据。</dd>
</dl>
<h3 id="Return_value">Return value</h3>
<p><code>undefined</code>.</p>
<h3 id="Exceptions">Exceptions</h3>
<p>None.</p>
<h2 id="Example">Example</h2>
<p>TBD.</p>
<h2 id="Specifications">Specifications</h2>
<table class="standard-table">
<tbody>
<tr>
<th scope="col">Specification</th>
<th scope="col">Status</th>
<th scope="col">Comment</th>
</tr>
<tr>
<td>{{SpecName('Media Source Extensions', '#widl-SourceBuffer-appendBuffer-void-ArrayBuffer-data', 'appendBuffer()')}}</td>
<td>{{Spec2('Media Source Extensions')}}</td>
<td>Initial definition.</td>
</tr>
</tbody>
</table>
<h2 id="Browser_compatibility">Browser compatibility</h2>
<div>
<p>{{Compat("api.SourceBuffer.appendBuffer")}}</p>
</div>
<h2 id="See_also">See also</h2>
<ul>
<li>{{domxref("MediaSource")}}</li>
<li>{{domxref("SourceBufferList")}}</li>
</ul>
|