DOM Interfaces

TimeRanges

Represents normalized intervals of media time. Intervals are ordered and non-overlapping; length counts intervals rather than seconds. Each has a start and end. The example inspects an empty player. Example result: true.

Formal Syntax & Structure

html syntaxhtml
media.buffered

Return Value

TimeRanges

Collection of intervals.

Working Example

Example Snippethtml
<p>  Result:  <output id="result"></output></p><script>  const result = document.getElementById("result");  (async () => {  const media = document.createElement("audio"); document.body.append(media);  result.textContent = media.buffered instanceof TimeRanges;  })().catch(error => { result.textContent = "Error: " + error.name; });</script>
HTML Reference