react-native-twilio-video-webrtc
react-native-twilio-video-webrtc copied to clipboard
Route audio to bluetooth headset
Is there any way to route audio to bluetooth headset (especially on iOS)? When answering the call by clicking answer button on the screen audio is routed trough phone/speaker, how can I switch it back to bluetooth headset? I know there is setBluetoothHeadsetConnected() but it seems to not doing anything iOS.
Does toggleSoundSetup work?
@slycoder it does but it takes only true|false as an argument so I can only switch between phone and speaker, not to bluetooth headset
If speaker is false I believe it goes through the "default route" which should be bluetooth (i.e. "phone" in this case should be bluetooth).
@slycoder yes, but only if you receive the call using answer button on bluetooth headset. When answering using phone screen, there is no possibility to switch to bluetooth. I thnk it's iOS logic I think, but it's really dumb, I often have my headphones but when doing something on the phone I am just using it to answer the call.
Related to #285
@slycoder I am also facing this exactly. Route audio to bluetooth or bluetooth to audio is not working.
@albertc180 Is there right way to handle this? How do we know when to toggle?
No this still isn't fixed to my knowledge
@shamilovtim Found library for audio route! https://github.com/twilio/audioswitch This is developed by twilio recently and they had implemented in quickstart repo as well.
Can we also check and implement if its worked well.
FYI @slycoder @Praxey
Looks promising. Do you know if anyone has made react native bindings for it yet?
Correct me if I'm wrong but the OS is supposed to be able to route audio to bluetooth without any effort or custom code on our part. I think what's happening here is that there is code in the plugin that actively prevents the audio from going to bluetooth or the current connected audio device. That code should probably be changed.
@shamilovtim Yes. OS is supposed to do all this by default. I am also surprised while things are working perfectly on iOS.
Did you manage to get it to work?
ok, it is not ideal, but this is my simple solution https://github.com/Andriiklymiuk/react-native-twilio-video-webrtc/commit/a29a8485b885d2fb06008861fdd232c515317654
Has there been any resolution to this? Audio still routing through device speaker (android) when bluetooth is connected, with no manual intervention.