diff --git a/src/components/player/android/components/GestureControls.tsx b/src/components/player/android/components/GestureControls.tsx index 41bf66b5..9216664a 100644 --- a/src/components/player/android/components/GestureControls.tsx +++ b/src/components/player/android/components/GestureControls.tsx @@ -52,78 +52,104 @@ export const GestureControls: React.FC = ({ return 'brightness-high'; }; + // Create refs for all gesture handlers to enable cross-referencing + const leftPanRef = React.useRef(null); + const rightPanRef = React.useRef(null); + const leftTapRef = React.useRef(null); + const rightTapRef = React.useRef(null); + const centerTapRef = React.useRef(null); + const leftLongPressRef = React.useRef(null); + const rightLongPressRef = React.useRef(null); + + // Shared style for left side gesture area + const leftSideStyle = { + position: 'absolute' as const, + top: screenDimensions.height * 0.15, + left: 0, + width: screenDimensions.width * 0.4, + height: screenDimensions.height * 0.7, + zIndex: 10, + }; + + // Shared style for right side gesture area + const rightSideStyle = { + position: 'absolute' as const, + top: screenDimensions.height * 0.15, + right: 0, + width: screenDimensions.width * 0.4, + height: screenDimensions.height * 0.7, + zIndex: 10, + }; + return ( <> - {/* Left side gesture handler - brightness + tap + long press */} + {/* Left side gestures - brightness + tap + long press (flat structure) */} - - - - - + - {/* Right side gesture handler - volume + tap + long press */} + + + + + + + + + {/* Right side gestures - volume + tap + long press (flat structure) */} - - - - - + + + + + + + + + {/* Center area tap handler */} { if (showControls) { const timeoutId = setTimeout(() => { @@ -138,7 +164,6 @@ export const GestureControls: React.FC = ({ } }} shouldCancelWhenOutside={false} - simultaneousHandlers={[]} > = ({ left: screenDimensions.width * 0.4, width: screenDimensions.width * 0.2, height: screenDimensions.height * 0.7, - zIndex: 5, + zIndex: 10, }} /> diff --git a/src/components/player/controls/PlayerControls.tsx b/src/components/player/controls/PlayerControls.tsx index 16bb7a3b..eb7ad749 100644 --- a/src/components/player/controls/PlayerControls.tsx +++ b/src/components/player/controls/PlayerControls.tsx @@ -386,7 +386,7 @@ export const PlayerControls: React.FC = ({ {/* Center Controls - CloudStream Style */} + }]} pointerEvents="box-none"> {/* Backward Seek Button (-10s) */} = ({ // Helper to get dimensions (using passed screenDimensions) const getDimensions = () => screenDimensions; + // Create refs for all gesture handlers to enable cross-referencing + const leftPanRef = React.useRef(null); + const rightPanRef = React.useRef(null); + const leftTapRef = React.useRef(null); + const rightTapRef = React.useRef(null); + const centerTapRef = React.useRef(null); + const leftLongPressRef = React.useRef(null); + const rightLongPressRef = React.useRef(null); + + // Shared style for left side gesture area + const leftSideStyle = { + position: 'absolute' as const, + top: screenDimensions.height * 0.15, + left: 0, + width: screenDimensions.width * 0.4, + height: screenDimensions.height * 0.7, + zIndex: 10, + }; + + // Shared style for right side gesture area + const rightSideStyle = { + position: 'absolute' as const, + top: screenDimensions.height * 0.15, + right: 0, + width: screenDimensions.width * 0.4, + height: screenDimensions.height * 0.7, + zIndex: 10, + }; + return ( <> - {/* Left side gesture handler - brightness + tap + long press */} + {/* Left side gestures - brightness + tap + long press (flat structure) */} - - - - - + - {/* Right side gesture handler - volume + tap + long press */} + + + + + + + + + {/* Right side gestures - volume + tap + long press (flat structure) */} - - - - - + + + + + + + + + {/* Center area tap handler */} { if (showControls) { const timeoutId = setTimeout(() => { @@ -123,7 +149,6 @@ export const GestureControls: React.FC = ({ } }} shouldCancelWhenOutside={false} - simultaneousHandlers={[]} > = ({ left: screenDimensions.width * 0.4, width: screenDimensions.width * 0.2, height: screenDimensions.height * 0.7, - zIndex: 5, + zIndex: 10, }} />