static parseCues_(cuesElement, segmentOffset, timecodeScale, duration,
      uris, initSegmentReference, timestampOffset, appendWindowStart,
      appendWindowEnd) {
    const references = [];
    const getUris = () => uris;

    const parser = cuesElement.createParser();

    let lastTime = null;
    let lastOffset = null;

    while (parser.hasMoreData()) {
      const elem = parser.parseElement();
      if (elem.id != shaka.dash.WebmSegmentIndexParser.CUE_POINT_ID) {
        continue;
      }

      const tuple = shaka.dash.WebmSegmentIndexParser.parseCuePoint_(elem);
      if (!tuple) {
        continue;
      }

      // Subtract the presentation time offset from the unscaled time
      const currentTime = timecodeScale * tuple.unscaledTime;
      const currentOffset = segmentOffset + tuple.relativeOffset;

      if (lastTime != null) {
        goog.asserts.assert(lastOffset != null, 'last offset cannot be null');

        references.push(
            new shaka.media.SegmentReference(
                lastTime + timestampOffset,
                currentTime + timestampOffset,
                getUris,
                /* startByte= */ lastOffset, /* endByte= */ currentOffset - 1,
                initSegmentReference,
                timestampOffset,
                appendWindowStart,
                appendWindowEnd));
      }

      lastTime = currentTime;
      lastOffset = currentOffset;
    }

    if (lastTime != null) {
      goog.asserts.assert(lastOffset != null, 'last offset cannot be null');

      references.push(
          new shaka.media.SegmentReference(
              lastTime + timestampOffset,
              duration + timestampOffset,
              getUris,
              /* startByte= */ lastOffset, /* endByte= */ null,
              initSegmentReference,
              timestampOffset,
              appendWindowStart,
              appendWindowEnd));
    }

    return references;
  }
Parses a WebM CuesElement.
@param {!shaka.util.EbmlElement} cuesElement
@param {number} segmentOffset
@param {number} timecodeScale
@param {number} duration
@param {!Array<string>} uris
@param {shaka.media.InitSegmentReference} initSegmentReference
@param {number} timestampOffset
@param {number} appendWindowStart
@param {number} appendWindowEnd
@return {!Array<!shaka.media.SegmentReference>}
@private