Audio buffered attribute

Definition and Usage

buffered This property returns a TimeRanges object.

The TimeRanges object represents the audio range buffered by the user.

The buffered range is the time range of the buffered audio. If there is a jump in the audio, the user will receive several buffered ranges.

Note:This property is read-only.

Example

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

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

Try it yourself

Grammar

audioObject.buffered

返回值

Return Value Type
Description

TimeRanges Object

Represents the buffered part of the audio.

  • TimeRanges Object Property:
  • length - Get the number of buffered ranges in the audioindexstart(
  • ) - Get the start position of the buffered rangeindex) - Get the end position of the buffered range

Note:The first buffered range is index 0.

Browser Support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support Support Support Support Support