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

HTML DOM Video buffered Property

Video buffered property

Video Object Reference The Video object

Example

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

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

document.getElementById("demo").innerHTML = "Start: " + x.buffered.start(0)

Try it »


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 buffered audio/video. If the user seeks within the audio/video, multiple buffered ranges are 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 attribute.


Syntax

videoObject

.buffered

Return Value

Value Description
TimeRanges Object

Represents the buffered portion 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 Object Reference The Video object