Web:Common:Components:MediaViewer:Sub-Components:Viewer Fixed the visible toolbar of the player

This commit is contained in:
Akmal Isomadinov 2023-03-21 14:55:08 +05:00
parent bdd84aeacf
commit 1045f7d141
2 changed files with 4 additions and 4 deletions

View File

@ -65,7 +65,7 @@ function Viewer(props: ViewerProps) {
const resetToolbarVisibleTimer = () => {
if (panelToolbarRef.current) return;
if (panelVisibleRef.current) {
if (panelVisibleRef.current && panelVisible) {
clearTimeout(timerIDRef.current);
timerIDRef.current = setTimeout(() => {
panelVisibleRef.current = false;
@ -73,6 +73,7 @@ function Viewer(props: ViewerProps) {
}, 2500);
} else {
setPanelVisible(true);
clearTimeout(timerIDRef.current);
panelVisibleRef.current = true;
timerIDRef.current = setTimeout(() => {

View File

@ -406,10 +406,9 @@ function ViewerPlayer({
togglePlay();
};
const handleVideoEnded = (
event: React.SyntheticEvent<HTMLVideoElement, Event>
) => {
const handleVideoEnded = () => {
setIsPlaying(false);
if (isMobile) removePanelVisibleTimeout();
};
const handleVolumeChange = useCallback(