diff --git a/apps/expo/src/app/videoPlayer/index.tsx b/apps/expo/src/app/videoPlayer/index.tsx index 8d316eb..88dccf0 100644 --- a/apps/expo/src/app/videoPlayer/index.tsx +++ b/apps/expo/src/app/videoPlayer/index.tsx @@ -39,6 +39,7 @@ const VideoPlayer: React.FC = ({ data }) => { const [isLoading, setIsLoading] = useState(true); const [headerData, setHeaderData] = useState(); const [resizeMode, setResizeMode] = useState(ResizeMode.CONTAIN); + const [shouldPlay, setShouldPlay] = useState(true); const router = useRouter(); const scale = useSharedValue(1); const setVideoRef = usePlayerStore((state) => state.setVideoRef); @@ -65,6 +66,18 @@ const VideoPlayer: React.FC = ({ data }) => { } }); + const togglePlayback = () => { + setShouldPlay(!shouldPlay); + }; + + const doubleTapGesture = Gesture.Tap() + .numberOfTaps(2) + .onEnd(() => { + runOnJS(togglePlayback)(); + }); + + const composedGesture = Gesture.Exclusive(pinchGesture, doubleTapGesture); + useEffect(() => { const initializePlayer = async () => { if (!data) { @@ -139,13 +152,13 @@ const VideoPlayer: React.FC = ({ data }) => { }; return ( - +