0.0.1 • Published 12 months ago

capacitor-volume-control v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

capacitor-volume-control

Adjust system-level volume in your Capacitor Apps.

The value are normalized to 0-100 range

Supported platforms

PlatformSupported
Android
iOS✅⚠️ (untested)
Web

Install

pnpm install capacitor-volume-control
pnpm exec cap sync

Usage

import { VolumeControl } from 'capacitor-volume-control';

// Set the volume:
const volume = 50;
await VolumeControl.setvolume({ volume });

// Get the current volume:
const {volume: currentvolume} = await VolumeControl.getvolume();

API

getVolume(...)

getVolume(options?: { streamType?: StreamType | undefined; } | undefined) => Promise<{ volume: number }>
ParamType
options{ streamType?: StreamType; }

Returns: Promise<{ volume: number }>


setVolume(...)

setVolume(options: { volume: number; showUI?: boolean; streamType?: StreamType; }) => Promise<void>
ParamType
options{ volume: number; showUI?: boolean; streamType?: StreamType; }

Returns: Promise\<void>


Type Aliases

StreamType

'STREAM_VOICE_CALL' | 'STREAM_SYSTEM' | 'STREAM_RING' | 'STREAM_MUSIC' | 'STREAM_ALARM' | 'STREAM_NOTIFICATION' | 'STREAM_DTMF'

0.0.1

12 months ago