diff --git a/src/components/player/kinescope-player.tsx b/src/components/player/kinescope-player.tsx index a3c2ed3..bbc3d14 100644 --- a/src/components/player/kinescope-player.tsx +++ b/src/components/player/kinescope-player.tsx @@ -1,6 +1,6 @@ "use client"; -import { useEffect, useRef, useState } from "react"; +import { useEffect, useState } from "react"; import KinescopeReactPlayer from "@kinescope/react-kinescope-player"; interface Props { @@ -10,56 +10,42 @@ interface Props { export function KinescopePlayer({ videoId, poster }: Props) { const [mounted, setMounted] = useState(false); - const [showOverlay, setShowOverlay] = useState(!!poster); - const playerRef = useRef(null); + const [showPoster, setShowPoster] = useState(!!poster); useEffect(() => setMounted(true), []); - function handleOverlayClick() { - setShowOverlay(false); - playerRef.current?.play(); + const containerStyle = { border: "2px solid var(--border)" }; + + if (showPoster && poster) { + return ( +
setShowPoster(false)}> + {/* eslint-disable-next-line @next/next/no-img-element */} + +
+
+ + + +
+
+
+ ); } return ( -
+
{mounted && ( - - )} - - {showOverlay && poster && ( -
- {/* eslint-disable-next-line @next/next/no-img-element */} - -
-
- - - -
-
-
+ )}
);