async handleStreamingError_(mediaState, error) {
    const logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);

    if (error.code == shaka.util.Error.Code.STREAMING_NOT_ALLOWED) {
      mediaState.performingUpdate = false;
      this.cancelUpdate_(mediaState);
      this.scheduleUpdate_(mediaState, 0);
      return;
    }

    // If we invoke the callback right away, the application could trigger a
    // rapid retry cycle that could be very unkind to the server.  Instead,
    // use the backoff system to delay and backoff the error handling.
    await this.failureCallbackBackoff_.attempt();
    this.destroyer_.ensureNotDestroyed();

    // Try to recover from network errors, but not timeouts.
    // See https://github.com/shaka-project/shaka-player/issues/7368
    if (error.category === shaka.util.Error.Category.NETWORK &&
        error.code != shaka.util.Error.Code.TIMEOUT) {
      if (mediaState.restoreStreamAfterTrickPlay) {
        this.setTrickPlay(/* on= */ false);
        return;
      }
      const maxDisabledTime = this.getDisabledTime_(error);
      if (maxDisabledTime) {
        shaka.log.debug(logPrefix, 'Disabling stream due to error', error);
      }
      error.handled = this.playerInterface_.disableStream(
          mediaState.stream, maxDisabledTime);

      // Decrease the error severity to recoverable
      if (error.handled) {
        error.severity = shaka.util.Error.Severity.RECOVERABLE;
      }
    }

    // First fire an error event.
    if (!error.handled ||
        error.code != shaka.util.Error.Code.SEGMENT_MISSING) {
      this.playerInterface_.onError(error);
    }

    // If the error was not handled by the application, call the failure
    // callback.
    if (!error.handled) {
      this.config_.failureCallback(error);
    }
  }
Handle streaming errors by delaying, then notifying the application by
error callback and by streaming failure callback.

@param {shaka.media.StreamingEngine.MediaState_} mediaState
@param {!shaka.util.Error} error
@return {!Promise}
@private