HTML Audio/Video DOM seekable attribute

Instance

Obtain the first video addressable range 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 range that users can address in audio/video.

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

For streaming video, it is usually possible to address any position in the video, even if it has not been buffered yet.

Browser Support

All mainstream browsers support the seekable property.

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

Syntax

audio|video.seekable

Return value

Type Description
TimeRanges object

Represents the addressable part in audio/video.

Properties of TimeRanges object:

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

Note:The first addressable range index is index 0.