Socket
Book a DemoInstallSign in
Socket

@e-is/cordova-plugin-audiomanagement

Package Overview
Dependencies
Maintainers
3
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@e-is/cordova-plugin-audiomanagement

A plugin to manage audio mode and volume

1.0.3
latest
Source
npmnpm
Version published
Maintainers
3
Created
Source

cordova-plugin-audiomanagement

A plugin to manage audio mode and volume

Installation

cordova plugin add clovelced-plugin-audiomanagement

Supported Platforms

  • Android

AUDIO MODE

  • Define the audio mode
AudioManagement.setAudioMode(audioMode, onSuccess, onError);

// Example
AudioManagement.setAudioMode(AudioManagement.AudioMode.NORMAL, function(){}, function(){});
  • Get the current audio mode
AudioManagement.getAudioMode(onSuccess, onError);

AudioManagement.getAudioMode(function(result){
  console.log('Mode' + result.audioMode);     // will show '2'
  console.log('Label' + result.label);        // will show 'Normal'
}, onError);

The audio mode

  • AudioManagement.AudioMode.SILENT = 0
  • AudioManagement.AudioMode.VIBRATE = 1
  • AudioManagement.AudioMode.NORMAL = 2

VOLUME

  • Set the volume
AudioManagement.setVolume(type, volume, onSuccess, onError);

// Example
AudioManagement.setAudioMode(AudioManagement.VolumeType.RING, 10, function(){}, function(){});
  • Get the volume of a stream
AudioManagement.getVolume(type, onSuccess, onError);

AudioManagement.getVolume(AudioManagement.VolumeType.RING, function(result){  
  console.log('Volume' + result.volume);        // will show '12'
}, onError);
  • Get the max volume of a stream
AudioManagement.getMaxVolume(type, onSuccess, onError);

AudioManagement.getMaxVolume(AudioManagement.VolumeType.RING, function(result){  
  console.log('Max volume' + result.maxVolume);        // will show '15'
}, onError);

The volume type

  • AudioManagement.VolumeType.RING = 0
  • AudioManagement.VolumeType.MUSIC = 1
  • AudioManagement.VolumeType.NOTIFICATION = 2
  • AudioManagement.VolumeType.SYSTEM = 3

Keywords

ecosystem:cordova

FAQs

Package last updated on 30 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.