diff --git a/com.twin.app.shoptime/src/views/HomePanel/HomeBanner/RandomUnit.jsx b/com.twin.app.shoptime/src/views/HomePanel/HomeBanner/RandomUnit.jsx index b8735abf..3b98365d 100644 --- a/com.twin.app.shoptime/src/views/HomePanel/HomeBanner/RandomUnit.jsx +++ b/com.twin.app.shoptime/src/views/HomePanel/HomeBanner/RandomUnit.jsx @@ -146,6 +146,26 @@ export default function RandomUnit({ const onFocus = useCallback(() => { setIsFocused(true); + timerRef.current = setTimeout( + () => + dispatch( + startVideoPlayer({ + showUrl: randomData.showUrl, + patnrId: randomData.patnrId, + showId: randomData.showId, + shptmBanrTpNm: randomData.showId + ? randomData.shptmBanrTpNm + : "MEDIA", + lgCatCd: randomData.lgCatCd, + chanId: randomData.brdcChnlId, + modal: true, + modalContainerId: spotlightId, + modalClassName: css.videoModal, + }) + ), + 1000 + ); + if (handleItemFocus) { handleItemFocus(); } @@ -154,6 +174,7 @@ export default function RandomUnit({ // 포커스 아웃 const onBlur = useCallback(() => { setIsFocused(false); + setVideoError(false); clearTimeout(timerRef.current); dispatch(finishVideoPreview()); @@ -394,36 +415,36 @@ export default function RandomUnit({ } }, [randomData]); - useEffect(() => { - if (isFocused && !videoError) { - timerRef.current = setTimeout( - () => - dispatch( - startVideoPlayer({ - showUrl: randomData.showUrl, - patnrId: randomData.patnrId, - showId: randomData.showId, - shptmBanrTpNm: randomData.showId - ? randomData.shptmBanrTpNm - : "MEDIA", - lgCatCd: randomData.lgCatCd, - chanId: randomData.brdcChnlId, - modal: true, - modalContainerId: spotlightId, - modalClassName: css.videoModal, - }) - ), - 1000 - ); - } - if (!isFocused) { - setVideoError(false); - // dispatch(finishVideoPreview()); - } - return () => { - clearTimeout(timerRef.current); - }; - }, [isFocused]); + // useEffect(() => { + // if (isFocused && !videoError) { + // timerRef.current = setTimeout( + // () => + // dispatch( + // startVideoPlayer({ + // showUrl: randomData.showUrl, + // patnrId: randomData.patnrId, + // showId: randomData.showId, + // shptmBanrTpNm: randomData.showId + // ? randomData.shptmBanrTpNm + // : "MEDIA", + // lgCatCd: randomData.lgCatCd, + // chanId: randomData.brdcChnlId, + // modal: true, + // modalContainerId: spotlightId, + // modalClassName: css.videoModal, + // }) + // ), + // 1000 + // ); + // } + // if (!isFocused) { + // setVideoError(false); + // // dispatch(finishVideoPreview()); + // } + // return () => { + // clearTimeout(timerRef.current); + // }; + // }, [isFocused]); useEffect(() => { if (isFocused && broadcast?.type === "videoError") {