async setProperties_(mediaState, timestampOffset, appendWindowStart,
      appendWindowEnd, reference, codecs, mimeType) {
    const ContentType = shaka.util.ManifestParserUtils.ContentType;

    /**
     * @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);
    }
    try {
      mediaState.lastAppendWindowStart = appendWindowStart;
      mediaState.lastAppendWindowEnd = appendWindowEnd;
      if (codecs) {
        mediaState.lastCodecs = codecs;
      }
      if (mimeType) {
        mediaState.lastMimeType = mimeType;
      }
      mediaState.lastTimestampOffset = timestampOffset;

      const ignoreTimestampOffset = this.manifest_.sequenceMode ||
          this.manifest_.type == shaka.media.ManifestParser.HLS;

      await this.playerInterface_.mediaSourceEngine.setStreamProperties(
          mediaState.type, timestampOffset, appendWindowStart,
          appendWindowEnd, ignoreTimestampOffset,
          reference.mimeType || mediaState.stream.mimeType,
          reference.codecs || mediaState.stream.codecs, streamsByType);
    } catch (error) {
      mediaState.lastAppendWindowStart = null;
      mediaState.lastAppendWindowEnd = null;
      mediaState.lastCodecs = null;
      mediaState.lastMimeType = null;
      mediaState.lastTimestampOffset = null;

      throw error;
    }
  }
@param {!shaka.media.StreamingEngine.MediaState_} mediaState
@param {number} timestampOffset
@param {number} appendWindowStart
@param {number} appendWindowEnd
@param {!shaka.media.SegmentReference} reference
@param {?string=} codecs
@param {?string=} mimeType
@private