mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-20 10:42:12 +00:00
Ensure Arrow Up-Down, and onWheel adjust volume correctly
This commit is contained in:
parent
e13ec37227
commit
ad107ff98b
1 changed files with 7 additions and 7 deletions
|
|
@ -494,14 +494,14 @@ const Player = ({ urlParams, queryParams }) => {
|
|||
}
|
||||
case 'ArrowUp': {
|
||||
if (!menusOpen && !nextVideoPopupOpen && video.state.volume !== null) {
|
||||
onVolumeChangeRequested(video.state.volume + 5);
|
||||
onVolumeChangeRequested(Math.min(video.state.volume + 5, 200));
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case 'ArrowDown': {
|
||||
if (!menusOpen && !nextVideoPopupOpen && video.state.volume !== null) {
|
||||
onVolumeChangeRequested(video.state.volume - 5);
|
||||
onVolumeChangeRequested(Math.max(video.state.volume - 5, 0));
|
||||
}
|
||||
|
||||
break;
|
||||
|
|
@ -559,13 +559,13 @@ const Player = ({ urlParams, queryParams }) => {
|
|||
}
|
||||
};
|
||||
const onWheel = ({ deltaY }) => {
|
||||
if (menusOpen || video.state.volume === null) return;
|
||||
|
||||
if (deltaY > 0) {
|
||||
if (!menusOpen && video.state.volume !== null) {
|
||||
onVolumeChangeRequested(video.state.volume - 5);
|
||||
}
|
||||
onVolumeChangeRequested(Math.max(video.state.volume - 5, 0));
|
||||
} else {
|
||||
if (!menusOpen && video.state.volume !== null) {
|
||||
onVolumeChangeRequested(video.state.volume + 5);
|
||||
if (video.state.volume < 100) {
|
||||
onVolumeChangeRequested(Math.min(video.state.volume + 5, 100));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue