onTextTrackAddDateRangeCue method
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,
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));
}