Improve video playback and navigation on mobile devices

Adjusted scroll button styling for better mobile visibility and enabled autoplay for video previews on mobile devices, fixing issues with user navigation and playback.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 051a65da-1176-4478-a61c-c662f2a15536
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/8cc42625-c1f5-4e43-99bd-77f2c4dedee2/051a65da-1176-4478-a61c-c662f2a15536/9NQBiz8
This commit is contained in:
sebastjanartic 2025-08-30 22:22:54 +00:00
parent af4284cb37
commit b7d3a9883d
2 changed files with 8 additions and 12 deletions

View File

@ -247,7 +247,7 @@ function CategoryRow({ category, onVideoClick, hideScrollButtons = false }: Cate
onClick={() => scroll('left')}
onMouseEnter={() => startAutoScroll('left')}
onMouseLeave={stopAutoScroll}
className="absolute left-2 top-1/2 -translate-y-1/2 z-[40] bg-black/50 hover:bg-black/70 text-white border-none w-12 h-12 rounded-full transition-all duration-300 flex items-center justify-center shadow-xl hidden md:flex"
className="absolute left-2 top-1/2 -translate-y-1/2 z-[40] bg-black/50 hover:bg-black/70 text-white border-none w-10 h-10 sm:w-12 sm:h-12 rounded-full transition-all duration-300 flex items-center justify-center shadow-xl"
size="sm"
>
<ChevronLeft className="w-5 h-5" />
@ -260,7 +260,7 @@ function CategoryRow({ category, onVideoClick, hideScrollButtons = false }: Cate
onClick={() => scroll('right')}
onMouseEnter={() => startAutoScroll('right')}
onMouseLeave={stopAutoScroll}
className="absolute right-2 top-1/2 -translate-y-1/2 z-[40] bg-black/50 hover:bg-black/70 text-white border-none w-12 h-12 rounded-full transition-all duration-300 flex items-center justify-center shadow-xl hidden md:flex"
className="absolute right-2 top-1/2 -translate-y-1/2 z-[40] bg-black/50 hover:bg-black/70 text-white border-none w-10 h-10 sm:w-12 sm:h-12 rounded-full transition-all duration-300 flex items-center justify-center shadow-xl"
size="sm"
>
<ChevronRight className="w-5 h-5" />

View File

@ -55,15 +55,11 @@ export default function VideoCard({ video, onClick, className = "", hideOverlay
// Delay preview start to avoid loading on quick mouse passes
useEffect(() => {
if (isHovered) {
// Disable preview on mobile devices
const isMobile = window.innerWidth < 768;
if (!isMobile) {
const delay = 800; // Only on desktop
hoverTimeoutRef.current = setTimeout(() => {
setShowPreview(true);
}, delay);
}
// Enable preview on both mobile and desktop
const delay = 800;
hoverTimeoutRef.current = setTimeout(() => {
setShowPreview(true);
}, delay);
} else {
if (hoverTimeoutRef.current) {
clearTimeout(hoverTimeoutRef.current);
@ -173,7 +169,7 @@ export default function VideoCard({ video, onClick, className = "", hideOverlay
objectFit: 'cover'
}}
autoPlay
muted={false}
muted={true}
loop
playsInline
controls={false}