From cf2cc57d95e905c2c9676234fa2803d001376c0c Mon Sep 17 00:00:00 2001 From: optrader Date: Sat, 22 Nov 2025 05:04:30 +0900 Subject: [PATCH] =?UTF-8?q?[251122]=20fix:=20PlayerPanel=20=EB=B9=84?= =?UTF-8?q?=EB=94=94=EC=98=A4=20=EC=84=A0=ED=83=9D=EC=8B=9C=20tabIndexV2?= =?UTF-8?q?=20=ED=83=80=EC=9D=B4=EB=A8=B8=20=EC=B4=88=EA=B8=B0=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ๐Ÿ• ์ปค๋ฐ‹ ์‹œ๊ฐ„: 2025. 11. 22. 05:04:30 ๐Ÿ“Š ๋ณ€๊ฒฝ ํ†ต๊ณ„: โ€ข ์ด ํŒŒ์ผ: 1๊ฐœ โ€ข ์ถ”๊ฐ€: +14์ค„ โ€ข ์‚ญ์ œ: -5์ค„ ๐Ÿ“ ์ˆ˜์ •๋œ ํŒŒ์ผ: ~ com.twin.app.shoptime/src/views/PlayerPanel/PlayerPanel.jsx --- .../src/views/PlayerPanel/PlayerPanel.jsx | 76 +++++++++++++++---- 1 file changed, 61 insertions(+), 15 deletions(-) diff --git a/com.twin.app.shoptime/src/views/PlayerPanel/PlayerPanel.jsx b/com.twin.app.shoptime/src/views/PlayerPanel/PlayerPanel.jsx index a72f39f9..42809934 100644 --- a/com.twin.app.shoptime/src/views/PlayerPanel/PlayerPanel.jsx +++ b/com.twin.app.shoptime/src/views/PlayerPanel/PlayerPanel.jsx @@ -63,10 +63,7 @@ import TabContainerV2 from './PlayerTabContents/v2/TabContainer.v2'; // import ShopNowContainer from './PlayerTabContents/v2/ShopNowContainer'; // import ShopNowButton from './PlayerTabContents/v2/ShopNowButton'; -const Container = SpotlightContainerDecorator( - { enterTo: 'last-focused', preserveId: true }, - 'div' -); +const Container = SpotlightContainerDecorator({ enterTo: 'last-focused', preserveId: true }, 'div'); const findSelector = (selector, maxAttempts = 5, currentAttempts = 0) => { try { @@ -394,10 +391,16 @@ const PlayerPanel = ({ isTabActivated, panelInfo, isOnTop, spotlightId, ...props // ํฌ์ปค์Šค ๋ณต์› ๋กœ์ง ์ถ”๊ฐ€ (1000ms ์ง€์—ฐ) if (panelInfo.lastFocusedTargetId) { - console.log('[PlayerPanel] ๐ŸŽฏ DetailPanel ๋ณต๊ท€ ํ›„ 1000ms ์ง€์—ฐ ํฌ์ปค์Šค ๋ณต์› ์˜ˆ์•ฝ:', panelInfo.lastFocusedTargetId); + console.log( + '[PlayerPanel] ๐ŸŽฏ DetailPanel ๋ณต๊ท€ ํ›„ 1000ms ์ง€์—ฐ ํฌ์ปค์Šค ๋ณต์› ์˜ˆ์•ฝ:', + panelInfo.lastFocusedTargetId + ); const focusTimeoutId = setTimeout(() => { - console.log('[PlayerPanel] ๐Ÿ” DetailPanel ๋ณต๊ท€ ํ›„ ํฌ์ปค์Šค ๋ณต์› ์‹คํ–‰:', panelInfo.lastFocusedTargetId); + console.log( + '[PlayerPanel] ๐Ÿ” DetailPanel ๋ณต๊ท€ ํ›„ ํฌ์ปค์Šค ๋ณต์› ์‹คํ–‰:', + panelInfo.lastFocusedTargetId + ); Spotlight.focus(panelInfo.lastFocusedTargetId); }, 1000); @@ -453,13 +456,16 @@ const PlayerPanel = ({ isTabActivated, panelInfo, isOnTop, spotlightId, ...props prevModalState, currentModalState, shouldExecuteTrueToFalse: prevModalState === true && currentModalState === false, - shouldExecuteFalseToTrue: prevModalState === false && currentModalState === true + shouldExecuteFalseToTrue: prevModalState === false && currentModalState === true, }); // true โ†’ false ๋ณ€ํ™” ๊ฐ์ง€ if (prevModalState === true && currentModalState === false) { console.log('[PlayerPanel] โ–ถ๏ธ Modal ์ƒํƒœ ๋ณ€ํ™”: true โ†’ false (์ „์ฒดํ™”๋ฉด ๋ชจ๋“œ๋กœ ๋ณต๊ท€)'); - console.log('[PlayerPanel] ๐ŸŽฏ ํฌ์ปค์Šค ๋ณต์› ์ค€๋น„ - lastFocusedTargetId:', panelInfo?.lastFocusedTargetId); + console.log( + '[PlayerPanel] ๐ŸŽฏ ํฌ์ปค์Šค ๋ณต์› ์ค€๋น„ - lastFocusedTargetId:', + panelInfo?.lastFocusedTargetId + ); setIsModalClosed(true); // ๋ชจ๋‹ฌ์ด ๋‹ซํ˜”์Œ์„ ํ‘œ์‹œ // DetailPanel์—์„œ ๋ณต๊ท€ ์‹œ ํฌ์ปค์Šค ๋ณต์› @@ -1217,7 +1223,13 @@ const PlayerPanel = ({ isTabActivated, panelInfo, isOnTop, spotlightId, ...props setShopNowInfo(null); } } - }, [showDetailInfo, panelInfo.showId, panelInfo.shptmBanrTpNm, fullVideolgCatCd, featuredShowsInfos]); + }, [ + showDetailInfo, + panelInfo.showId, + panelInfo.shptmBanrTpNm, + fullVideolgCatCd, + featuredShowsInfos, + ]); //LIVE useEffect(() => { @@ -1515,6 +1527,10 @@ const PlayerPanel = ({ isTabActivated, panelInfo, isOnTop, spotlightId, ...props const mediaId = videoPlayer.current?.video?.media?.mediaId; setMediaId(mediaId); setVideoLoaded(true); + console.log( + '[PlayerPanel] ๐ŸŽฌ Video Loaded - shptmBanrTpNm:', + panelInfoRef.current?.shptmBanrTpNm + ); } } }, @@ -1714,6 +1730,14 @@ const PlayerPanel = ({ isTabActivated, panelInfo, isOnTop, spotlightId, ...props setVideoLoaded(false); }, [currentPlayingUrl]); + // ๋น„๋””์˜ค๊ฐ€ ์ƒˆ๋กœ ์„ ํƒ๋  ๋•Œ ํƒ€์ด๋จธ ์ดˆ๊ธฐํ™” + useEffect(() => { + if (currentPlayingUrl) { + console.log('[PlayerPanel] ๐ŸŽฌ ๋น„๋””์˜ค ์„ ํƒ๋จ - tabIndexV2 ํƒ€์ด๋จธ ์ดˆ๊ธฐํ™”'); + resetTimerTabAutoAdvance(10000); + } + }, [selectedIndex, resetTimerTabAutoAdvance]); + const handlePopupClose = useCallback(() => { dispatch(setHidePopup()); setTimeout(() => Spotlight.focus(SpotlightIds.PLAYER_SUBTITLE_BUTTON)); @@ -2161,7 +2185,8 @@ const PlayerPanel = ({ isTabActivated, panelInfo, isOnTop, spotlightId, ...props // ์ •ํ™•ํ•œ ๋ณต๊ท€ ์ข…๋ฅ˜ ๊ตฌ๋ถ„: // 1. HomePanel ๋ณต๊ท€: modalPrevRef.current === true && prevIsTopPanelDetailFromPlayerRef.current === false // 2. DetailPanel ๋ณต๊ท€: prevIsTopPanelDetailFromPlayerRef.current === true - const isHomePanelReturn = modalPrevRef.current === true && prevIsTopPanelDetailFromPlayerRef.current === false; + const isHomePanelReturn = + modalPrevRef.current === true && prevIsTopPanelDetailFromPlayerRef.current === false; const isDetailPanelReturn = prevIsTopPanelDetailFromPlayerRef.current === true; if (isDetailPanelReturn) { @@ -2191,7 +2216,10 @@ const PlayerPanel = ({ isTabActivated, panelInfo, isOnTop, spotlightId, ...props // PlayerPanel ๋‚ด๋ถ€ DetailPanel์—์„œ ๋ณต๊ท€ ์‹œ์—๋งŒ ํฌ์ปค์Šค ๋ณต์› ์‹œ๋„ if (isDetailPanelReturn) { const lastFocusedTargetId = panelInfo?.lastFocusedTargetId; - console.log('[PlayerPanel] ๐ŸŽฏ PlayerPanel DetailPanel ๋ณต๊ท€ - lastFocusedTargetId:', lastFocusedTargetId); + console.log( + '[PlayerPanel] ๐ŸŽฏ PlayerPanel DetailPanel ๋ณต๊ท€ - lastFocusedTargetId:', + lastFocusedTargetId + ); if (lastFocusedTargetId) { // ShopNowContents๊ฐ€ ๋ Œ๋”๋ง๋  ๋•Œ๊นŒ์ง€ ์ž ์‹œ ๋Œ€๊ธฐ ํ›„ ํฌ์ปค์Šค ๋ณต์› @@ -2202,12 +2230,22 @@ const PlayerPanel = ({ isTabActivated, panelInfo, isOnTop, spotlightId, ...props } } } - }, [isOnTop, panelInfo.modal, videoVerticalVisible, panelInfo?.lastFocusedTargetId, tabContainerVersion, setTabIndexV2]); + }, [ + isOnTop, + panelInfo.modal, + videoVerticalVisible, + panelInfo?.lastFocusedTargetId, + tabContainerVersion, + setTabIndexV2, + ]); // PopularShow์—์„œ ์ฒ˜์Œ ํ˜ธ์ถœํ•  ๋•Œ์ฒ˜๋Ÿผ modal์ด false์ธ ์ƒํƒœ์—์„œ VOD/LIVE ๊ตฌ๋ถ„ useEffect(() => { if (isOnTop && !panelInfo.modal && !videoVerticalVisible && tabContainerVersion === 2) { - console.log('[PlayerPanel] ๐Ÿ“บ Modal false ์ƒํƒœ - shptmBanrTpNm:', panelInfoRef.current?.shptmBanrTpNm); + console.log( + '[PlayerPanel] ๐Ÿ“บ Modal false ์ƒํƒœ - shptmBanrTpNm:', + panelInfoRef.current?.shptmBanrTpNm + ); if (panelInfoRef.current?.shptmBanrTpNm === 'VOD') { setTabIndexV2(2); @@ -2295,7 +2333,9 @@ const PlayerPanel = ({ isTabActivated, panelInfo, isOnTop, spotlightId, ...props console.log('[TabContainerV2] tabIndex 1 โ†’ 2 ๊ฐ์ง€, ํƒ€์ด๋จธ ์‹œ์ž‘'); if (!belowContentsVisible || videoVerticalVisible) { - console.log('[TabContainerV2] early return - belowContentsVisible ๋˜๋Š” videoVerticalVisible ์กฐ๊ฑด ๋ถˆ๋งŒ์กฑ'); + console.log( + '[TabContainerV2] early return - belowContentsVisible ๋˜๋Š” videoVerticalVisible ์กฐ๊ฑด ๋ถˆ๋งŒ์กฑ' + ); return; } @@ -2338,7 +2378,13 @@ const PlayerPanel = ({ isTabActivated, panelInfo, isOnTop, spotlightId, ...props clearTimerTabAutoAdvance(); } }; - }, [tabIndexV2, belowContentsVisible, videoVerticalVisible, resetTimerTabAutoAdvance, clearTimerTabAutoAdvance]); + }, [ + tabIndexV2, + belowContentsVisible, + videoVerticalVisible, + resetTimerTabAutoAdvance, + clearTimerTabAutoAdvance, + ]); useLayoutEffect(() => { const videoContainer = document.querySelector(`.${css.videoContainer}`);