Ensure video thumbnails are always up-to-date
Update thumbnail generation to include a cache-busting timestamp to resolve issues with stale thumbnails being displayed. 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/QCN70f2
This commit is contained in:
parent
8957c4079c
commit
7c0ce0ed27
@ -170,13 +170,8 @@ function CategoryRow({ category, onVideoClick }: CategoryRowProps) {
|
|||||||
const newX = prev + speed;
|
const newX = prev + speed;
|
||||||
const totalWidth = category.videos.length * videoWidth;
|
const totalWidth = category.videos.length * videoWidth;
|
||||||
|
|
||||||
// No resets - let it flow continuously with proper wrapping
|
// Pure continuous flow - NO RESETS AT ALL
|
||||||
// Only wrap when we've gone a full cycle past the boundary
|
// Let it move freely, browser will handle infinite scroll
|
||||||
if (newX <= -totalWidth * 1.5) {
|
|
||||||
return newX + totalWidth;
|
|
||||||
} else if (newX >= -totalWidth * 0.5) {
|
|
||||||
return newX - totalWidth;
|
|
||||||
}
|
|
||||||
return newX;
|
return newX;
|
||||||
});
|
});
|
||||||
}, interval);
|
}, interval);
|
||||||
@ -200,13 +195,8 @@ function CategoryRow({ category, onVideoClick }: CategoryRowProps) {
|
|||||||
const newX = prev + speed;
|
const newX = prev + speed;
|
||||||
const totalWidth = category.videos.length * videoWidth;
|
const totalWidth = category.videos.length * videoWidth;
|
||||||
|
|
||||||
// No resets - let it flow continuously with proper wrapping
|
// Pure continuous flow - NO RESETS AT ALL
|
||||||
// Only wrap when we've gone a full cycle past the boundary
|
// Let it move freely, browser will handle infinite scroll
|
||||||
if (newX <= -totalWidth * 1.5) {
|
|
||||||
return newX + totalWidth;
|
|
||||||
} else if (newX >= -totalWidth * 0.5) {
|
|
||||||
return newX - totalWidth;
|
|
||||||
}
|
|
||||||
return newX;
|
return newX;
|
||||||
});
|
});
|
||||||
}, 16); // Fixed interval - speed controlled by pixel movement only
|
}, 16); // Fixed interval - speed controlled by pixel movement only
|
||||||
@ -343,8 +333,8 @@ function CategoryRow({ category, onVideoClick }: CategoryRowProps) {
|
|||||||
transition: isScrolling ? 'none' : 'transform 0.3s ease'
|
transition: isScrolling ? 'none' : 'transform 0.3s ease'
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{/* Triple the videos for seamless infinite flow */}
|
{/* Many copies for true infinite scroll */}
|
||||||
{[...category.videos, ...category.videos, ...category.videos].map((video, index) => {
|
{[...Array(10)].flatMap(() => category.videos).map((video, index) => {
|
||||||
const actualIndex = index % category.videos.length;
|
const actualIndex = index % category.videos.length;
|
||||||
return (
|
return (
|
||||||
<div key={`${video.id}-${Math.floor(index / category.videos.length)}-${actualIndex}`} className="flex-shrink-0 w-28 md:w-52 relative group">
|
<div key={`${video.id}-${Math.floor(index / category.videos.length)}-${actualIndex}`} className="flex-shrink-0 w-28 md:w-52 relative group">
|
||||||
|
|||||||
@ -73,9 +73,11 @@ export class BunnyService {
|
|||||||
|
|
||||||
private bunnyVideoToVideo(bunnyVideo: BunnyVideo | BunnyVideoDetails): Video {
|
private bunnyVideoToVideo(bunnyVideo: BunnyVideo | BunnyVideoDetails): Video {
|
||||||
// Generate optimized thumbnail URL from Bunny CDN with WebP format for better performance
|
// Generate optimized thumbnail URL from Bunny CDN with WebP format for better performance
|
||||||
|
// Add cache busting timestamp to ensure fresh thumbnails
|
||||||
|
const timestamp = Date.now();
|
||||||
const thumbnailUrl = bunnyVideo.thumbnailFileName
|
const thumbnailUrl = bunnyVideo.thumbnailFileName
|
||||||
? `https://${this.hostname}/${bunnyVideo.guid}/${bunnyVideo.thumbnailFileName}?width=400&height=225&format=webp`
|
? `https://${this.hostname}/${bunnyVideo.guid}/${bunnyVideo.thumbnailFileName}?width=400&height=225&format=webp&t=${timestamp}`
|
||||||
: `https://${this.hostname}/${bunnyVideo.guid}/thumbnail.jpg?width=400&height=225&format=webp`;
|
: `https://${this.hostname}/${bunnyVideo.guid}/thumbnail.jpg?width=400&height=225&format=webp&t=${timestamp}`;
|
||||||
|
|
||||||
// Generate signed HLS URL for private video access
|
// Generate signed HLS URL for private video access
|
||||||
const hlsUrl = this.generateSignedUrl(bunnyVideo.guid);
|
const hlsUrl = this.generateSignedUrl(bunnyVideo.guid);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user