Advertisement
Home Open Editor ❯

HTML Audio/Video DOM buffered Property

Example

var vid = document.getElementById("myVideo");

function myFunction() { 
  alert("Start: " + vid.buffered.start(0) + " End: "  + vid.buffered.end(0));
} 

Try this code ❯

Meaning

The buffered property returns a TimeRanges object representing the buffered parts of the audio/video.

The first buffered range is index 0.


Standard Syntax

audio|video.buffered


Advertisement

Return Value

Type Description
TimeRanges Object Returns the buffered parts of the audio/video. The first buffered range is index 0.

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.
Home Open Editor ❯
Advertisement