onTextTrackAddCue method

  1. @override
void onTextTrackAddCue(
  1. int textTrackUid,
  2. String id,
  3. int uid,
  4. double startTime,
  5. double endTime,
  6. String content,
)
override

Implementation

@override
void onTextTrackAddCue(int textTrackUid, String id, int uid, double startTime, double endTime, String content) {
  TextTrack? textTrack = _textTracks.firstWhereOrNull((item) => item.uid == textTrackUid);
  if (textTrack == null) {
    return;
  }

  Cue cue = CueImpl(id, uid, startTime, endTime, content);
  textTrack.cues.add(cue);
  (textTrack as TextTrackImpl).dispatchEvent(TextTrackAddCueEvent(track: textTrack, cue: cue));
}