1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Merge pull request #4435 from robert-hamilton36/VolumeScroll

Add video volume change on mouse scroll
This commit is contained in:
Bill Thornton 2023-04-14 17:12:19 -04:00 committed by GitHub
commit 8cbb4f8cc0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1300,6 +1300,15 @@ import { PluginType } from '../../../types/plugin.ts';
resetIdle(); resetIdle();
} }
function onWheel(e) {
if (e.deltaY < 0) {
playbackManager.volumeUp(currentPlayer);
}
if (e.deltaY > 0) {
playbackManager.volumeDown(currentPlayer);
}
}
function onWindowMouseDown(e) { function onWindowMouseDown(e) {
clickedElement = e.target; clickedElement = e.target;
mouseIsDown = true; mouseIsDown = true;
@ -1459,6 +1468,7 @@ import { PluginType } from '../../../types/plugin.ts';
capture: true, capture: true,
passive: true passive: true
}); });
document.addEventListener('wheel', onWheel);
/* eslint-disable-next-line compat/compat */ /* eslint-disable-next-line compat/compat */
dom.addEventListener(window, window.PointerEvent ? 'pointerdown' : 'mousedown', onWindowMouseDown, { dom.addEventListener(window, window.PointerEvent ? 'pointerdown' : 'mousedown', onWindowMouseDown, {
capture: true, capture: true,
@ -1500,6 +1510,7 @@ import { PluginType } from '../../../types/plugin.ts';
capture: true, capture: true,
passive: true passive: true
}); });
document.removeEventListener('wheel', onWheel);
/* eslint-disable-next-line compat/compat */ /* eslint-disable-next-line compat/compat */
dom.removeEventListener(window, window.PointerEvent ? 'pointerdown' : 'mousedown', onWindowMouseDown, { dom.removeEventListener(window, window.PointerEvent ? 'pointerdown' : 'mousedown', onWindowMouseDown, {
capture: true, capture: true,