setSelectedClosedCaptionId(id, bufferEndTime) {
    this.selectedClosedCaptionId_ = id;

    const captionsMap = this.closedCaptionsMap_.get(id);
    if (captionsMap) {
      for (const startAndEndTime of captionsMap.keys()) {
        /** @type {Array<!shaka.text.Cue>} */
        const cues = captionsMap.get(startAndEndTime)
            .filter((c) => c.endTime <= bufferEndTime);
        if (cues) {
          this.displayer_.append(cues);
        }
      }
    }
  }
Set the selected closed captions id.
Append the cues stored in the closed captions map until buffer end time.
This is to fill the gap between buffered and unbuffered captions, and to
avoid duplicates that would be caused by any future video segments parsed
for captions.

@param {string} id
@param {number} bufferEndTime Load any stored cues up to this time.