From 14888113ce2a83d70f059f258ad04b72b4b6e045 Mon Sep 17 00:00:00 2001 From: zojgame Date: Fri, 29 Mar 2024 18:42:18 +0500 Subject: [PATCH] reveiews --- src/components/Histories.tsx | 20 +++++-- src/components/MoreProjectButton.tsx | 2 +- src/components/Reviews.tsx | 90 +++++++++++++--------------- src/components/icons/PlayerIcon.tsx | 18 ++++++ 4 files changed, 74 insertions(+), 56 deletions(-) create mode 100644 src/components/icons/PlayerIcon.tsx diff --git a/src/components/Histories.tsx b/src/components/Histories.tsx index a20a1c0..20bec09 100644 --- a/src/components/Histories.tsx +++ b/src/components/Histories.tsx @@ -45,6 +45,14 @@ function Histories() { trackMouse: true, }); + useEffect(() => { + if (!videoRefs[0].current?.src) return; + const width = videoRefs[0].current.clientWidth; + const height = videoRefs[0].current.clientHeight; + setVideoWidth(width); + setVideoHeigth(height); + }, [videoRefs[0]]); + function handleEnded() { if (selectedVideoIndex === VIDEOS.length - 1) { setSelectedVideoIndex(0); @@ -180,12 +188,12 @@ function Histories() { playsInline className="aspect-[9/16] object-cover w-full h-full min-w-screen" onEnded={handleEnded} - onLoadedData={() => - setTimeout(() => { - setVideoWidth(videoRefs[0].current!.clientWidth); - setVideoHeigth(videoRefs[0].current!.clientHeight); - }, 200) - } + // onLoadedData={() => + // setTimeout(() => { + // setVideoWidth(videoRefs[0].current!.clientWidth); + // setVideoHeigth(videoRefs[0].current!.clientHeight); + // }, 200) + // } />