MediaSource
インターフェイス の sourceBuffers
読み取り専用プロパティは、この MediaSource
に関連付けられた SourceBuffer
オブジェクトのリストを含む SourceBufferList
オブジェクトを返します。
構文
var mySourceBuffers = mediaSource.sourceBuffers;
値
例
次のスニペットは、Nick Desaulniers によって書かれた簡単な例に基づいています(ライブで完全なデモを見るか、ソースをダウンロードしてさらに調査してください)。
function sourceOpen (_) {
//console.log(this.readyState); // open
var mediaSource = this;
var sourceBuffer = mediaSource.addSourceBuffer(mimeCodec);
fetchAB(assetURL, function (buf) {
sourceBuffer.addEventListener('updateend', function (_) {
mediaSource.endOfStream();
console.log(mediaSource.sourceBuffers); // 上で追加されたソースバッファが含まれます
video.play();
//console.log(mediaSource.readyState); // ended
});
sourceBuffer.appendBuffer(buf);
});
};
...
仕様
仕様 | 状態 | コメント |
---|---|---|
Media Source Extensions sourceBuffers の定義 |
勧告 | 初期定義 |
ブラウザーの互換性
BCD tables only load in the browser
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.