react-native-webrtc / react-native-callkeep

iOS CallKit framework and Android ConnectionService for React Native
ISC License
910 stars 440 forks source link

Can not turn on speaker! (Set loudspeaker) #578

Open tabvn opened 2 years ago

tabvn commented 2 years ago

Anyone luck with video call and turn on speaker. Currently audio ouput is small for video call it seem using earIn

 const routes = await RNCallKeep.getAudioRoutes();
      console.log('DEBUG routes', routes, uuid);
      if (routes && routes.length) {
        const route = routes.find((r) => r.type === 'Speaker');
        if (route) {
          console.log('ACTIVE route', route);
          await RNCallKeep.setAudioRoute(uuid, route.name);
        }
      }

Best regards, Toan

tabvn commented 2 years ago

The problem is video call but can not turn on speaker. Anyone has solved this problem? Thank you!

tabvn commented 2 years ago

Start call

 RNCallKeep.startCall(id, `${user.phone}`, '+84...', 'number', true);

Answer call

 RNCallKeep.displayIncomingCall(
                data.id,
                `${data.caller.phone}`,
                `${data.caller.firstName}`,
                'number',
                true
              );
const onAnswerCallAction = (data) => {
      let { callUUID } = data;
      RNCallKeep.setCurrentCallActive(callUUID);
      //RNCallKeep.answerIncomingCall(callUUID);
      //RNCallKeep.setAudioRoute(callUUID, 'Speaker');
      console.log('answer call', data);
      if (!isIOS) {
        RNCallKeep.backToForeground();
      }
      dispatch(accept(callUUID));
    };
saheemhussain commented 2 years ago

Hi @tabvn did you resolve the issue?

dragoshuniq commented 1 year ago

anybody could fix this problem?

kukadiyaAni commented 1 year ago

anyone find solution if yes please share here @tabvn

glesperance commented 1 year ago

@dragoshuniq @kukadiyaAni @saheemhussainchicmic check out https://github.com/react-native-webrtc/react-native-incall-manager This was a solution for me -- although I am still having some inconsistencies with some edge cases (eg when a call is in progress, the volume control doesn't work on Android)

anujraghuvanshi commented 1 year ago

Hi, @glesperance I am also trying the plugin mentioned by you. Yet it's not working for me. Can you please share all things you did to make it work?

dhcmega commented 4 months ago

Hi, is this still a problem? I'm facing the same situation. Thanks