onAudioRouteChanged method

FutureOr<void> onAudioRouteChanged(
  1. dynamic route
)
override

@detail callback @author dixing @brief Receive the callback when the audio route changes. @param route Current audio playback device. Refer to AudioRoute{@link #AudioRoute} for more information. @note - Either of the following actions will lead to audio route switching. See Set the Audio Route. - Connecting/Disconnecting an audio device. - Designating the other audio device by calling setAudioRoute{@link #RTCEngine#setAudioRoute}.

Implementation

FutureOr<void> onAudioRouteChanged(dynamic route) async {
  if ($instance == null || $instance is! IRTCEngineEventHandler) {
    return;
  }
  return ($instance as IRTCEngineEventHandler).onAudioRouteChanged?.call(
      t_AudioRoute.android_to_code($p_a.AudioRoute.values
          .firstWhere((t) => t.$value == route || t.name == route)));
}