File tree Expand file tree Collapse file tree 1 file changed +20
-3
lines changed Expand file tree Collapse file tree 1 file changed +20
-3
lines changed Original file line number Diff line number Diff line change 1+ 'use client' ;
2+
13import Image from "next/image" ;
4+ import { useEffect , useRef } from "react" ;
25
36export default function Page ( ) {
7+ const videoRef = useRef ( null ) ;
8+
9+ useEffect ( ( ) => {
10+ const timer = setTimeout ( ( ) => {
11+ if ( videoRef . current ) {
12+ videoRef . current . muted = false ;
13+ }
14+ } , 250 ) ;
15+
16+ return ( ) => clearTimeout ( timer ) ;
17+ } , [ ] ) ;
18+
419 return (
520 < >
621 < div className = "flex justify-center items-center min-h-screen bg-purple-200" >
@@ -10,9 +25,11 @@ export default function Page() {
1025 alt = "Saitama Ok"
1126 width = { 500 }
1227 height = { 500 } />
13- < video autoPlay muted height = "500" width = "500" >
14- < source src = "/never-gonna-give-up.mp4" type = "video/mp4" />
15- </ video >
28+ < div >
29+ < video ref = { videoRef } loop autoPlay muted height = "500" width = "500" >
30+ < source src = "/never-gonna-give-up.mp4" type = "video/mp4" />
31+ </ video >
32+ </ div >
1633 </ div >
1734 </ div >
1835 </ >
You can’t perform that action at this time.
0 commit comments