Skip to content

TimeRanges.end ​

JS
number TimeRanges.end(number index)

Gets the end time of the time range at the specified index; the return value is a time offset, in seconds (s)

Parameters

  • number index: which time range's end time to get

Return Value

  • number: time offset from the start of the video, in seconds (s)

Specification followed by the TimeRanges object

Each time range in TimeRanges conforms to the following rules:

  • The Range objects in the array are ordered
  • TimeRanges.start(index + 1) > TimeRanges.start(index)
  • TimeRanges.start(index ) <= TimeRanges.end(index)

In other words, the Ranges in TimeRanges are ordered, non-overlapping, and non-adjacent (adjacent Ranges are merged into a single larger Range); a Range can be empty (representing a single instant)