onTargetQualityChange method
void
onTargetQualityChange()
override
Implementation
@override
void onTargetQualityChange(int audioTrackUid, List<int?> qualitiesUid, int? qualityUid) {
AudioTrackImpl? audioTrack = _audioTracks.firstWhereOrNull((item) => item.uid == audioTrackUid) as AudioTrackImpl?;
if (audioTrack == null) {
return;
}
AudioQualitiesImpl targetQualities = AudioQualitiesImpl();
targetQualities.addAll(
audioTrack.qualities.where((element) => qualitiesUid.contains(element.uid))
);
AudioQuality? targetQuality = audioTrack.qualities.firstWhereOrNull((element) => element.uid == qualityUid);
audioTrack.targetQualities = targetQualities;
audioTrack.targetQuality = targetQuality;
audioTrack.dispatchEvent(AudioTargetQualityChangedEvent(qualities: targetQualities, quality: targetQuality));
}