onTargetQualityChange method
void
onTargetQualityChange()
override
Implementation
@override
void onTargetQualityChange(int videoTrackUid, List<int?> qualitiesUid, int? qualityUid) {
VideoTrackImpl? videoTrack = _videoTracks.firstWhereOrNull((item) => item.uid == videoTrackUid) as VideoTrackImpl?;
if (videoTrack == null) {
return;
}
VideoQualitiesImpl targetQualities = VideoQualitiesImpl();
targetQualities.addAll(
videoTrack.qualities.where((element) => qualitiesUid.contains(element.uid))
);
VideoQuality? targetQuality = videoTrack.qualities.firstWhereOrNull((element) => element.uid == qualityUid);
videoTrack.targetQualities = targetQualities;
videoTrack.targetQuality = targetQuality;
videoTrack.dispatchEvent(VideoTargetQualityChangedEvent(qualities: targetQualities, quality: targetQuality));
}