it.giuseppe-placanica.volume-listener
v0.0.1
Published
Apache Cordova Plugin to listen the device volume
Downloads
16
Maintainers
Readme
Cordova Device Volume Listen Plugin
-- EN --
Usage
The plugin exposes one method
window.plugin.volume.getVolume(callback)
. This methods retrives the
current volume and passes it to the callback. Example:
window.plugin.volume.getVolume(function(volume) {
alert("The current volume is " + volume);
});
On the native code there is a listener to observe the events of the device volume changes.
P.S. The code has been written to listen to Playback events, if you want to listen to different events you need to change the listener's pointers (at least on the iOS code)
-- IT --
Come si usa
Il plugin espone solo un metodo
window.plugin.volume.getVolume(callback)
. This methods retrives the
current volume and passes it to the callback. Example:
window.plugin.volume.getVolume(function(volume) {
alert("The current volume is " + volume);
});
Sul codice nativo è presente un lister per ascoltare gli eventi di cambio del volume del dispositivo.
P.S. Il codice è stato scritto per ascoltare eventi di Audio Playback, se si vogliono ascoltare eventi differenti bisogna cambiare i puntamenti del listener (almeno sul codice iOS)
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request