Class: shaka.media.BufferingObserver

Constructor

new BufferingObserver(thresholdWhenStarving, thresholdWhenSatisfied)

Parameters:
Name Type Description
thresholdWhenStarving number
thresholdWhenSatisfied number
Source:

Members

(static) State :number

Rather than using booleans to communicate what state we are in, we have this enum.
Type:
  • number
Properties:
Name Value Type Description
STARVING 0 number
SATISFIED 1 number
Source:

(private, non-null) thresholds_ :Map.<shaka.media.BufferingObserver.State, number>

Type:
Source:

Methods

getState() → {shaka.media.BufferingObserver.State}

Get the state that the observer last thought playback was in.
Source:
Returns:
Type
shaka.media.BufferingObserver.State

setState(state)

Set which state that the observer should think playback was in.
Parameters:
Name Type Description
state shaka.media.BufferingObserver.State
Source:

update(bufferLead, bufferedToEnd) → {boolean}

Update the observer by telling it how much content has been buffered (in seconds) and if we are buffered to the end of the presentation. If the controller believes the state has changed, it will return |true|.
Parameters:
Name Type Description
bufferLead number
bufferedToEnd boolean
Source:
Returns:
Type
boolean