prefetchSegmentsByTime(currTime, skipFirst = false) {
    goog.asserts.assert(this.prefetchLimit_ > 0,
        'SegmentPrefetch can not be used when prefetchLimit <= 0.');

    const logPrefix = shaka.media.SegmentPrefetch.logPrefix_(this.stream_);
    if (!this.stream_.segmentIndex) {
      shaka.log.debug(logPrefix, 'missing segmentIndex');
      return Promise.resolve();
    }
    if (!this.iterator_) {
      this.iterator_ = this.stream_.segmentIndex.getIteratorForTime(
          currTime, /* allowNonIndependent= */ true, this.reverse_);
    }
    if (!this.iterator_) {
      shaka.log.debug(logPrefix, 'missing iterator');
      return Promise.resolve();
    }
    if (skipFirst) {
      this.iterator_.next();
    }
    const promises = [];
    while (this.segmentPrefetchMap_.size < this.prefetchLimit_) {
      const reference = this.iterator_.next().value;
      if (!reference) {
        break;
      }
      // By default doesn't prefetch preload partial segments when using
      // byterange
      let prefetchAllowed = true;
      if (reference.isPreload() && reference.endByte != null) {
        prefetchAllowed = false;
      }
      if (reference.getStatus() ==
          shaka.media.SegmentReference.Status.MISSING) {
        prefetchAllowed = false;
      }
      if (reference.getSegmentData(/* allowDeleteOnSingleUse= */ false)) {
        prefetchAllowed = false;
      }
      if (prefetchAllowed && reference.initSegmentReference) {
        promises.push(this.prefetchInitSegment(
            reference.initSegmentReference));
      }
      if (prefetchAllowed && !this.segmentPrefetchMap_.has(reference)) {
        const segmentPrefetchOperation =
          new shaka.media.SegmentPrefetchOperation(this.fetchDispatcher_);
        promises.push(segmentPrefetchOperation.dispatchFetch(
            reference, this.stream_));
        this.segmentPrefetchMap_.set(reference, segmentPrefetchOperation);
      }
    }
    this.clearInitSegments_();
    return Promise.all(promises);
  }
Fetch next segments ahead of current time.

@param {number} currTime
@param {boolean=} skipFirst
@return {!Promise}
@public