diff --git a/client/src/components/video-card.tsx b/client/src/components/video-card.tsx index fdf916e..7803d8b 100644 --- a/client/src/components/video-card.tsx +++ b/client/src/components/video-card.tsx @@ -50,6 +50,7 @@ export default function VideoCard({ video, onClick, className = "" }: VideoCardP const hoverTimeoutRef = useRef(); const videoRef = useRef(null); const hlsRef = useRef(null); + const animationFrameRef = useRef(); // Handle mouse scrubbing for video preview with throttling for smoothness const lastScrubTime = useRef(0); @@ -153,14 +154,21 @@ export default function VideoCard({ video, onClick, className = "" }: VideoCardP hlsRef.current.destroy(); hlsRef.current = null; } + if (animationFrameRef.current) { + cancelAnimationFrame(animationFrameRef.current); + } }; }, [showPreview, video.videoUrl]); return (
setIsHovered(true)} onMouseLeave={() => setIsHovered(false)} > @@ -174,7 +182,7 @@ export default function VideoCard({ video, onClick, className = "" }: VideoCardP {video.title}

onClick?.(video)} data-testid={`text-title-${video.id}`} >