From 0d7c3cb9da755f42b882fe1f0841ba8bab521bc4 Mon Sep 17 00:00:00 2001 From: Fredrik Burmester Date: Sun, 13 Oct 2024 11:39:51 +0200 Subject: [PATCH] fix: again remove animations because it causes no-tap-register bug --- components/video-player/Controls.tsx | 55 ++++------------------------ 1 file changed, 8 insertions(+), 47 deletions(-) diff --git a/components/video-player/Controls.tsx b/components/video-player/Controls.tsx index c6047aa8..3f13d381 100644 --- a/components/video-player/Controls.tsx +++ b/components/video-player/Controls.tsx @@ -71,44 +71,6 @@ export const Controls: React.FC = ({ const windowDimensions = Dimensions.get("window"); - const op = useSharedValue(1); - const tr = useSharedValue(10); - const animatedStyles = useAnimatedStyle(() => { - return { - opacity: op.value, - }; - }); - const animatedTopStyles = useAnimatedStyle(() => { - return { - opacity: op.value, - transform: [ - { - translateY: -tr.value, - }, - ], - }; - }); - const animatedBottomStyles = useAnimatedStyle(() => { - return { - opacity: op.value, - transform: [ - { - translateY: tr.value, - }, - ], - }; - }); - - useEffect(() => { - if (showControls || isBuffering) { - op.value = withTiming(1, { duration: 200 }); - tr.value = withTiming(0, { duration: 200 }); - } else { - op.value = withTiming(0, { duration: 200 }); - tr.value = withTiming(10, { duration: 200 }); - } - }, [showControls, isBuffering]); - const { previousItem, nextItem } = useAdjacentItems({ item }); const { trickPlayUrl, calculateTrickplayUrl, trickplayInfo } = useTrickplay( item, @@ -322,7 +284,7 @@ export const Controls: React.FC = ({ toggleControls(); }} > - = ({ width: windowDimensions.width + 100, height: windowDimensions.height + 100, }, - animatedStyles, ]} className={`bg-black/50 z-0`} - > + > = ({ - = ({ > - + - = ({ maxHeight: windowDimensions.height, left: insets.left, bottom: Platform.OS === "ios" ? insets.bottom : insets.bottom, + opacity: showControls ? 1 : 0, }, - animatedBottomStyles, ]} pointerEvents={showControls ? "auto" : "none"} className={`flex flex-col p-4 `} @@ -529,7 +490,7 @@ export const Controls: React.FC = ({ - + ); };