HTMLTimeRanges object
[This documentation is preliminary and is subject to change.]
Stores a collection of ranges (periods) of time.
![]() ![]() |
Standards information
- HTML5 A vocabulary and associated APIs for HTML and XHTML, Section 4.8.9.11
Remarks
A IHTMLTimeRanges object represents the collection of ranges from the media resource that have been buffered or played. Ranges in a IHTMLTimeRanges 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
Build date: 2/14/2012

