async getBasicInfoFromSegments_(segments) {
    const HlsParser = shaka.hls.HlsParser;
    const defaultBasicInfo = shaka.media.SegmentUtils.getBasicInfoFromMimeType(
        this.config_.hls.mediaPlaylistFullMimeType);
    if (!segments.length) {
      return defaultBasicInfo;
    }
    const {segment, segmentIndex} = this.getAvailableSegment_(segments);
    const segmentUris = segment.getUris();
    const segmentUri = segmentUris[0];
    const parsedUri = new goog.Uri(segmentUri);
    const extension = parsedUri.getPath().split('.').pop();
    const rawMimeType = HlsParser.RAW_FORMATS_TO_MIME_TYPES_.get(extension);
    if (rawMimeType) {
      return shaka.media.SegmentUtils.getBasicInfoFromMimeType(
          rawMimeType);
    }

    const basicInfos = await Promise.all([
      this.getInfoFromSegment_(segment.initSegmentReference, 0),
      this.getInfoFromSegment_(segment, segmentIndex),
    ]);
    const contentMimeType = basicInfos[1].mimeType;
    const initData = basicInfos[0].data;
    const data = basicInfos[1].data;

    const validMp4Extensions = [
      'mp4',
      'mp4a',
      'm4s',
      'm4i',
      'm4a',
      'm4f',
      'cmfa',
      'mp4v',
      'm4v',
      'cmfv',
      'fmp4',
    ];
    const validMp4MimeType = [
      'audio/mp4',
      'video/mp4',
      'video/iso.segment',
    ];

    // The extension isn't always a good indicator that it's MP4, so we don't
    // take it into account during the first validation.
    const isMp4 = segment.initSegmentReference ||
        validMp4MimeType.includes(contentMimeType);

    if (!isMp4 && shaka.util.TsParser.probe(
        shaka.util.BufferUtils.toUint8(data))) {
      const basicInfo = shaka.media.SegmentUtils.getBasicInfoFromTs(
          data, this.config_.disableAudio, this.config_.disableVideo,
          this.config_.disableText);
      if (basicInfo) {
        return basicInfo;
      }
    } else if (isMp4 || validMp4Extensions.includes(extension)) {
      const basicInfo = shaka.media.SegmentUtils.getBasicInfoFromMp4(
          initData, data, this.config_.disableText);
      if (basicInfo) {
        return basicInfo;
      }
    }
    if (contentMimeType) {
      return shaka.media.SegmentUtils.getBasicInfoFromMimeType(
          contentMimeType);
    }
    return defaultBasicInfo;
  }
@param {!Array<!shaka.media.SegmentReference>} segments
@return {!Promise<shaka.media.SegmentUtils.BasicInfo>}
@private