HTML Audio/Video DOMseekableProperty

HTML audio/video 标签参考手册HTML Audio/Video DOM Reference Manual

Example

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

myVid=document.getElementById("video1");
alert("Start: " + myVid.seekable.start(0)
+ " End: " + myVid.seekable.end(0));

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 ranges refer to the time ranges in the audio/video that the user can seek to (move the playback position).

For non-streaming video, any position in the video can usually be sought to, even if it has not finished buffering.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the seekable property.

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


Syntax

audio|video.seekable

Return Value

Type Description
TimeRanges Object Represents the addressable parts of the audio/video.

Properties of the TimeRanges object:

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

Note:The index of the first addressable rangeindexis 0.



HTML audio/video 标签参考手册HTML Audio/Video DOM Reference Manual Other Extensions