OpenTV Player Web HTML5

Module: time-ranges

time-ranges

time-ranges.js

Methods

staticmodule:time-ranges.createTimeRanges(start, end)

Create a TimeRange object which mimics an HTML5 TimeRanges instance.

Name Type Description
start number | Array.<Array>

The start of a single range (a number) or an array of ranges (an array of arrays of two numbers each).

end number

The end of a single range. Cannot be used with the array form of the start argument.

Type Definitions

TimeRangeObject

An object that contains ranges of time.

Properties:
Name Type Description
length number

The number of time ranges represented by this object.

start module:time-ranges~TimeRangeIndex

Returns the time offset at which a specified time range begins.

end module:time-ranges~TimeRangeIndex

Returns the time offset at which a specified time range ends.

See:

TimeRangeIndex(index){number}

Returns the time for the specified index at the start or end of a TimeRange object.

Name Type Default Description
index number 0 optional

The range number to return the time for.

Deprecated
  • The index argument must be provided. In the future, leaving it out will throw an error.
    Returns:
    Type Description
    number The time offset at the specified index.