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:
commit
8cbb4f8cc0
1 changed files with 11 additions and 0 deletions
|
@ -1300,6 +1300,15 @@ import { PluginType } from '../../../types/plugin.ts';
|
|||
resetIdle();
|
||||
}
|
||||
|
||||
function onWheel(e) {
|
||||
if (e.deltaY < 0) {
|
||||
playbackManager.volumeUp(currentPlayer);
|
||||
}
|
||||
if (e.deltaY > 0) {
|
||||
playbackManager.volumeDown(currentPlayer);
|
||||
}
|
||||
}
|
||||
|
||||
function onWindowMouseDown(e) {
|
||||
clickedElement = e.target;
|
||||
mouseIsDown = true;
|
||||
|
@ -1459,6 +1468,7 @@ import { PluginType } from '../../../types/plugin.ts';
|
|||
capture: true,
|
||||
passive: true
|
||||
});
|
||||
document.addEventListener('wheel', onWheel);
|
||||
/* eslint-disable-next-line compat/compat */
|
||||
dom.addEventListener(window, window.PointerEvent ? 'pointerdown' : 'mousedown', onWindowMouseDown, {
|
||||
capture: true,
|
||||
|
@ -1500,6 +1510,7 @@ import { PluginType } from '../../../types/plugin.ts';
|
|||
capture: true,
|
||||
passive: true
|
||||
});
|
||||
document.removeEventListener('wheel', onWheel);
|
||||
/* eslint-disable-next-line compat/compat */
|
||||
dom.removeEventListener(window, window.PointerEvent ? 'pointerdown' : 'mousedown', onWindowMouseDown, {
|
||||
capture: true,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue