update(bufferLead, bufferedToEnd) {
    const State = shaka.media.BufferingObserver.State;

    /**
     * Our threshold for how much we need before we declare ourselves as
     * starving is based on whether or not we were just starving. If we
     * were just starving, we are more likely to starve again, so we require
     * more content to be buffered than if we were not just starving.
     *
     * @type {number}
     */
    const threshold = this.thresholds_.get(this.previousState_);

    const oldState = this.previousState_;
    const newState =
        (bufferedToEnd || (bufferLead >= threshold && bufferLead > 0)) ?
        (State.SATISFIED) :
        (State.STARVING);

    // Save the new state now so that calls to |getState| from any callbacks
    // will be accurate.
    this.previousState_ = newState;

    // Return |true| only when the state has changed.
    const stateChanged = oldState != newState;

    if (stateChanged && newState === State.SATISFIED) {
      this.lastRebufferTime_ = Date.now();
    }

    return stateChanged;
  }
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|.

@param {number} bufferLead
@param {boolean} bufferedToEnd
@return {boolean}