onActiveQualityChange method

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

Implementation

@override
void onActiveQualityChange(int videoTrackUid, int qualityUid) {
  VideoTrackImpl? videoTrack = _videoTracks.firstWhereOrNull((item) => item.uid == videoTrackUid) as VideoTrackImpl?;
  VideoQuality? videoQuality = videoTrack?.qualities.firstWhereOrNull((item) => item.uid == qualityUid);
  if (videoTrack == null || videoQuality == null) {
    return;
  }

  videoTrack.activeQuality = videoQuality;
  videoTrack.dispatchEvent(VideoActiveQualityChangedEvent(quality: videoQuality));
}