Member Junction
    Preparing search index...
    • Pure computation of the active transcript cue for a given playback position.

      A cue is active when currentMs falls within [StartMs, end) where end is:

      • the cue's own EndMs when present, OR
      • the next cue's StartMs (the cue runs until the next one begins), OR
      • +Infinity for the final cue with no EndMs (runs to the end of the media).

      Cues are assumed to be in chronological order by StartMs. When more than one cue qualifies (overlapping ranges), the LAST qualifying cue wins, which matches the "most recently started" intuition for transcripts.

      Parameters

      • currentMs: number

        current playback position in milliseconds

      • cues: MediaTranscriptCue[] | null | undefined

        the ordered transcript cues

      Returns number

      the index of the active cue, or -1 if none is active (e.g. before the first cue)