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
Platform | Supported |
---|---|
Android | ✅ |
iOS | ✅ (only getVolumeLevel) |
Web | ❌ |
npm install @ottimis/capacitor-volumes
npx cap sync
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(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; }>
Members | Value |
---|---|
voice_call |
0 |
system |
1 |
ring |
2 |
default |
3 |
music |
3 |
alarm |
4 |
notification |
5 |
dtmf |
8 |