Improve Mouse detection in video player #191

This commit is contained in:
Prayag Prajapati committed 2023-10-04 18:54:51 +05:30
1 parent f238e367ba
commit 92bd2d5b0e
1 file changed
+16 -9
+16 -9
View File
@@ -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
currentEpisodeIndex == 0 ? episodes.isLoading ||
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={{