time-ranges.js
Methods
static createTimeRanges(start, end)
[utils/time-ranges.js](https://docs.videojs.com/utils_time-ranges.js.html)
, [line 127](https://docs.videojs.com/utils_time-ranges.js.html#line127)
Create a TimeRange
object which mimics an HTML5 TimeRanges instance.
Parameters:
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 |
Type Definitions
TimeRange
[utils/time-ranges.js](https://docs.videojs.com/utils_time-ranges.js.html)
, [line 22](https://docs.videojs.com/utils_time-ranges.js.html#line22)
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. |
TimeRangeIndex(indexopt) → {number}
[utils/time-ranges.js](https://docs.videojs.com/utils_time-ranges.js.html)
, [line 6](https://docs.videojs.com/utils_time-ranges.js.html#line6)
Returns the time for the specified index at the start or end of a TimeRange object.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
index | number | <optional> | 0 | The range number to return the time for. |
Returns:
number -
The time offset at the specified index.
Deprecated:
- The index argument must be provided. In the future, leaving it out will throw an error.