File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
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 < HTMLVideoElement > ( null ) ;
8+
9+ function unmuteVideo ( ) {
10+ if ( videoRef . current ) {
11+ videoRef . current . muted = false ;
12+ }
13+ }
14+
415 return (
516 < >
617 < div className = "flex justify-center items-center min-h-screen bg-purple-200" >
@@ -11,7 +22,7 @@ export default function Page() {
1122 width = { 500 }
1223 height = { 500 } />
1324 < div >
14- < video loop autoPlay muted height = "500" width = "500" >
25+ < video ref = { videoRef } onClick = { unmuteVideo } className = "cursor-pointer" loop autoPlay muted height = "500" width = "500" >
1526 < source src = "/never-gonna-give-up.mp4" type = "video/mp4" />
1627 </ video >
1728 </ div >
You can’t perform that action at this time.
0 commit comments