Display video previews correctly for videos with restricted access

Implements a thumbnail proxy to fetch private BunnyCDN video thumbnails.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: aa92e7e2-ec62-4c92-b21b-02ef78a664c2
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/8cc42625-c1f5-4e43-99bd-77f2c4dedee2/aa92e7e2-ec62-4c92-b21b-02ef78a664c2/PiJtjmP
This commit is contained in:
sebastjanartic
2025-08-04 20:20:29 +00:00
parent 645fa51028
commit 0458b42937
2 changed files with 40 additions and 3 deletions
+2 -3
View File
@@ -52,9 +52,8 @@ export class BunnyService {
}
private bunnyVideoToVideo(bunnyVideo: BunnyVideo): Video {
// For private videos, use iframe embed or proxy approach
// Generate thumbnail URL from CDN (thumbnails are usually public)
const thumbnailUrl = `https://${this.hostname}/${bunnyVideo.guid}/thumbnail.jpg`;
// Use server-side proxy for thumbnails since they are private
const thumbnailUrl = `/thumbnail/${bunnyVideo.guid}`;
// For private videos, we'll use an iframe embed URL which handles authentication
const videoUrl = `https://iframe.mediadelivery.net/embed/${this.libraryId}/${bunnyVideo.guid}`;