English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
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
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 ‹/›
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.
IEFirefoxOperaChromeSafari
All mainstream browsers support the seekable property.
Note:Internet Explorer 8 And earlier versions do not support this property.
audio|video.seekable
Type | Description |
---|---|
TimeRanges Object | Represents audio/Addressable parts in the video. Properties of TimeRanges Object:
Note:The first index of the addressable range index Is 0. |