非标
此特征是非标准的,且不在标准轨道中。不要在面向 Web 的生产站点中使用它:它不适用于每个用户。实现之间可能存在大的不兼容性,且行为将来可能改变。

这是 实验性技术
检查 浏览器兼容性表格 要小心谨慎在生产中使用这之前。

removeAsync() 方法在 SourceBuffer interface starts the process of asynchronously removing from the SourceBuffer media segments found within a specific time range. A Promise is returned, which is fulfilled when the buffers in the specified time range have been removed.

This method can only be called when updating is false . If that's not the case, call abort() 代替。

句法

removePromise = sourceBuffer.removeAsync(start, end);
					

参数

start

A double representing the start of the time range, in seconds.

end

A double representing the end of the time range, in seconds.

返回值

A Promise whose fulfillment handler is executed once the buffers in the specified time range have been removed from the SourceBuffer .

范例

This example establishes an asynchronous function, emptySourceBuffer() , which simply clears the contents of the specified SourceBuffer .

async function emptySourceBuffer(msBuffer) {
  await msBuffer.removeAsync(0, Infinity).catch(function(e) {
    handleException(e);
  }
}
					

规范

Not currently part of the MSE specification.

规范 状态 注释
媒体源扩展 推荐 初始定义。

浏览器兼容性

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
removeAsync 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

图例

完整支持

完整支持

不支持

不支持

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

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

另请参阅

元数据

  • 最后修改: