Skip to content

Latest commit

 

History

History
24 lines (15 loc) · 569 Bytes

README.md

File metadata and controls

24 lines (15 loc) · 569 Bytes

AudioToggle

Cordova plugin for switching between speaker and earpiece when playing audio.

cordova plugin add https://github.com/neohelden/cordova-plugin-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);