diff --git a/src/modules/landingV3/Componets/HeroV5/index.tsx b/src/modules/landingV3/Componets/HeroV5/index.tsx index 15c991168..99346f5ca 100644 --- a/src/modules/landingV3/Componets/HeroV5/index.tsx +++ b/src/modules/landingV3/Componets/HeroV5/index.tsx @@ -10,7 +10,8 @@ import cn from 'classnames'; const HeroV5 = () => { const videoRef = React.useRef(null); - const [isOpenModalVideo, setIsOpenModalVideo] = useState(false); + // const [isOpenModalVideo, setIsOpenModalVideo] = useState(false); + const [firstClick, setFirstClick] = useState(false); return (
@@ -58,15 +59,18 @@ const HeroV5 = () => { className={`${s.thumbnail} `} // ref={refContent} onClick={() => { + setFirstClick(true); // toggle video - if (videoRef.current) { - // check if video playing - if (videoRef.current.paused) { - videoRef.current.play(); - } else { - videoRef.current.pause(); + setTimeout(() => { + if (videoRef.current) { + // check if video playing + if (videoRef.current.paused) { + videoRef.current.play(); + } else { + videoRef.current.pause(); + } } - } + }, 100); }} >