onTextTrackAddDateRangeCue method

  1. @override
void onTextTrackAddDateRangeCue(
  1. int textTrackUid,
  2. String id,
  3. int uid,
  4. double startTime,
  5. double endTime,
  6. String? cueClass,
  7. double startDateMillis,
  8. double? endDateMillis,
  9. double? duration,
  10. double? plannedDuration,
  11. bool endOnNext,
  12. String? customAttributesJson,
)
override

Implementation

@override
void onTextTrackAddDateRangeCue(int textTrackUid, String id, int uid, double startTime, double endTime, String? cueClass, double startDateMillis, double? endDateMillis, double? duration,
    double? plannedDuration, bool endOnNext, String? customAttributesJson) {
  TextTrack? textTrack = _textTracks.firstWhereOrNull((item) => item.uid == textTrackUid);
  if (textTrack == null) {
    return;
  }

  Map<String, dynamic>? customAttributes;
  if (customAttributesJson != null) {
    customAttributes = json.decode(customAttributesJson) as Map<String, dynamic>;
  }

  Cue cue = DateRangeCueImpl(id, uid, startTime, endTime, DateTime.fromMillisecondsSinceEpoch(startDateMillis.toInt()),
      endDateMillis != null ? DateTime.fromMillisecondsSinceEpoch(endDateMillis.toInt()) : null, duration, plannedDuration, cueClass, endOnNext, customAttributes);
  textTrack.cues.add(cue);
  (textTrack as TextTrackImpl).dispatchEvent(TextTrackAddCueEvent(track: textTrack, cue: cue));
}