mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-21 03:22:11 +00:00
Merge ceb59a12c7 into 536be36005
This commit is contained in:
commit
75e90bdf6c
1 changed files with 18 additions and 0 deletions
|
|
@ -46,6 +46,7 @@ const Player = ({ urlParams, queryParams }) => {
|
||||||
const platform = usePlatform();
|
const platform = usePlatform();
|
||||||
const toast = useToast();
|
const toast = useToast();
|
||||||
|
|
||||||
|
const lastVolumeRef = React.useRef(video.state?.volume || 0);
|
||||||
const [seeking, setSeeking] = React.useState(false);
|
const [seeking, setSeeking] = React.useState(false);
|
||||||
|
|
||||||
const [casting, setCasting] = React.useState(() => {
|
const [casting, setCasting] = React.useState(() => {
|
||||||
|
|
@ -535,6 +536,12 @@ const Player = ({ urlParams, queryParams }) => {
|
||||||
}
|
}
|
||||||
}, [settings.pauseOnMinimize, shell.windowClosed, shell.windowHidden]);
|
}, [settings.pauseOnMinimize, shell.windowClosed, shell.windowHidden]);
|
||||||
|
|
||||||
|
React.useEffect(() => {
|
||||||
|
if (video?.state?.volume) {
|
||||||
|
lastVolumeRef.current = video.state.volume;
|
||||||
|
}
|
||||||
|
}, [video.state.volume]);
|
||||||
|
|
||||||
// Media Session PlaybackState
|
// Media Session PlaybackState
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
if (!navigator.mediaSession) return;
|
if (!navigator.mediaSession) return;
|
||||||
|
|
@ -678,6 +685,17 @@ const Player = ({ urlParams, queryParams }) => {
|
||||||
onIncreaseSubtitlesDelay();
|
onIncreaseSubtitlesDelay();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 'KeyM': {
|
||||||
|
if (!menusOpen && !nextVideoPopupOpen && video.state.volume !== null) {
|
||||||
|
if (video.state.volume) {
|
||||||
|
onVolumeChangeRequested(0);
|
||||||
|
} else {
|
||||||
|
onVolumeChangeRequested(lastVolumeRef.current);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
case 'Minus': {
|
case 'Minus': {
|
||||||
onUpdateSubtitlesSize(-1);
|
onUpdateSubtitlesSize(-1);
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue