HTMLTimeRanges object
Stores a collection of ranges (periods) of time.
![]() ![]() |
Members
The HTMLTimeRanges object has these types of members:
Methods
The HTMLTimeRanges object has these methods.
| Method | Description |
|---|---|
| end |
Returns the end of the time range by using the specified index. |
| start |
Gets the start of the time range by using the specified index. |
Properties
The HTMLTimeRanges object has these properties.
| Property | Description |
|---|---|
|
The number of time ranges in the collection. |
Standards information
Remarks
A HTMLTimeRanges object represents the collection of ranges from the media resource that have been buffered or played. Ranges in a HTMLTimeRanges collection are sequential and not empty. Adjacent ranges are combined together to create longer ones.
Examples
The following script shows how to access the list of ranges that have been played.
var ranges = document.getElementById('myVideo').played; for (var i=0; i<ranges.length; i++){ var start = ranges.start(i); var end = ranges.end(i); // display results to developer tools console window if (window.console.log){ window.console.log("Played from " + start + " to " + end); } }
See also
Show:

