Improve Mouse detection in video player #191
This commit is contained in:
1 file changed
+15
-8
@@ -462,12 +462,13 @@ export const VideoPlayer = () => {
|
|||||||
const [appFullscreen, setAppFullScreen] = useState(false);
|
const [appFullscreen, setAppFullScreen] = useState(false);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
let timeout = null;
|
|
||||||
if (showControls) {
|
if (showControls) {
|
||||||
window.clearTimeout(timeout);
|
let timeout = setTimeout(() => {
|
||||||
timeout = setTimeout(() => {
|
|
||||||
setShowControls(false);
|
setShowControls(false);
|
||||||
}, 5000);
|
}, 5000);
|
||||||
|
return () => {
|
||||||
|
clearTimeout(timeout);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}, [showControls]);
|
}, [showControls]);
|
||||||
|
|
||||||
@@ -716,8 +717,10 @@ export const VideoPlayer = () => {
|
|||||||
<IconButton
|
<IconButton
|
||||||
onClick={handlePlayPrevEpisode}
|
onClick={handlePlayPrevEpisode}
|
||||||
disabled={
|
disabled={
|
||||||
episodes.isLoading ||
|
seriesId
|
||||||
|
? episodes.isLoading ||
|
||||||
currentEpisodeIndex == 0
|
currentEpisodeIndex == 0
|
||||||
|
: true
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<MdiSkipPrevious />
|
<MdiSkipPrevious />
|
||||||
@@ -750,9 +753,13 @@ export const VideoPlayer = () => {
|
|||||||
<IconButton
|
<IconButton
|
||||||
onClick={handlePlayNextEpisode}
|
onClick={handlePlayNextEpisode}
|
||||||
disabled={
|
disabled={
|
||||||
episodes.isLoading ||
|
seriesId
|
||||||
episodes.data?.TotalRecordCount ==
|
? episodes.isLoading ||
|
||||||
currentEpisodeIndex + 1
|
episodes.data
|
||||||
|
?.TotalRecordCount ==
|
||||||
|
currentEpisodeIndex +
|
||||||
|
1
|
||||||
|
: true
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<MdiSkipNext />
|
<MdiSkipNext />
|
||||||
@@ -780,7 +787,7 @@ export const VideoPlayer = () => {
|
|||||||
role: "listbox",
|
role: "listbox",
|
||||||
}}
|
}}
|
||||||
anchorOrigin={{
|
anchorOrigin={{
|
||||||
vertical: "bottom",
|
vertical: "top",
|
||||||
horizontal: "center",
|
horizontal: "center",
|
||||||
}}
|
}}
|
||||||
transformOrigin={{
|
transformOrigin={{
|
||||||
|
|||||||
Reference in new issue
Block a user