mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-18 03:18:19 -07:00
28 lines
748 B
JavaScript
28 lines
748 B
JavaScript
(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);
|
|
}
|
|
});
|
|
|
|
})(); |