static bufferedAheadOf(b, time) {
    if (!b || !b.length) {
      return 0;
    }
    if (shaka.media.TimeRangesUtils.isBufferNegligible_(b)) {
      return 0;
    }

    // We calculate the buffered amount by ONLY accounting for the content
    // buffered (i.e. we ignore the times of the gaps).  We also buffer through
    // all gaps.
    // Therefore, we start at the end and add up all buffers until |time|.
    let result = 0;
    for (const {start, end} of shaka.media.TimeRangesUtils.getBufferedInfo(b)) {
      if (end > time) {
        result += end - Math.max(start, time);
      }
    }

    return result;
  }
Computes how far ahead of the given timestamp is buffered.  To provide
smooth playback while jumping gaps, we don't include the gaps when
calculating this.
This only includes the amount of content that is buffered.

@param {TimeRanges} b
@param {number} time
@return {number} The number of seconds buffered, in seconds, ahead of the
  given time.