File tree Expand file tree Collapse file tree
web/src/components/sections Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,10 +8,20 @@ export default function Hero() {
88 const [ isVideoVisible , setIsVideoVisible ] = useState ( false ) ;
99
1010 useEffect ( ( ) => {
11- const timer = setTimeout ( ( ) => {
11+ // Show the video after 3 seconds (allowing it to initialize and hide controls)
12+ const showTimer = setTimeout ( ( ) => {
1213 setIsVideoVisible ( true ) ;
13- } , 6000 ) ;
14- return ( ) => clearTimeout ( timer ) ;
14+ } , 3000 ) ;
15+
16+ // Hide the video and return to static image after the video ends (3s delay + 89s video duration = 92s)
17+ const hideTimer = setTimeout ( ( ) => {
18+ setIsVideoVisible ( false ) ;
19+ } , 92000 ) ;
20+
21+ return ( ) => {
22+ clearTimeout ( showTimer ) ;
23+ clearTimeout ( hideTimer ) ;
24+ } ;
1525 } , [ ] ) ;
1626
1727 return (
@@ -45,7 +55,7 @@ export default function Hero() {
4555 } }
4656 />
4757 < iframe
48- src = "https://www.youtube.com/embed/OXt-yg_7qdk?autoplay=1& mute = 1 & loop = 1 & playlist = OXt - yg_7qdk & controls = 0 & modestbranding = 1 & disablekb = 1 & playsinline = 1 & rel = 0 "
58+ src = "https://www.youtube.com/embed/OXt-yg_7qdk?autoplay=1& mute = 1 & controls = 0 & modestbranding = 1 & disablekb = 1 & playsinline = 1 & rel = 0 "
4959 title = "Patternflow Demo Video"
5060 frameBorder = "0"
5161 allow = "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
You can’t perform that action at this time.
0 commit comments