English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Reference Manual

HTML Tag Directory

HTML Audio/Video DOM seekable property

The read-only property seekable of HTMLMediaElement returns a TimeRanges object that contains the areas (if any) to which the user can jump.

 HTML Audio/Video DOM Reference Manual

Online Example

Get the first seekable range of the video in seconds (part):

!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>HTML Audio/Video seekable property usage-Basic Tutorial(oldtoolbag.com)</title>
</head>
<body>
<button onclick="getFirstSeekableRange()" type="button">Get the first video seekable range in seconds</button>
<br> 
<video id="video1" controls="controls">
  <source src="movie.mp4" type="video/mp4">
  <source src="movie.ogg" type="video/ogg">
  Your browser does not support HTML5 video  tag.
</video>
<script>
myVid=document.getElementById("video1");
function getFirstSeekableRange()
{ 
  alert("Start: " + myVid.seekable.start(0) + " End: "  + myVid.seekable.end(0));
} 
</script> 
</body>
</html>
Test and see ‹/›

Definition and Usage

The seekable property returns a TimeRanges object.
The TimeRanges object represents the audio that can be found for the user/Video range.
Searchable range is the audio that the user can search (move the playback position)/Video time range.
For non-streaming videos, it is usually even possible to search at any position in the video before the video is buffered.
Note: This property is read-only.

Browser Compatibility

IEFirefoxOperaChromeSafari

All mainstream browsers support the seekable property.

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

Syntax

audio|video.seekable

Return value

TypeDescription
TimeRanges ObjectRepresents audio/Addressable parts in the video.

Properties of TimeRanges Object:

  • length - Get audio/The number of addressable ranges in the video

  • start(index) - Get the start position of the addressable range

  • end(index) - Get the end position of the addressable range

Note:The first index of the addressable range index Is 0.

 HTML Audio/Video DOM Reference Manual