MediaSource.removeSourceBuffer()
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
MediaSource
接口的 removeSourceBuffer()
方法从与 MediaSource
对象关联的 SourceBuffers
列表中移除给定的 SourceBuffer
。
语法
js
removeSourceBuffer(sourceBuffer)
参数
sourceBuffer
-
将被移除的
SourceBuffer
对象。
返回值
无(undefined
)。
异常
NotFoundError
DOMException
-
如果提供的 sourceBuffer 在
MediaSource.sourceBuffers
中不存在,则抛出异常。
示例
js
for (let i = 0; i < 10; i++) {
const sourceBuffer = mediaSource.addSourceBuffer(mimeCodec);
}
mediaSource.removeSourceBuffer(mediaSource.sourceBuffers[0]);
规范
Specification |
---|
Media Source Extensions™ # dom-mediasource-removesourcebuffer |
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
removeSourceBuffer |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- Partial support
- Partial support
- No support
- No support
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.