Skip to content

Commit

Permalink
Merge pull request #768 from jerry2013/patch-2
Browse files Browse the repository at this point in the history
add setDefaultAudioOutput to source
  • Loading branch information
hthetiot authored Apr 17, 2023
2 parents a1bef4f + 0be73f8 commit 7e3bf8a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
13 changes: 12 additions & 1 deletion js/iosrtc.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,13 @@ module.exports = {
// Select audio output (earpiece or speaker).
selectAudioOutput: selectAudioOutput,

// Set default audio output (earpiece or speaker).
setDefaultAudioOutput: setDefaultAudioOutput,

// turnOnSpeaker with options
turnOnSpeaker: turnOnSpeaker,

// Checking permision (audio and camera)
// Checking permission (audio and camera)
requestPermission: requestPermission,

// Expose a function to initAudioDevices if needed, sets the audio session active
Expand Down Expand Up @@ -101,6 +104,14 @@ function selectAudioOutput(output) {
}
}

function setDefaultAudioOutput(output) {
debug('setDefaultAudioOutput() | [output:"%s"]', output);
if (!['earpiece', 'speaker'].includes(output)) {
throw new Error('output must be "earpiece" or "speaker"');
}
exec(null, null, 'iosrtcPlugin', 'setDefaultAudioOutput', [output === 'speaker']);
}

function turnOnSpeaker(isTurnOn) {
debug('turnOnSpeaker() | [isTurnOn:"%s"]', isTurnOn);

Expand Down
4 changes: 2 additions & 2 deletions www/cordova-plugin-iosrtc.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* cordova-plugin-iosrtc v8.0.2
* cordova-plugin-iosrtc v8.0.3
* Cordova iOS plugin exposing the full WebRTC W3C JavaScript APIs
* Copyright 2015-2017 eFace2Face, Inc. (https://eface2face.com)
* Copyright 2015-2019 BasqueVoIPMafia (https://github.com/BasqueVoIPMafia)
* Copyright 2017-2022 Cordova-RTC (https://github.com/cordova-rtc)
* Copyright 2017-2023 Cordova-RTC (https://github.com/cordova-rtc)
* License MIT
*/

Expand Down

0 comments on commit 7e3bf8a

Please sign in to comment.