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.
Pure computation of the active transcript cue for a given playback position.
A cue is active when
currentMsfalls within[StartMs, end)whereendis:EndMswhen present, ORStartMs(the cue runs until the next one begins), OR+Infinityfor the final cue with noEndMs(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.