@anuradev/capacitor-audio-toggle
v8.0.3
Published
Capacitor plugin to audio toggle
Readme
@anuradev/capacitor-audio-toggle
Capacitor plugin to audio toggle
The Android implementation targets VoIP communication audio and requires Android 10 (API 29) or newer. Call reset() when the VoIP session ends so the plugin releases audio focus and restores the previous audio mode.
Install
npm install @anuradev/capacitor-audio-toggle
npx cap syncAPI
setSpeakerOn(...)
setSpeakerOn(data: { speakerOn: boolean; }) => Promise<SpeakerStatus>| Param | Type |
| ---------- | ------------------------------------ |
| data | { speakerOn: boolean; } |
Returns: Promise<SpeakerStatus>
reset()
reset() => Promise<void>addListener('speakerOn', ...)
addListener(eventName: 'speakerOn', listenerFunc: (data: SpeakerStatus) => void) => Promise<PluginListenerHandle>| Param | Type |
| ------------------ | -------------------------------------------------------------------------- |
| eventName | 'speakerOn' |
| listenerFunc | (data: SpeakerStatus) => void |
Returns: Promise<PluginListenerHandle>
removeAllListeners()
removeAllListeners() => Promise<void>Interfaces
SpeakerStatus
| Prop | Type |
| ------------ | -------------------- |
| status | boolean |
PluginListenerHandle
| Prop | Type |
| ------------ | ----------------------------------------- |
| remove | () => Promise<void> |
