非标
此特征是非标准的,且不在标准轨道中。不要在面向 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.

浏览器兼容性

The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
桌面 移动
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
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

图例

完整支持

完整支持

不支持

不支持

用户必须明确启用此特征。

用户必须明确启用此特征。

另请参阅

元数据

  • 最后修改: