function createFakeBuffered(ranges) {
  return /** @type {!TimeRanges} */ ({
    length: ranges.length,
    start: (i) => {
      if (i >= 0 && i < ranges.length) {
        return ranges[i].start;
      }
      throw new Error('Unexpected index');
    },
    end: (i) => {
      if (i >= 0 && i < ranges.length) {
        return ranges[i].end;
      }
      throw new Error('Unexpected index');
    },
  });
}
Creates a fake buffered ranges object.

@param {!Array<{start: number, end: number}>} ranges
@return {!TimeRanges}