vn.ows.audiotoggle
v1.0.1
Published
Toggle between speaker and earpiece when playing audio
Downloads
2
Maintainers
Readme
AudioToggle
Cordova plugin for switching between speaker and earpiece when playing audio.
cordova plugin add com.dooble.audiotoggle
Supported Platforms
- Android
- iOS
Usage
To set the current audio mode, use the setAudioMode
method:
AudioToggle.setAudioMode(AudioToggle.SPEAKER);
// or
AudioToggle.setAudioMode(AudioToggle.EARPIECE);
Android has the following additional options:
AudioToggle.setAudioMode(AudioToggle.NORMAL);
// and
AudioToggle.setAudioMode(AudioToggle.RINGTONE);
For Android Only With incall: AudioToggle.setAudioMode(AudioToggle.CALL_SPEAKER); AudioToggle.setAudioMode(AudioToggle.CALL_EARPIECE);