Latest web development tutorials

HTML Audio / Video DOM seekable attribute

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

Examples

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

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

try it"

Definition and Usage

seekable property returns TimeRanges object.

TimeRanges object represents the audio / video user addressable range.

Addressable range refers to the user in the audio / video addressable (moving the playback position) time frame.

For non-streaming video, video can usually be addressed to any position, even if it is not completed buffering.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support seekable attribute.

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


grammar

audio|video .seekable

return value

类型 描述
TimeRanges Object 表示音频/视频中的可寻址部分。

TimeRanges 对象的属性:

  • length - 获得音频/视频中可寻址范围的数量
  • start( index ) - 获得可寻址范围的开始位置
  • end( index ) - 获得可寻址范围的结束位置

注释:第一个可寻址范围的下标 index 是 0。



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