From d795182d4cedf2b4b5fab696b6480a05f2d26b95 Mon Sep 17 00:00:00 2001 From: optrader Date: Wed, 26 Nov 2025 10:08:35 +0900 Subject: [PATCH] [251126] fix: Log Migration - PlayerPanel.jsx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ๐Ÿ• ์ปค๋ฐ‹ ์‹œ๊ฐ„: 2025. 11. 26. 10:08:34 ๐Ÿ“Š ๋ณ€๊ฒฝ ํ†ต๊ณ„: โ€ข ์ด ํŒŒ์ผ: 2๊ฐœ ๐Ÿ“ ์ˆ˜์ •๋œ ํŒŒ์ผ: ~ com.twin.app.shoptime/src/components/VideoPlayer/VideoPlayer.js ~ com.twin.app.shoptime/src/views/PlayerPanel/PlayerPanel.jsx ๐Ÿ”ง ์ฃผ์š” ๋ณ€๊ฒฝ ๋‚ด์šฉ: โ€ข UI ์ปดํฌ๋„ŒํŠธ ์•„ํ‚คํ…์ฒ˜ ๊ฐœ์„  --- .../src/components/VideoPlayer/VideoPlayer.js | 6 ++- .../src/views/PlayerPanel/PlayerPanel.jsx | 45 ++++++++++++++----- 2 files changed, 39 insertions(+), 12 deletions(-) diff --git a/com.twin.app.shoptime/src/components/VideoPlayer/VideoPlayer.js b/com.twin.app.shoptime/src/components/VideoPlayer/VideoPlayer.js index c460525b..f29d1b28 100644 --- a/com.twin.app.shoptime/src/components/VideoPlayer/VideoPlayer.js +++ b/com.twin.app.shoptime/src/components/VideoPlayer/VideoPlayer.js @@ -776,6 +776,7 @@ const VideoPlayerBase = class extends React.Component { this.sliderKnobProportion = 0; this.mediaControlsSpotlightId = props.spotlightId + '_mediaControls'; this.jumpButtonPressed = null; + this.focusTimer = null; // Re-render-necessary State this.state = { @@ -1038,6 +1039,7 @@ const VideoPlayerBase = class extends React.Component { this.stopDelayedTitleHide(); this.stopDelayedFeedbackHide(); this.stopDelayedMiniFeedbackHide(); + if (this.focusTimer) clearTimeout(this.focusTimer); this.announceJob.stop(); this.renderBottomControl.stop(); this.slider5WayPressJob.stop(); @@ -2603,11 +2605,11 @@ const VideoPlayerBase = class extends React.Component { this.showControls(); if (this.state.lastFocusedTarget) { - setTimeout(() => { + this.focusTimer = setTimeout(() => { Spotlight.focus(this.state.lastFocusedTarget); }); } else { - setTimeout(() => { + this.focusTimer = setTimeout(() => { Spotlight.focus(SpotlightIds.PLAYER_TAB_BUTTON); }); } diff --git a/com.twin.app.shoptime/src/views/PlayerPanel/PlayerPanel.jsx b/com.twin.app.shoptime/src/views/PlayerPanel/PlayerPanel.jsx index 58430c82..23952d3f 100644 --- a/com.twin.app.shoptime/src/views/PlayerPanel/PlayerPanel.jsx +++ b/com.twin.app.shoptime/src/views/PlayerPanel/PlayerPanel.jsx @@ -282,6 +282,7 @@ const PlayerPanel = ({ isTabActivated, panelInfo, isOnTop, spotlightId, ...props const watchIntervalLive = useRef(null); const watchIntervalVod = useRef(null); const watchIntervalMedia = useRef(null); + const timeoutRef = useRef(null); // useEffect(() => { // console.log("###videoLoaded", videoLoaded); // if (nowMenu) { @@ -291,8 +292,15 @@ const PlayerPanel = ({ isTabActivated, panelInfo, isOnTop, spotlightId, ...props if (liveShowInfos && liveShowInfos.length > 0) { const panelInfoChanId = panelInfo?.chanId; const isLive = panelInfo?.shptmBanrTpNm === 'LIVE'; + const isModal = panelInfo?.modal; if (isLive) { + // live full ํ™”๋ฉด์—์„œ modal ์ „ํ™˜์‹œ ๋กœ๊ทธ ์ „์†ก ์ถ”๊ฐ€ + if (isModal) { + dispatch(sendLogGNB(Config.LOG_MENU.FULL)); + prevNowMenuRef.current = nowMenuRef.current; + return () => dispatch(sendLogGNB(prevNowMenuRef.current)); + } const liveShowInfo = liveShowInfos // .find(({ chanId }) => panelInfoChanId === chanId); @@ -303,7 +311,7 @@ const PlayerPanel = ({ isTabActivated, panelInfo, isOnTop, spotlightId, ...props } return {}; - }, [liveShowInfos, panelInfo?.chanId, panelInfo?.shptmBanrTpNm]); + }, [liveShowInfos, panelInfo?.chanId, panelInfo?.shptmBanrTpNm, panelInfo?.modal]); const currentVODShowInfo = useMemo(() => { if (showDetailInfo && showDetailInfo.length > 0) { @@ -327,7 +335,7 @@ const PlayerPanel = ({ isTabActivated, panelInfo, isOnTop, spotlightId, ...props prevNowMenuRef.current = nowMenuRef.current; return () => dispatch(sendLogGNB(prevNowMenuRef.current)); - } else if (panelInfo?.modal) { + } else if (panelInfo?.modal && panelInfo?.shptmBanrTpNm !== 'LIVE') { dispatch(sendLogGNB(entryMenu)); } }, [panelInfo?.modal, panelInfo?.shptmBanrTpNm]); @@ -619,7 +627,7 @@ const PlayerPanel = ({ isTabActivated, panelInfo, isOnTop, spotlightId, ...props if (lastFocusedTargetId) { // ShopNowContents๊ฐ€ ๋ Œ๋”๋ง๋  ๋•Œ๊นŒ์ง€ ๋Œ€๊ธฐ ํ›„ ํฌ์ปค์Šค ๋ณต์› - setTimeout(() => { + timeoutRef.current = setTimeout(() => { dlog('[PlayerPanel] ๐Ÿ” 800ms ํ›„ ํฌ์ปค์Šค ๋ณต์› ์‹œ๋„:', lastFocusedTargetId); Spotlight.focus(lastFocusedTargetId); }, 800); @@ -1147,7 +1155,7 @@ const PlayerPanel = ({ isTabActivated, panelInfo, isOnTop, spotlightId, ...props //๋”ฎ๋งํฌ๋กœ ํ”Œ๋ ˆ์ด์–ด ์ง„์ž… ํ›„ ์ด์ „๋ฒ„ํŠผ ํด๋ฆญ์‹œ if (panels.length === 1) { - setTimeout(() => { + timeoutRef.current = setTimeout(() => { Spotlight.focus(SpotlightIds.HOME_TBODY); }); } @@ -1685,7 +1693,7 @@ const PlayerPanel = ({ isTabActivated, panelInfo, isOnTop, spotlightId, ...props useEffect(() => { if (currentLiveTimeSeconds > liveTotalTime) { - setTimeout(() => { + timeoutRef.current = setTimeout(() => { dispatch(getMainLiveShow()); setShopNowInfo(''); dispatch( @@ -1694,8 +1702,21 @@ const PlayerPanel = ({ isTabActivated, panelInfo, isOnTop, spotlightId, ...props }) ); }, 3000); + + return () => { + if (timeoutRef.current) clearTimeout(timeoutRef.current); + }; } - }, [currentLiveTimeSeconds, liveTotalTime]); + }, [currentLiveTimeSeconds, liveTotalTime, dispatch, playListInfo, selectedIndex]); + + useEffect(() => { + return () => { + if (timeoutRef.current) clearTimeout(timeoutRef.current); + if (watchIntervalLive.current) clearInterval(watchIntervalLive.current); + if (watchIntervalVod.current) clearInterval(watchIntervalVod.current); + if (watchIntervalMedia.current) clearInterval(watchIntervalMedia.current); + }; + }, []); const mediainfoHandler = useCallback( (ev) => { @@ -1994,7 +2015,7 @@ const PlayerPanel = ({ isTabActivated, panelInfo, isOnTop, spotlightId, ...props const handlePopupClose = useCallback(() => { dispatch(setHidePopup()); - setTimeout(() => Spotlight.focus(SpotlightIds.PLAYER_SUBTITLE_BUTTON)); + timeoutRef.current = setTimeout(() => Spotlight.focus(SpotlightIds.PLAYER_SUBTITLE_BUTTON)); }, [dispatch]); const reactPlayerSubtitleConfig = useMemo(() => { if (isSubtitleActive && currentSubtitleBlob) { @@ -2324,7 +2345,7 @@ const PlayerPanel = ({ isTabActivated, panelInfo, isOnTop, spotlightId, ...props }) ); Spotlight.pause(); - setTimeout(() => { + timeoutRef.current = setTimeout(() => { Spotlight.resume(); dispatch(PanelActions.popPanel()); }, VIDEO_END_ACTION_DELAY); @@ -2332,7 +2353,7 @@ const PlayerPanel = ({ isTabActivated, panelInfo, isOnTop, spotlightId, ...props } if (panelInfoRef.current.shptmBanrTpNm === 'VOD') { Spotlight.pause(); - setTimeout(() => { + timeoutRef.current = setTimeout(() => { stopExternalPlayer(); if (panelInfoRef.current.modal) { // ๋ชจ๋‹ฌ ๋ชจ๋“œ์—์„œ๋Š” ์ข…๋ฃŒ ํ›„ ํ™”๋ฉด์„ ์œ ์ง€ํ•˜๊ณ  Back ์•„์ด์ฝ˜์œผ๋กœ ํฌ์ปค์Šค ์ด๋™ @@ -2582,7 +2603,7 @@ const PlayerPanel = ({ isTabActivated, panelInfo, isOnTop, spotlightId, ...props if (lastFocusedTargetId) { // ShopNowContents๊ฐ€ ๋ Œ๋”๋ง๋  ๋•Œ๊นŒ์ง€ ์ž ์‹œ ๋Œ€๊ธฐ ํ›„ ํฌ์ปค์Šค ๋ณต์› - setTimeout(() => { + timeoutRef.current = setTimeout(() => { dlog('[PlayerPanel] ๐Ÿ” 500ms ํ›„ ํฌ์ปค์Šค ๋ณต์› ์‹œ๋„:', lastFocusedTargetId); Spotlight.focus(lastFocusedTargetId); }, 500); @@ -2591,6 +2612,10 @@ const PlayerPanel = ({ isTabActivated, panelInfo, isOnTop, spotlightId, ...props // ํ•œ ๋ฒˆ ์ฒ˜๋ฆฌํ•œ ๋ณต๊ท€ ํ”Œ๋ž˜๊ทธ๋Š” ์ฆ‰์‹œ ํ•ด์ œํ•ด ์ค‘๋ณต ์˜ํ–ฅ์„ ๋ง‰๋Š”๋‹ค. prevIsTopPanelDetailFromPlayerRef.current = false; } + + return () => { + if (timeoutRef.current) clearTimeout(timeoutRef.current); + }; } }, [ isOnTop,