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
This commit is contained in:
sebastjanartic 2025-09-02 15:24:40 +00:00
parent 4ffdf7f960
commit c26d16da3d

View File

@ -20,7 +20,17 @@ export default function VideoPreviewThumbnail({ video, onClick, className = "" }
// Create hidden video element for thumbnail generation // Create hidden video element for thumbnail generation
useEffect(() => { 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; const videoElement = videoRef.current;
if (!videoElement) return; if (!videoElement) return;