HTML Audio/Video DOM buffered attribute

Instance

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

myVid=document.getElementById("video1");
alert("Start: ") + myVid.buffered.start(0)
+ " End: " + myVid.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.

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

Browser Support

All major browsers support the buffered property.

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

Syntax

audio|video.buffered

Return Value

Value Description
TimeRanges Object

Represents the buffered part 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's table is 0.