Video bufferedProperty

Video 对象参考手册Video Object

Examples

Get the first buffered range (part) of the video, in seconds:

var x = document.getElementById("myVideo");
document.getElementById("demo").innerHTML = "Start: " + x.buffered.start(0)
+ " End: " + x.buffered.end(0);

Try it Yourself »

Definition and Usage

The buffered property returns a TimeRanges object.

The TimeRanges object represents the buffered range of the user's audio/video.

The buffered range refers to the time range of the buffered audio/video. If the user jumps around in the audio/video, multiple buffered ranges will be obtained.

Note:This property is read-only.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the buffered property.

Note:Internet Explorer 8 or earlier browsers do not support this property.


Syntax

videoObject.buffered

Return Value

Value Description
TimeRanges object

Represents the buffered parts of the audio/video.

TimeRanges object properties:

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

Note:The index of the first buffered range is 0.



Video 对象参考手册Video Object Other Extensions