Video seekableProperty

Video 对象参考手册Video Object

Example

Get the first addressable range (in seconds) of the video:

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

xThe output result is:

Start: 0 End: 12.612

Try it yourself »

Definition and Usage

The seekable property returns a TimeRanges object.

The TimeRanges object represents the addressable ranges of the audio/video.

Addressable range refers to the time range in the audio/video that the user can address (move the play position) to.

For streaming video, it is usually possible to address any position in the video, even if it has not finished buffering.

Note:This property is read-only.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the seekable property.

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


Syntax

videoObject.seekable

Return Value

Type Description
TimeRanges object

Represents the addressable portions of the audio/video.

Properties of the TimeRanges object:

  • length - Gets the number of addressable ranges in the audio/video
  • start(indexstart(index) - Gets the start position of the addressable range
  • end(indexend(index) - Gets the end position of the addressable range

Note:The first addressable range has an index of 0.



Video 对象参考手册Video Object Other Extensions