diff --git a/components/blocks/HeroVideo.tsx b/components/blocks/HeroVideo.tsx index e6ce42e27..7efcb16e9 100644 --- a/components/blocks/HeroVideo.tsx +++ b/components/blocks/HeroVideo.tsx @@ -4,6 +4,7 @@ import { Button } from '@/components/ui/Button'; import Image from 'next/image'; import { useState, useEffect } from 'react'; import { usePathname } from 'next/navigation'; +import { preload } from 'react-dom'; interface HeroVideoProps { data?: any; @@ -41,6 +42,10 @@ export function HeroVideo(props: HeroVideoProps) { const secondaryCtaLabel = props.secondaryCtaLabel || data?.secondaryCtaLabel || (currentLocale === 'de' ? 'Projekt anfragen' : 'Inquire Project'); const secondaryCtaHref = props.secondaryCtaHref || data?.secondaryCtaHref || `/${currentLocale}/contact`; + if (posterSrc) { + preload(posterSrc, { as: 'image' }); + } + const [videoSrcLoaded, setVideoSrcLoaded] = useState(false); useEffect(() => { let interactionTriggered = false; @@ -73,28 +78,30 @@ export function HeroVideo(props: HeroVideoProps) { {/* Background color while video loads */}
- {/* ALWAYS render the Next.js optimized Image as the LCP element */} - {posterAlt} + {/* Dramatic Vignette & Fade to content */} +
+
+ + {/* Top Fade for Header Navigation Readability */} +
- {/* Render video on top if available, but defer src to avoid blocking LCP */} - {videoUrl && ( + {videoUrl ? (