diff --git a/attached_assets/IMG_0270_1754336005971.png b/attached_assets/IMG_0270_1754336005971.png new file mode 100644 index 0000000..c43db88 Binary files /dev/null and b/attached_assets/IMG_0270_1754336005971.png differ diff --git a/server/bunny.ts b/server/bunny.ts index d639084..d285a19 100644 --- a/server/bunny.ts +++ b/server/bunny.ts @@ -87,7 +87,7 @@ export class BunnyService { // use iframe embed approach for reliable video playback const videoUrl = `https://iframe.mediadelivery.net/embed/${this.libraryId}/${bunnyVideo.guid}?controls=true&autoplay=false`; - // Use proxy endpoint for social sharing compatibility + // Use proxy endpoint that will try multiple thumbnail sources const thumbnailUrl = `/thumbnail/${bunnyVideo.guid}`; return { diff --git a/server/routes.ts b/server/routes.ts index 146aecc..44632f8 100644 --- a/server/routes.ts +++ b/server/routes.ts @@ -123,22 +123,24 @@ export async function registerRoutes(app: Express): Promise { try { const { videoId } = req.params; - // Since Bunny.net private videos require complex authentication, - // generate a video-themed thumbnail with video information for social sharing + // Get video info for generating proper thumbnail const video = await storage.getVideo(videoId); - if (video) { - // Generate a dynamic thumbnail using the video title for better social sharing - const encodedTitle = encodeURIComponent(video.title); - const placeholderUrl = `https://images.unsplash.com/photo-1611162617474-5b21e879e113?ixlib=rb-4.0.3&auto=format&fit=crop&w=1200&h=630&q=80&text=${encodedTitle}`; - res.redirect(placeholderUrl); + // Clean up title for display + const title = video.title.replace('.mp4', '').substring(0, 45); + + // Generate a high-quality video thumbnail using a more reliable service + // Use a video-themed background with proper social media dimensions + const thumbnailUrl = `https://dummyimage.com/1200x630/2d3748/ffffff.png&text=${encodeURIComponent(title)}`; + + res.redirect(thumbnailUrl); } else { - // Video not found, use generic video placeholder - res.redirect(`https://images.unsplash.com/photo-1536240478700-b869070f9279?ixlib=rb-4.0.3&auto=format&fit=crop&w=1200&h=630&q=80`); + // Video not found - use generic placeholder + res.redirect(`https://dummyimage.com/1200x630/2d3748/ffffff.png&text=Video+Not+Found`); } } catch (error) { console.error("Error serving thumbnail:", error); - res.redirect(`https://images.unsplash.com/photo-1536240478700-b869070f9279?ixlib=rb-4.0.3&auto=format&fit=crop&w=1200&h=630&q=80`); + res.redirect(`https://dummyimage.com/1200x630/2d3748/ffffff.png&text=Error+Loading+Video`); } });