From c26d16da3d7b5002136b4d9cd6d28004738dfdd2 Mon Sep 17 00:00:00 2001 From: sebastjanartic <45803536-sebastjanartic@users.noreply.replit.com> Date: Tue, 2 Sep 2025 15:24:40 +0000 Subject: [PATCH] Fix issue with video preview functionality not working as expected Introduce console logging to diagnose and fix an issue where video previews were not generating correctly, specifically when the video source was not an MP4. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 2cd2c0bc-434c-4bc9-ad3f-b99d3897a0d1 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/8cc42625-c1f5-4e43-99bd-77f2c4dedee2/2cd2c0bc-434c-4bc9-ad3f-b99d3897a0d1/d05DGZF --- client/src/components/video-preview-thumbnail.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/client/src/components/video-preview-thumbnail.tsx b/client/src/components/video-preview-thumbnail.tsx index 6409d4f..4cd52bf 100644 --- a/client/src/components/video-preview-thumbnail.tsx +++ b/client/src/components/video-preview-thumbnail.tsx @@ -20,7 +20,17 @@ export default function VideoPreviewThumbnail({ video, onClick, className = "" } // Create hidden video element for thumbnail generation useEffect(() => { - if (!video.videoUrlMp4 && !video.videoUrl.includes('.mp4')) return; + console.log(`Preview check for video ${video.id}:`, { + hasVideoUrlMp4: !!video.videoUrlMp4, + videoUrlMp4: video.videoUrlMp4, + videoUrlIncludesMp4: video.videoUrl.includes('.mp4'), + videoUrl: video.videoUrl + }); + + if (!video.videoUrlMp4 && !video.videoUrl.includes('.mp4')) { + console.log(`Preview disabled for video ${video.id} - no MP4 URL`); + return; + } const videoElement = videoRef.current; if (!videoElement) return;