非标
此特征是非标准的,且不在标准轨道中。不要在面向 Web 的生产站点中使用它:它不适用于每个用户。实现之间可能存在大的不兼容性,且行为将来可能改变。
这是
实验性技术
检查
浏览器兼容性表格
要小心谨慎在生产中使用这之前。
appendBufferAsync()
方法在
SourceBuffer
interface begins the process of asynchronously appending media segment data from an
ArrayBuffer
or
ArrayBufferView
对象到
SourceBuffer
.
It returns a
Promise
which is fulfilled once the buffer has been appended.
appendPromise = sourceBuffer.appendBufferAsync(source);
source
BufferSource
(that is, either an
ArrayBufferView
or
ArrayBuffer
) which contains the media segment data you want to add to the
SourceBuffer
.
A
Promise
which is fulfilled when the buffer has been added successfully to the
SourceBuffer
,或
null
if the request could not be initiated.
This simplified example async function,
fillSourceBuffer()
, takes as input parameters
BufferSource
,
buffer
,和
SourceBuffer
to which to append the source media from the buffer.
async function fillSourceBuffer(buffer, msBuffer) {
try {
while(true) {
await msBuffer.appendBufferAsync(buffer);
}
} catch(e) {
handleException(e);
}
}
Not currently part of any specification. This is being experimented with under the auspices of the Web Platform Incubator Community Group (WICG).
| 规范 | 状态 | 注释 |
|---|---|---|
| 媒体源扩展 | 推荐 | Initial definition; does not include this method. |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
appendBufferAsync
|
Chrome 不支持 No | Edge 不支持 No | Firefox 62 | IE 不支持 No | Opera 不支持 No | Safari 不支持 No | WebView Android 不支持 No | Chrome Android Yes | Firefox Android 不支持 No | Opera Android 不支持 No | Safari iOS 不支持 No | Samsung Internet Android Yes |
完整支持
不支持
用户必须明确启用此特征。
SourceBuffer
abort()
appendBuffer()
appendBufferAsync()
appendStream()
changeType()
remove()
removeAsync()