Class: shaka.media.BufferingObserver

Constructor

new BufferingObserver(thresholdWhenStarving, thresholdWhenSatisfied)

Parameters:
Name Type Description
thresholdWhenStarving number
thresholdWhenSatisfied number
Source:

Members

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:

lastRebufferTime_ :number

Type:
  • number
Source:

Methods

getLastRebufferTime() → {number}

Return the last time that the state went from |STARVING| to |SATISFIED|.
Source:
Returns:
Type
number

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

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

resetLastRebufferTime()

Reset the last rebuffer time to zero.
Source:

setState(state)

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

setThresholds(thresholdWhenStarving, thresholdWhenSatisfied)

Parameters:
Name Type Description
thresholdWhenStarving number
thresholdWhenSatisfied number
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