Skip to content

Switch setSpeakerPhoneOn based on headset plug

Problem to solve

If an headset get's plugged into the Android device the audio should get routed through the headset instead of the speakers. And once the headset is removed it should playback on speakers again.

Proposal

Implement the headset plug like React Native does: https://github.com/blackuy/react-native-twilio-video-webrtc/blob/master/android/src/main/java/com/twiliorn/library/CustomTwilioVideoView.java#L159