非标
此特征是非标准的,且不在标准轨道中。不要在面向 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.
| 规范 | 状态 | 注释 |
|---|---|---|
| 媒体源扩展 | 推荐 | 初始定义。 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
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 |
完整支持
不支持
用户必须明确启用此特征。
SourceBuffer
abort()
appendBuffer()
appendBufferAsync()
appendStream()
changeType()
remove()
removeAsync()