static createSegmentReferences_(
      periodStart, periodDuration, startNumber, getBaseUris, info,
      initSegmentReference, aesKey, mimeType, codecs, bandwidth, urlParams) {
    const ManifestParserUtils = shaka.util.ManifestParserUtils;

    let max = info.mediaSegments.length;
    if (info.timeline && info.timeline.length != info.mediaSegments.length) {
      max = Math.min(info.timeline.length, info.mediaSegments.length);
      shaka.log.warning(
          'The number of items in the segment timeline and the number of ',
          'segment URLs do not match, truncating', info.mediaSegments.length,
          'to', max);
    }

    const timestampOffset = periodStart - info.scaledPresentationTimeOffset;
    const appendWindowStart = periodStart;
    const appendWindowEnd = periodDuration ?
        periodStart + periodDuration : Infinity;

    /** @type {!Array<!shaka.media.SegmentReference>} */
    const references = [];
    let prevEndTime = info.startTime;
    for (let i = 0; i < max; i++) {
      const segment = info.mediaSegments[i];
      const startTime = prevEndTime;
      let endTime;

      if (info.segmentDuration != null) {
        endTime = startTime + info.segmentDuration;
      } else if (info.timeline) {
        // Ignore the timepoint start since they are continuous.
        endTime = info.timeline[i].end;
      } else {
        // If segmentDuration and timeline are null then there must
        // be exactly one segment.
        goog.asserts.assert(
            info.mediaSegments.length == 1 && periodDuration,
            'There should be exactly one segment with a Period duration.');
        endTime = startTime + periodDuration;
      }

      let uris = null;
      const getUris = () => {
        if (uris == null) {
          uris = ManifestParserUtils.resolveUris(
              getBaseUris(), [segment.mediaUri], urlParams());
        }
        return uris;
      };

      const ref = new shaka.media.SegmentReference(
          periodStart + startTime,
          periodStart + endTime,
          getUris,
          segment.start,
          segment.end,
          initSegmentReference,
          timestampOffset,
          appendWindowStart, appendWindowEnd,
          /* partialReferences= */ [],
          /* tilesLayout= */ '',
          /* tileDuration= */ null,
          /* syncTime= */ null,
          shaka.media.SegmentReference.Status.AVAILABLE,
          aesKey);
      ref.codecs = codecs;
      ref.mimeType = mimeType;
      ref.bandwidth = bandwidth;
      references.push(ref);
      prevEndTime = endTime;
    }

    return references;
  }
Creates an array of segment references for the given data.

@param {number} periodStart in seconds.
@param {?number} periodDuration in seconds.
@param {number} startNumber
@param {function(): !Array<string>} getBaseUris
@param {shaka.dash.SegmentList.SegmentListInfo} info
@param {shaka.media.InitSegmentReference} initSegmentReference
@param {shaka.extern.aesKey|undefined} aesKey
@param {string} mimeType
@param {string} codecs
@param {number} bandwidth
@param {function():string} urlParams
@return {!Array<!shaka.media.SegmentReference>}
@private