react-native-webrtc / react-native-incall-manager

Handling media-routes/sensors/events during a audio/video chat on React Native
ISC License
559 stars 195 forks source link

Ringback plays briefly and then stops #101

Open danjenkins opened 6 years ago

danjenkins commented 6 years ago

I need to double check with the current release of react-native-webrtc but with the M69 work thats now in master branch, ringback works on outgoing calls very briefly and then stops (before I call InCallManager.stop()) - I presume the webrtc audio session gets started and then that stops the ringback using the shared app audio instance

Have you come across this before?

ckrodrigues commented 5 years ago

@danjenkins any progress on that?

zxcpoiu commented 5 years ago

Yes, webrtc will change audio mode internally, and it's global audio session instance. To avoid this:

I wonder if we can use react native's NativeModule to have more info of react-native-webrtc and cooperate more tightly as an config option.

zxcpoiu commented 5 years ago

The auto mode of this library should have handled this issue. Take a glance on the source code if you are using this lib manually.

manuquentin commented 5 years ago

Hi ! We've also upgraded to react-native-webrtc 1.69.2 and having this issue too. @danjenkins have you found a way the solve this ?

danjenkins commented 5 years ago

hey all - sorry I havent come back to this recently! Let me test some things out this week :)

zxcpoiu commented 5 years ago

I don't see this issue. :thinking:

I'm using: InCallManager.start({media: (shouldUseVideo ? 'video' : 'audio'), ringback: '_DTMF_'}); on android, and using callKit on ios

zxcpoiu commented 5 years ago

Btw, both M69 and M75 works fine

nick76567 commented 5 years ago

react-native-webrtc 1.69.2 on ios device has this issue. It is fine to call InCallManager.start when there is no webrtc connection (e.g, calling the start function after launch the app) but the ringback plays less than 1 second when there is webrtc connection.

zxcpoiu commented 5 years ago

But does't webrtc connection established means "Answer" in terms of telecommunication?

When the remote party send "early media" or "answered" ( which means webrtc connection established and the rtp stream is starting to send), the "ringback" should stop and play the remote rtp.

What is your scenario?

If you really need to play local ringback when rtp has established, have you tried to mute/enable=falseon all webrtc tracks first?

swiety85 commented 4 years ago

I had this problem too. For me, the source of the problem was the moment of calling InCallManager.start(...) - if you will call this before RNCallKeep didActivateAudioSession event, it will cut the sound in the moment of activating the audio session.

Originally I placed the InCallManager.start(...) in the didActivateAudioSession listener but I had other problems with unlocking the screen described in this issue: https://github.com/react-native-webrtc/react-native-callkeep/issues/231.

As a final solution, I just wait until the didActivateAudioSession event occurs and then call InCallManager.start(...). Now it works like a charm. :)

Hope that it helps somebody.

PS. Thx for the great library!

jikseyres16 commented 2 years ago

Thanks this solved my problem!

fukemy commented 2 years ago

@swiety85 , hi, did u call InCallManager.start(...) in outgoing case? In this case i dont have any method to trigger 'configAudioSession' method