Improve video navigation by adding touch swipe functionality

Add console logs to the VideoPage component to aid in debugging touch swipe gesture recognition and video navigation logic.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 890577b1-c154-40a4-a177-a0c6d55320c3
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/8cc42625-c1f5-4e43-99bd-77f2c4dedee2/890577b1-c154-40a4-a177-a0c6d55320c3/DyHCx4q
This commit is contained in:
sebastjanartic 2025-09-01 21:59:13 +00:00
parent 5b26f41fa7
commit 23b20d5105

View File

@ -200,6 +200,7 @@ export default function VideoPage() {
const handleTouchStart = (e: React.TouchEvent) => {
setTouchEnd(0);
setTouchStart(e.targetTouches[0].clientX);
console.log('VideoPage touch start - currentVideo:', currentVideo?.title, 'allVideos count:', allVideos.length);
};
const handleTouchMove = (e: React.TouchEvent) => {
@ -212,11 +213,15 @@ export default function VideoPage() {
const distance = touchStart - touchEnd;
const isLeftSwipe = distance > 20;
const isRightSwipe = distance < -20;
console.log('VideoPage swipe:', { distance, isLeftSwipe, isRightSwipe, allVideosCount: allVideos.length });
if (isLeftSwipe) {
console.log('Navigating to next video');
navigateToVideo('next');
}
if (isRightSwipe) {
console.log('Navigating to prev video');
navigateToVideo('prev');
}
};