setDefaultAudioRouteToSpeakerphone abstract method

Future<void> setDefaultAudioRouteToSpeakerphone(
  1. bool defaultToSpeaker
)

Sets the default audio playback route. This method sets whether the received audio is routed to the earpiece or speakerphone by default before joining a channel. If a user does not call this method, the audio is routed to the earpiece by default. The default settings for each profile: For the communication profile: In a voice call, the default audio route is the earpiece. In a video call, the default audio route is the speakerphone. If a user calls the disableVideo , muteLocalVideoStream , or muteAllRemoteVideoStreams method, the default audio route switches back to the earpiece automatically. For the live broadcasting profile: Speakerphone. This method applies to Android and iOS only. This method needs to be set before , otherwise, it will not take effect.

Param defaultToSpeaker The default audio playback route. true: The audio routing is speakerphone. If the device connects to the earpiece or Bluetooth, the audio cannot be routed to the speakerphone. false: (Default) Route the audio to the earpiece. If a headset is plugged in, the audio is routed to the headset.

Implementation

Future<void> setDefaultAudioRouteToSpeakerphone(bool defaultToSpeaker);