-
Notifications
You must be signed in to change notification settings - Fork 462
Audio route to speaker for Android platform #295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 9 commits
be5f3fb
adc6bba
49d984f
3fc6c55
c34ae22
749318c
6c4a7cb
b0a2fda
7c69d82
4dd66ad
b431d5c
e68ec34
af87fcf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -417,6 +417,23 @@ public void setMutedCall(String uuid, boolean shouldMute) { | |
} | ||
conn.onCallAudioStateChanged(newAudioState); | ||
} | ||
/** | ||
* toggle audio route for speaker via connection service function | ||
* @param uuid | ||
* @param routeSpeaker | ||
*/ | ||
@ReactMethod | ||
public void toggleAudioRouteSpeaker(String uuid, boolean routeSpeaker) { | ||
VoiceConnection conn = (VoiceConnection) VoiceConnectionService.getConnection(uuid); | ||
if (conn == null) { | ||
return; | ||
} | ||
if(useSpeaker){ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It should be |
||
conn.setAudioRoute(CallAudioState.ROUTE_SPEAKER); | ||
}else{ | ||
conn.setAudioRoute(CallAudioState.ROUTE_EARPIECE); | ||
} | ||
} | ||
|
||
@ReactMethod | ||
public void sendDTMF(String uuid, String key) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -182,7 +182,14 @@ class RNCallKeep { | |
}; | ||
|
||
sendDTMF = (uuid, key) => RNCallKeepModule.sendDTMF(uuid, key); | ||
|
||
/** | ||
* @description when Phone call is active, Android control the audio service via connection service. so this function help to toggle the audio to Speaker or wired/ear-piece or vice-versa | ||
* @param {*} uuid | ||
* @param {*} routeSpeaker | ||
* @returns Audio route state of audio service | ||
*/ | ||
Comment on lines
+185
to
+190
This comment was marked as resolved.
Sorry, something went wrong. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updated here b0a2fda please review |
||
toggleAudioRouteSpeaker = (uuid, routeSpeaker) => isIOS ? null : RNCallKeepModule.toggleAudioRouteSpeaker(uuid, routeSpeaker); | ||
|
||
checkIfBusy = () => | ||
isIOS ? RNCallKeepModule.checkIfBusy() : Promise.reject('RNCallKeep.checkIfBusy was called from unsupported OS'); | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.