Skip to content

TimeRanges

Types

t

Used to represent a set of time ranges, primarily for the purpose of tracking which portions of media have been buffered when loading it for use by the <audio> and <video> elements. See TimeRanges on MDN

type t = private {length: int}

Record fields

length
int

Returns the number of ranges in the object. Read more on MDN

Values

end

Returns the time for the end of the range with the given index.

Throws an "IndexSizeError" DOMException if the index is out of range. Read more on MDN

let end: (t, int) => float

Parameters

tint

Return type

float

start

Returns the time for the start of the range with the given index.

Throws an "IndexSizeError" DOMException if the index is out of range. Read more on MDN

let start: (t, int) => float

Parameters

tint

Return type

float