AgoraIO-Community / VideoUIKit-ReactNative

A React Native package to simply integrate Agora Video Calling or Live Video Streaming to your app with just a few lines of code.
MIT License
93 stars 43 forks source link

By using this package, I integrated the audio functionality. However, the voice is currently coming through the speaker. How can we enable the audio to use the earpiece instead? #158

Open pavaniUMR opened 3 months ago

pavaniUMR commented 3 months ago

Implemented by using the agora UIkit for audio and video. For audio the voice is come from loudspeaker after here is the code snippet const setupVideoSDKEngine = async () => { agoraEngineRef.current = createAgoraRtcEngine(); const agoraEngine = agoraEngineRef.current; const inalizationofAgora = agoraEngine.initialize({ appId: remoteConfig().getValue('agoraAppId').asString(), channelProfile: ChannelProfileType.ChannelProfileCommunication, }); if (route.params.connectType == 'audio') { agoraEngine.disableVideo(); agoraEngine.enableLocalVideo(false); agoraEngine?.current?.setEnableSpeakerphone(false); if (muteStatus === true) { agoraEngine.disableAudio(); agoraEngine.muteLocalAudioStream(true); } } else { agoraEngine.enableVideo(); agoraEngine.enableLocalVideo(true); videoEnableStatusRef.current = true; } }; and the <AgoraUI channelName={agoraChannelName} token={agoraToken} rtcCallbacks={rtcCallbacks} connectType={route.params.connectType} />