Cordova plugin which notifies when the user presses the volume up and down buttons of the device. For that, it adds the following window
event:
- volumebuttonslistener
cordova plugin add https://github.com/manueldeveloper/cordova-plugin-volume-buttons.git
cordova plugin add com.manueldeveloper.volume-buttons
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
orvolume-down
] (String)
Applications have to use window.addEventListener
to attach this event listener once the deviceready
event fires.
- Android
- iOS (in developing process)
window.addEventListener("volumebuttonslistener", onVolumeButtonsListener, false);
function onVolumeButtonsListener(info){
console.log("Button pressed: " + info.signal);
}