async resetMediaSource(force = false, clearBuffer = true) {
    const now = (Date.now() / 1000);
    const minTimeBetweenRecoveries = this.config_.minTimeBetweenRecoveries;
    if (!force) {
      if (!this.config_.allowMediaSourceRecoveries ||
          (now - this.lastMediaSourceReset_) < minTimeBetweenRecoveries) {
        return false;
      }
      this.lastMediaSourceReset_ = now;
    }
    const ContentType = shaka.util.ManifestParserUtils.ContentType;
    const audioMediaState = this.mediaStates_.get(ContentType.AUDIO);
    if (audioMediaState) {
      audioMediaState.lastInitSegmentReference = null;
      audioMediaState.lastAppendWindowStart = null;
      audioMediaState.lastAppendWindowEnd = null;
      if (clearBuffer) {
        this.forceClearBuffer_(audioMediaState);
      }
      this.abortOperations_(audioMediaState).catch(() => {});
      if (audioMediaState.segmentIterator) {
        audioMediaState.segmentIterator.resetToLastIndependent();
      }
      this.cancelUpdate_(audioMediaState);
    }
    const videoMediaState = this.mediaStates_.get(ContentType.VIDEO);
    if (videoMediaState) {
      videoMediaState.lastInitSegmentReference = null;
      videoMediaState.lastAppendWindowStart = null;
      videoMediaState.lastAppendWindowEnd = null;
      if (clearBuffer) {
        this.forceClearBuffer_(videoMediaState);
      }
      this.abortOperations_(videoMediaState).catch(() => {});
      if (videoMediaState.segmentIterator) {
        videoMediaState.segmentIterator.resetToLastIndependent();
      }
      this.cancelUpdate_(videoMediaState);
    }
    /**
     * @type {!Map<shaka.util.ManifestParserUtils.ContentType,
     *              shaka.extern.Stream>}
     */
    const streamsByType = new Map();
    if (this.currentVariant_.audio) {
      streamsByType.set(ContentType.AUDIO, this.currentVariant_.audio);
    }
    if (this.currentVariant_.video) {
      streamsByType.set(ContentType.VIDEO, this.currentVariant_.video);
    }
    await this.playerInterface_.mediaSourceEngine.reset(streamsByType);
    if (videoMediaState && !videoMediaState.clearingBuffer &&
        !videoMediaState.performingUpdate && !videoMediaState.updateTimer) {
      this.scheduleUpdate_(videoMediaState, 0);
    }
    if (audioMediaState && !audioMediaState.clearingBuffer &&
          !audioMediaState.performingUpdate && !audioMediaState.updateTimer) {
      this.scheduleUpdate_(audioMediaState, 0);
    }
    return true;
  }
Reset Media Source

@param {boolean=} force
@return {!Promise<boolean>}