onActiveQualityChange method

  1. @override
void onActiveQualityChange(
  1. int audioTrackUid,
  2. int qualityUid
)
override

Implementation

@override
void onActiveQualityChange(int audioTrackUid, int qualityUid) {
  AudioTrackImpl? audioTrack = _audioTracks.firstWhereOrNull((item) => item.uid == audioTrackUid) as AudioTrackImpl?;
  AudioQuality? audioQuality = audioTrack?.qualities.firstWhereOrNull((item) => item.uid == qualityUid);
  if (audioTrack == null || audioQuality == null) {
    return;
  }

  audioTrack.activeQuality = audioQuality;
  audioTrack.dispatchEvent(AudioActiveQualityChangedEvent(quality: audioQuality));
}