This topic has not yet been rated - Rate this topic

HTMLTimeRanges object

[This documentation is preliminary and is subject to change.]

Stores a collection of ranges (periods) of time.

HTML5 A vocabulary and associated APIs for HTML and XHTML, Section 4.8.9.11Internet Explorer 9

Standards information

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

Reference
buffered
played
seekable

 

 

Build date: 2/14/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ