Add mobile menu and display video categories and tags
Integrates a mobile-friendly menu with search functionality and displays video categories and tags fetched from Bunny.net metadata, enhancing content discoverability and user experience on all devices. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 2eb1084e-b728-4449-9231-f1665924c8d5 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/8cc42625-c1f5-4e43-99bd-77f2c4dedee2/2eb1084e-b728-4449-9231-f1665924c8d5/wsHCZ4W
This commit is contained in:
+27
-2
@@ -95,6 +95,31 @@ export class BunnyService {
|
||||
}
|
||||
}
|
||||
|
||||
// Extract category from bunnyVideo.category or metaTags
|
||||
let category = bunnyVideo.category || "";
|
||||
if (!category && bunnyVideo.metaTags && bunnyVideo.metaTags.length > 0) {
|
||||
const categoryTag = bunnyVideo.metaTags.find((tag: any) =>
|
||||
tag.property?.toLowerCase().includes('category') ||
|
||||
tag.property?.toLowerCase().includes('genre')
|
||||
);
|
||||
if (categoryTag) {
|
||||
category = categoryTag.value;
|
||||
}
|
||||
}
|
||||
|
||||
// Extract tags from metaTags
|
||||
const tags: string[] = [];
|
||||
if (bunnyVideo.metaTags && bunnyVideo.metaTags.length > 0) {
|
||||
bunnyVideo.metaTags.forEach((tag: any) => {
|
||||
if (tag.property?.toLowerCase().includes('tag') ||
|
||||
tag.property?.toLowerCase().includes('keyword')) {
|
||||
// Split comma-separated tags and clean them up
|
||||
const tagValues = tag.value.split(',').map((t: string) => t.trim()).filter(Boolean);
|
||||
tags.push(...tagValues);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
id: bunnyVideo.guid,
|
||||
title: bunnyVideo.title || 'Untitled Video',
|
||||
@@ -106,8 +131,8 @@ export class BunnyService {
|
||||
videoUrlIframe: iframeUrl, // iframe fallback
|
||||
duration: Math.floor(bunnyVideo.length || 0),
|
||||
views: bunnyVideo.views || 0,
|
||||
category: "",
|
||||
tags: [],
|
||||
category: category,
|
||||
tags: tags,
|
||||
isPublic: true,
|
||||
uploadStatus: "completed",
|
||||
originalFileName: null,
|
||||
|
||||
Reference in New Issue
Block a user