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:
thresholds_ :Map<shaka.media.BufferingObserver.State, number>
Type:
- Map<shaka.media.BufferingObserver.State, 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:
reportEvent(eventnon-null) → {boolean}
Parameters:
Name | Type | Description |
---|---|---|
event |
shaka.util.MediaElementEvent |
- Source:
Returns:
- Type
- boolean
resetLastRebufferTime()
Reset the last rebuffer time to zero.
- Source:
setState(state) → {boolean}
Set which state that the observer should think playback was in.
Parameters:
Name | Type | Description |
---|---|---|
state |
shaka.media.BufferingObserver.State |
- Source:
Returns:
- Type
- boolean
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