HTMLオーディオ/ビデオDOMバッファリングされたプロパティ

❮HTMLオーディオ/ビデオDOMリファレンス

ビデオの最初のバッファ範囲(一部)を数秒で取得します。

var vid = document.getElementById("myVideo");
alert("Start: " + vid.buffered.start(0)
+ " End: " + vid.buffered.end(0));

定義と使用法

bufferedプロパティは、TimeRangesオブジェクトを返します。

TimeRangesオブジェクトは、オーディオ/ビデオのユーザーのバッファ範囲を表します。

バッファリングされた範囲は、バッファリングされたオーディオ/ビデオの時間範囲です。ユーザーがオーディオ/ビデオをスキップすると、ユーザーはいくつかのバッファー範囲を取得します。

注:このプロパティは読み取り専用です。


ブラウザのサポート

表の数字は、プロパティを完全にサポートする最初のブラウザバージョンを示しています。

Property
buffered Yes 9.0 4.0  Yes Yes

構文

audio|video.buffered

戻り値

Type Description
TimeRanges Object Represents the buffered parts of the audio/video.

TimeRanges Object Properties:

  • length - get the number of buffered ranges in the audio/video
  • start(index) - get the start position of a buffered range
  • end(index) - get the end position of a buffered range

Note: The first buffered range is index 0


❮HTMLオーディオ/ビデオDOMリファレンス