createSegmentPrefetch_(stream) {
    const ContentType = shaka.util.ManifestParserUtils.ContentType;
    if (stream.type === ContentType.VIDEO &&
        this.config_.disableVideoPrefetch) {
      return null;
    }
    if (stream.type === ContentType.AUDIO &&
        this.config_.disableAudioPrefetch) {
      return null;
    }
    const MimeUtils = shaka.util.MimeUtils;
    const CEA608_MIME = MimeUtils.CEA608_CLOSED_CAPTION_MIMETYPE;
    const CEA708_MIME = MimeUtils.CEA708_CLOSED_CAPTION_MIMETYPE;
    if (stream.type === ContentType.TEXT &&
        (stream.mimeType == CEA608_MIME || stream.mimeType == CEA708_MIME)) {
      return null;
    }
    if (stream.type === ContentType.TEXT &&
        this.config_.disableTextPrefetch) {
      return null;
    }
    if (this.audioPrefetchMap_.has(stream)) {
      return this.audioPrefetchMap_.get(stream);
    }
    const type = /** @type {!shaka.util.ManifestParserUtils.ContentType} */
        (stream.type);
    const mediaState = this.mediaStates_.get(type);
    const currentSegmentPrefetch = mediaState && mediaState.segmentPrefetch;
    if (currentSegmentPrefetch &&
      stream === currentSegmentPrefetch.getStream()) {
      return currentSegmentPrefetch;
    }
    if (this.config_.segmentPrefetchLimit > 0) {
      const reverse = this.playerInterface_.getPlaybackRate() < 0;
      return new shaka.media.SegmentPrefetch(
          this.config_.segmentPrefetchLimit,
          stream,
          (reference, stream, streamDataCallback) => {
            return this.dispatchFetch_(reference, stream, streamDataCallback);
          },
          reverse);
    }
    return null;
  }
Creates a media state.

@param {shaka.extern.Stream} stream
@return {shaka.media.SegmentPrefetch | null}
@private