Skip to content

PhoneGap plugin which notifies when the user presses the volume up and down buttons of the device

Notifications You must be signed in to change notification settings

derflocki/cordova-plugin-volume-buttons

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

volume-buttons-listener

Cordova plugin which notifies when the user presses the volume up and down buttons of the device. For that, it adds the following windowevent:

  • volumebuttonslistener

Installation

cordova plugin add https://github.com/manueldeveloper/cordova-plugin-volume-buttons.git cordova plugin add com.manueldeveloper.volume-buttons

volumebuttonslistener

This event fires when the user presses the volume up or down button of the device. An object that contains only one property is passed to the volume buttons listener:

  • signal: The volume button that the user has pressed [volume-up or volume-down] (String)

Applications have to use window.addEventListenerto attach this event listener once the devicereadyevent fires.

Supported Platforms

  • Android
  • iOS (in developing process)

Example

window.addEventListener("volumebuttonslistener", onVolumeButtonsListener, false);

function onVolumeButtonsListener(info){
	console.log("Button pressed: " + info.signal);
}

About

PhoneGap plugin which notifies when the user presses the volume up and down buttons of the device

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published