\n
\n \n
\n

Definition and Usage

\n

The seekable property returns a TimeRanges object.

\n

The TimeRanges object represents the user's seekable time range.

\n

A seekable time range is a time range in which the user can seek. This is often referred to as the buffered range.

\n
\n

Example

\n

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

\n
\n
var vid = document.getElementById("myVideo");\nalert("Start: " + vid.seekable.start(0) + " End: " + vid.seekable.end(0));
\n
\n

Try It Yourself Β»

\n
\n

Browser Support

\n

Internet ExplorerFirefoxOperaChromeSafari

\n

The numbers in the table indicate the first browser version that fully supports this property.

\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
PropertyInternet ExplorerFirefoxOperaChromeSafari
seekable9.03.510.53.03.1
\n

Syntax

\n
\n audio|video.seekable\n
\n

Property Value

\n \n \n \n \n \n \n \n \n \n
ValueDescription
TimeRangesRepresents the seekable time range of the audio/video.

\n A TimeRanges object contains one or more time ranges, where each time range is defined by a start time and an end time (in seconds).

\n For example, the time range [0,2] would represent the time from 0 seconds to 2 seconds.
\n

Technical Details

\n \n \n \n \n \n
Return Value:A TimeRanges object representing the audio/video's current seekable time range.
\n

More Examples

\n
\n

Example

\n

Get the video's first seekable range (in seconds):

\n
\n
var vid = document.getElementById("myVideo");\nalert("Start: " + vid.seekable.start(0) + " End: " + vid.seekable.end(0));
\n
\n

Try It Yourself Β»

\n
\n
\n

Example

\n

Loop through all seekable ranges and output them:

\n
\n
var vid = document.getElementById("myVideo");\nvar ranges = vid.seekable;\nvar txt = "";\nfor (var i = 0; i < ranges.length; i++) {\n    txt += "Start: " + ranges.start(i) + " End: " + ranges.end(i);\n}\nalert(txt);
\n
\n

Try It Yourself Β»

\n
\n
\n

Example

\n

Alert the video's current seekable range (in seconds):

\n
\n
var vid = document.getElementById("myVideo");\nalert("Start: " + vid.seekable.start(0) + " End: " + vid.seekable.end(0));
\n
\n

Try It Yourself Β»

\n
\n
\n \n
\n
\n \n
\n