getIteratorForTime(time, allowNonIndependent = false, reverse = false) {
    let index = this.find(time);
    if (index == null) {
      return null;
    }

    const ref = this.get(index);

    // Adjust index to point to previous or next index (if reversed), so first
    // next() call will traverse in proper direction.
    if (!reverse) {
      index--;
    } else {
      index++;
    }

    let partialSegmentIndex = -1;
    if (ref && ref.hasPartialSegments()) {
      // Look for a partial SegmentReference.
      for (let i = ref.partialReferences.length - 1; i >= 0; --i) {
        let r = ref.partialReferences[i];
        // Note that a segment ends immediately before the end time.
        if ((time >= r.startTime) && (time < r.endTime)) {
          if (!allowNonIndependent) {
            // Find an independent partial segment by moving backwards.
            while (i && (!r.isIndependent())) {
              i--;
              r = ref.partialReferences[i];
            }
            if (!r.isIndependent()) {
              shaka.log.alwaysError('No independent partial segment found!');
              return null;
            }
          }
          // Call to next() should move the partial segment, not the full
          // segment.
          if (reverse) {
            index--;
          } else {
            index++;
          }
          partialSegmentIndex = i - 1;
          break;
        }
      }
    }
    return new shaka.media.SegmentIterator(
        this, index, partialSegmentIndex, reverse);
  }
Returns a new iterator that initially points to the segment that contains
the given time, or the nearest independent segment before it.

Like the normal iterator, next() must be called first to get to the first
element. Returns null if we do not find a segment at the
requested time.

The first segment returned by the iterator _MUST_ be an independent
segment.  Assumes that only partial references can be dependent, based on
RFC 8216 rev 13, section 8.1: "Each (non-Partial) Media Segment in a Media
Playlist will contain at least one independent frame."

@param {number} time
@param {boolean=} allowNonIndependent
@param {boolean=} reverse
@return {?shaka.media.SegmentIterator}
@export