Remove video ads functionality and improve video data fetching
Remove VideoAds component from VideoPage and update BunnyService to fetch and include video descriptions from Bunny.net API. Replit-Commit-Author: Agent Replit-Commit-Session-Id: d7424866-83d1-4486-a212-ac12b4c7becf Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/8cc42625-c1f5-4e43-99bd-77f2c4dedee2/d7424866-83d1-4486-a212-ac12b4c7becf/QHtchYG
This commit is contained in:
+8
-3
@@ -70,7 +70,7 @@ export class BunnyService {
|
||||
return response.json();
|
||||
}
|
||||
|
||||
private bunnyVideoToVideo(bunnyVideo: BunnyVideo): Video {
|
||||
private bunnyVideoToVideo(bunnyVideo: BunnyVideo | BunnyVideoDetails): Video {
|
||||
// Generate optimized thumbnail URL from Bunny CDN with WebP format for better performance
|
||||
const thumbnailUrl = bunnyVideo.thumbnailFileName
|
||||
? `https://${this.hostname}/${bunnyVideo.guid}/${bunnyVideo.thumbnailFileName}?width=400&height=225&format=webp`
|
||||
@@ -80,10 +80,13 @@ export class BunnyService {
|
||||
const hlsUrl = this.generateSignedUrl(bunnyVideo.guid);
|
||||
const iframeUrl = `https://iframe.mediadelivery.net/embed/${this.libraryId}/${bunnyVideo.guid}?preroll=false&postroll=false&ads=false`;
|
||||
|
||||
// Extract description from BunnyVideoDetails if available
|
||||
const description = 'description' in bunnyVideo ? bunnyVideo.description || "" : "";
|
||||
|
||||
return {
|
||||
id: bunnyVideo.guid,
|
||||
title: bunnyVideo.title || 'Untitled Video',
|
||||
description: "", // Bunny API doesn't return description in list view
|
||||
description: description,
|
||||
thumbnailUrl,
|
||||
customThumbnailUrl: null,
|
||||
videoUrl: hlsUrl, // Signed HLS URL
|
||||
@@ -133,7 +136,9 @@ export class BunnyService {
|
||||
|
||||
async getVideo(guid: string): Promise<Video | null> {
|
||||
try {
|
||||
const bunnyVideo: BunnyVideo = await this.makeRequest(`videos/${guid}`);
|
||||
console.log(`Fetching video with description from Bunny: ${guid}`);
|
||||
const bunnyVideo: BunnyVideoDetails = await this.makeRequest(`videos/${guid}`);
|
||||
console.log(`Video description length: ${bunnyVideo.description?.length || 0} characters`);
|
||||
return this.bunnyVideoToVideo(bunnyVideo);
|
||||
} catch (error) {
|
||||
console.error(`Error fetching video ${guid} from Bunny:`, error);
|
||||
|
||||
Reference in New Issue
Block a user