jellyfin-web/dashboard-ui/cordova/volume.js

28 lines
748 B
JavaScript
Raw Normal View History

2015-06-08 14:32:20 -07:00
(function () {
// Handle the volume down button
//
function onVolumeDownKeyDown() {
MediaController.volumeDown();
}
// Handle the volume up button
//
function onVolumeUpKeyDown() {
MediaController.volumeUp();
}
$(MediaController).on('playerchange', function (e, newPlayer, newTarget) {
document.removeEventListener("volumedownbutton", onVolumeDownKeyDown, false);
document.removeEventListener("volumeupbutton", onVolumeUpKeyDown, false);
if (!newPlayer.localPlayer) {
document.addEventListener("volumedownbutton", onVolumeDownKeyDown, false);
document.addEventListener("volumeupbutton", onVolumeUpKeyDown, false);
}
});
})();