Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML Audio/Video DOM buffered Property

HTML Audio/Video DOM buffered Property

HTML audio/video Tag Reference HTML Audio/Video DOM Reference

Example

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

myVid=document.getElementById("video1");

alert("Start: " + myVid.buffered.start(0)

Try it »


Definition and Usage

The buffered property returns a TimeRanges object.

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

A buffered range is a time range of the audio/video that has been buffered. If the user jumps around in the audio/video, multiple buffered ranges will result.


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the buffered property.

**Note:** Internet Explorer 8 and earlier versions do not support this property.


Syntax

audio|video

.buffered

Return Value

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'sSubscriptis 0.

    |

    HTML audio/video Tag Reference HTML Audio/Video DOM Reference