capacitor-plugin-audio-toggle
v1.0.29
Published
Capacitor plugin for audio mode toggle
Downloads
2
Readme
capacitor-plugin-audio-toggle
Capacitor plugin for audio mode toggle
Install
npm install capacitor-plugin-audio-toggle
npx cap sync
API
enable()
disable()
reset()
selectDevice(...)
setRingtoneMode()
getAvailableDevices()
getSelectedDevice()
checkPermissions()
requestPermissions()
isBluetoothEnabled()
openBluetoothSettings()
openAppSettings()
addListener('onChanges', ...)
removeAllListeners()
- Interfaces
- Type Aliases
enable()
enable() => Promise<void>
disable()
disable() => Promise<void>
reset()
reset() => Promise<void>
selectDevice(...)
selectDevice(data: { device: DeviceName; }) => Promise<void>
| Param | Type |
| ---------- | -------------------------------------------------------------- |
| data
| { device: DeviceName; } |
setRingtoneMode()
setRingtoneMode() => Promise<void>
getAvailableDevices()
getAvailableDevices() => Promise<{ earpiece: boolean; speakerphone: boolean; wired: boolean; bluetooth: boolean; }>
Returns: Promise<{ earpiece: boolean; speakerphone: boolean; wired: boolean; bluetooth: boolean; }>
getSelectedDevice()
getSelectedDevice() => Promise<{ selectedDevice: DeviceName; }>
Returns: Promise<{ selectedDevice: DeviceName; }>
checkPermissions()
checkPermissions() => Promise<{ granted: boolean; }>
Returns: Promise<{ granted: boolean; }>
requestPermissions()
requestPermissions() => Promise<{ granted: boolean; }>
Returns: Promise<{ granted: boolean; }>
isBluetoothEnabled()
isBluetoothEnabled() => Promise<{ enabled: boolean; }>
Returns: Promise<{ enabled: boolean; }>
openBluetoothSettings()
openBluetoothSettings() => Promise<void>
openAppSettings()
openAppSettings() => Promise<void>
addListener('onChanges', ...)
addListener(eventName: 'onChanges', listenerFunc: (data: { earpiece: boolean; speakerphone: boolean; wired: boolean; bluetooth: boolean; selectedDevice: DeviceName; }) => void) => Promise<PluginListenerHandle> & PluginListenerHandle
| Param | Type |
| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| eventName
| 'onChanges' |
| listenerFunc
| (data: { earpiece: boolean; speakerphone: boolean; wired: boolean; bluetooth: boolean; selectedDevice: DeviceName; }) => void |
Returns: Promise<PluginListenerHandle> & PluginListenerHandle
removeAllListeners()
removeAllListeners() => Promise<void>
Interfaces
PluginListenerHandle
| Prop | Type |
| ------------ | ----------------------------------------- |
| remove
| () => Promise<void> |
Type Aliases
DeviceName
'earpiece' | 'speakerphone' | 'wired' | 'bluetooth'