onQualityUpdate method

  1. @override
void onQualityUpdate(
  1. int audioTrackUid,
  2. int qualityUid,
  3. String? name,
  4. int bandwidth,
  5. String? codecs,
  6. int audioSamplingRate,
)
override

Implementation

@override
void onQualityUpdate(int audioTrackUid, int qualityUid, String? name, int bandwidth, String? codecs, int audioSamplingRate) {
  AudioTrack? audioTrack = _audioTracks.firstWhereOrNull((item) => item.uid == audioTrackUid);
  AudioQualityImpl? audioQuality = audioTrack?.qualities.firstWhereOrNull((item) => item.uid == qualityUid) as AudioQualityImpl?;
  if (audioQuality == null) {
    return;
  }

  audioQuality.update(name, bandwidth, codecs, audioSamplingRate);
  audioQuality.dispatchEvent(AudioQualityUpdateEvent());
}