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