Class: shaka.media.TimeRangesUtils

A set of utility functions for dealing with TimeRanges objects.

Source:

Members

(static, constant) GAP_TOLERANCE :number

Type:
  • number
Source:

Methods

(static) bufferedAheadOf(b, time) → {number}

Computes how far ahead of the given timestamp is buffered.
Parameters:
Name Type Description
b TimeRanges
time number
Source:
Returns:
The number of seconds buffered, in seconds, ahead of the given time.
Type
number

(static) bufferedAheadOfThreshold(b, time, tolerance) → {number}

Computes the amount buffered ahead, allowing a gap of the given size at the beginning.
Parameters:
Name Type Description
b TimeRanges
time number
tolerance number The size of the allowed gap, in seconds.
Source:
Returns:
The amount of content buffered, in seconds.
Type
number

(static) bufferEnd(b) → (nullable) {number}

Gets the last timestamp in buffer.
Parameters:
Name Type Description
b TimeRanges
Source:
Returns:
The last buffered timestamp, in seconds, if |buffered| is non-empty; otherwise, return null.
Type
number

(static) bufferStart(b) → (nullable) {number}

Gets the first timestamp in buffer.
Parameters:
Name Type Description
b TimeRanges
Source:
Returns:
The first buffered timestamp, in seconds, if |buffered| is non-empty; otherwise, return null.
Type
number