@ottimis/capacitor-volumes
v6.1.0
Published
Manage volume from capacitor.
Downloads
217
Readme
@ottimis/capacitor-volumes
Manage device volume from capacitor.
Get volume level in a range between 0 and 1. Volume will be set proportionally in a scale between 0 and "maxVolumeOfDevice".
⭐️ Any suggestion will be appreciated
Supported platforms
| Platform | Supported | | -------- |-----------| | Android | ✅ | | iOS | ✅ (only getVolumeLevel) | | Web | ❌ |
Install
npm install @ottimis/capacitor-volumes
npx cap sync
API
getVolumeLevel(...)
getVolumeLevel(options?: { type?: VolumeTypes | undefined; } | undefined) => Promise<{ value: number; }>
type parameter is only available on Android
| Param | Type |
| ------------- | --------------------------------------------------------------- |
| options
| { type?: VolumeTypes; } |
Returns: Promise<{ value: number; }>
setVolumeLevel(...)
setVolumeLevel(options: { value: number; type?: VolumeTypes; }) => Promise<{ value: number; }>
this works only on Android value parameter is an integer between 0 and 10 for android
| Param | Type |
| ------------- | ------------------------------------------------------------------------------ |
| options
| { value: number; type?: VolumeTypes; } |
Returns: Promise<{ value: number; }>
Enums
VolumeTypes
| Members | Value |
| ------------------ | -------------- |
| voice_call
| 0 |
| system
| 1 |
| ring
| 2 |
| default
| 3 |
| music
| 3 |
| alarm
| 4 |
| notification
| 5 |
| dtmf
| 8 |