From adafa5cc36381af93ff5cbdee88aeef8918bf22c Mon Sep 17 00:00:00 2001 From: tapframe Date: Sat, 13 Sep 2025 01:50:00 +0530 Subject: [PATCH] fix --- src/components/player/AndroidVideoPlayer.tsx | 21 ++++++++++++++++--- src/components/player/VideoPlayer.tsx | 21 ++++++++++++++++--- .../player/controls/PlayerControls.tsx | 4 ++-- 3 files changed, 38 insertions(+), 8 deletions(-) diff --git a/src/components/player/AndroidVideoPlayer.tsx b/src/components/player/AndroidVideoPlayer.tsx index eb9496c2..d26744e8 100644 --- a/src/components/player/AndroidVideoPlayer.tsx +++ b/src/components/player/AndroidVideoPlayer.tsx @@ -2321,9 +2321,24 @@ const AndroidVideoPlayer: React.FC = () => { - {/* Center area tap handler */} + {/* Center area tap handler - handles both show and hide */} { + if (showControls) { + // If controls are visible, hide them + const timeoutId = setTimeout(() => { + hideControls(); + }, 0); + // Clear any existing timeout + if (controlsTimeout.current) { + clearTimeout(controlsTimeout.current); + } + controlsTimeout.current = timeoutId; + } else { + // If controls are hidden, show them + toggleControls(); + } + }} shouldCancelWhenOutside={false} simultaneousHandlers={[]} > @@ -2333,7 +2348,7 @@ const AndroidVideoPlayer: React.FC = () => { left: screenDimensions.width * 0.4, // Start after left gesture area width: screenDimensions.width * 0.2, // Center area (20% of screen) height: screenDimensions.height * 0.7, - zIndex: 10, + zIndex: 5, // Lower z-index, controls use box-none to allow touches through }} /> diff --git a/src/components/player/VideoPlayer.tsx b/src/components/player/VideoPlayer.tsx index 562e352a..133f2004 100644 --- a/src/components/player/VideoPlayer.tsx +++ b/src/components/player/VideoPlayer.tsx @@ -2133,9 +2133,24 @@ const VideoPlayer: React.FC = () => { - {/* Center area tap handler */} + {/* Center area tap handler - handles both show and hide */} { + if (showControls) { + // If controls are visible, hide them + const timeoutId = setTimeout(() => { + hideControls(); + }, 0); + // Clear any existing timeout + if (controlsTimeout.current) { + clearTimeout(controlsTimeout.current); + } + controlsTimeout.current = timeoutId; + } else { + // If controls are hidden, show them + toggleControls(); + } + }} shouldCancelWhenOutside={false} simultaneousHandlers={[]} > @@ -2145,7 +2160,7 @@ const VideoPlayer: React.FC = () => { left: screenDimensions.width * 0.4, // Start after left gesture area width: screenDimensions.width * 0.2, // Center area (20% of screen) height: screenDimensions.height * 0.7, - zIndex: 10, + zIndex: 5, // Lower z-index, controls use box-none to allow touches through }} /> diff --git a/src/components/player/controls/PlayerControls.tsx b/src/components/player/controls/PlayerControls.tsx index 9c445e8c..2508c0db 100644 --- a/src/components/player/controls/PlayerControls.tsx +++ b/src/components/player/controls/PlayerControls.tsx @@ -78,8 +78,8 @@ export const PlayerControls: React.FC = ({ const { currentTheme } = useTheme(); return ( {/* Progress slider with native iOS slider */}