File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ export default function Header() {
4545 < Link href = "/" className = "text-white hover:text-green-400 transition" > Inicio</ Link >
4646 < Link href = "/multimedia" className = "text-white hover:text-green-400 transition" > Multimedia</ Link >
4747 < Link href = "/previous-editions" className = "text-white hover:text-green-400 transition" > Ediciones Anteriores</ Link >
48- < Link href = "#registro " className = "text-white bg-green-600 hover:bg-green-700 px-4 py-2 rounded-full transition" > Registrarse</ Link >
48+ < Link href = "/register " className = "text-white bg-green-600 hover:bg-green-700 px-4 py-2 rounded-full transition" > Registrarse</ Link >
4949 </ nav >
5050 </ div >
5151
@@ -56,7 +56,7 @@ export default function Header() {
5656 < Link href = "/" className = "text-white hover:text-green-400 transition" > Inicio</ Link >
5757 < Link href = "/multimedia" className = "text-white hover:text-green-400 transition" > Multimedia</ Link >
5858 < Link href = "/previous-editions" className = "text-white hover:text-green-400 transition" > Ediciones Anteriores</ Link >
59- < Link href = "#registro " className = "text-white bg-green-600 hover:bg-green-700 px-4 py-2 rounded-full transition text-center" > Registrarse</ Link >
59+ < Link href = "/register " className = "text-white bg-green-600 hover:bg-green-700 px-4 py-2 rounded-full transition text-center" > Registrarse</ Link >
6060 </ div >
6161 </ div >
6262 ) }
Original file line number Diff line number Diff line change 1+ "use client" ;
2+ import dynamic from "next/dynamic" ;
3+
4+ const VideoPlayer = dynamic ( ( ) => import ( "@/components/VideoPlayer" ) , {
5+ ssr : false ,
6+ loading : ( ) => (
7+ < div className = "aspect-video bg-gray-800/50 animate-pulse rounded-lg" />
8+ ) ,
9+ } ) ;
10+
11+ export default function LazyVideoPlayerWrapper ( { video } ) {
12+ return < VideoPlayer video = { video } /> ;
13+ }
Original file line number Diff line number Diff line change 1+ "use client" ;
2+ import { useEffect , useRef , useState } from "react" ;
3+ import Image from "next/image" ;
4+
5+ export default function VideoPlayer ( { video } ) {
6+ const iframeRef = useRef ( null ) ;
7+ const [ isLoaded , setIsLoaded ] = useState ( false ) ;
8+
9+ useEffect ( ( ) => {
10+ const observer = new IntersectionObserver (
11+ ( [ entry ] ) => {
12+ if ( entry . isIntersecting ) {
13+ setIsLoaded ( true ) ;
14+ observer . disconnect ( ) ;
15+ }
16+ } ,
17+ { threshold : 0.1 }
18+ ) ;
19+
20+ if ( iframeRef . current ) {
21+ observer . observe ( iframeRef . current ) ;
22+ }
23+ return ( ) => observer . disconnect ( ) ;
24+ } , [ ] ) ;
25+
26+ return (
27+ < div className = "bg-black/30 backdrop-blur-sm rounded-lg overflow-hidden shadow-lg" >
28+ < div className = "aspect-video relative" >
29+ { ! isLoaded ? (
30+ < Image
31+ src = { video . thumbnail }
32+ alt = { `Thumbnail - ${ video . title } ` }
33+ fill
34+ className = "object-cover"
35+ quality = { 60 }
36+ loading = "lazy"
37+ />
38+ ) : (
39+ < iframe
40+ ref = { iframeRef }
41+ src = { video . url }
42+ title = { video . title }
43+ allow = "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
44+ allowFullScreen
45+ className = "absolute inset-0 w-full h-full"
46+ loading = "lazy"
47+ onLoad = { ( ) => console . log ( "Video loaded" ) }
48+ />
49+ ) }
50+ </ div >
51+ < div className = "p-4" >
52+ < h3 className = "text-lg font-semibold" > { video . title } </ h3 >
53+ < p className = "text-sm text-gray-300 mt-1" >
54+ { video . speaker } • PyDay Chile { video . year }
55+ </ p >
56+ </ div >
57+ </ div >
58+ ) ;
59+ }
You can’t perform that action at this time.
0 commit comments