From b1640cab2fc09151909a0bb74e9f03c857cdfa86 Mon Sep 17 00:00:00 2001 From: optrader Date: Sun, 16 Nov 2025 23:27:35 +0900 Subject: [PATCH] [251116] feat: HomePanel return form DetailPanel video playing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ๐Ÿ• ์ปค๋ฐ‹ ์‹œ๊ฐ„: 2025. 11. 16. 23:27:35 ๐Ÿ“Š ๋ณ€๊ฒฝ ํ†ต๊ณ„: โ€ข ์ด ํŒŒ์ผ: 4๊ฐœ โ€ข ์ถ”๊ฐ€: +71์ค„ โ€ข ์‚ญ์ œ: -27์ค„ ๐Ÿ“ ์ˆ˜์ •๋œ ํŒŒ์ผ: ~ com.twin.app.shoptime/src/actions/playActions.js ~ com.twin.app.shoptime/src/views/HomePanel/HomeBanner/RandomUnit.jsx ~ com.twin.app.shoptime/src/views/HomePanel/HomePanel.jsx ~ com.twin.app.shoptime/src/views/MainView/MainView.jsx ๐Ÿ”ง ํ•จ์ˆ˜ ๋ณ€๊ฒฝ ๋‚ด์šฉ: ๐Ÿ“„ com.twin.app.shoptime/src/views/HomePanel/HomeBanner/RandomUnit.jsx (javascript): ๐Ÿ”„ Modified: SpotlightContainerDecorator() ๐Ÿ”ง ์ฃผ์š” ๋ณ€๊ฒฝ ๋‚ด์šฉ: โ€ข ํ•ต์‹ฌ ๋น„์ฆˆ๋‹ˆ์Šค ๋กœ์ง ๊ฐœ์„  --- .../src/actions/playActions.js | 1 + .../views/HomePanel/HomeBanner/RandomUnit.jsx | 4 +- .../src/views/HomePanel/HomePanel.jsx | 89 ++++++++++++++----- .../src/views/MainView/MainView.jsx | 2 +- 4 files changed, 71 insertions(+), 25 deletions(-) diff --git a/com.twin.app.shoptime/src/actions/playActions.js b/com.twin.app.shoptime/src/actions/playActions.js index fef433c7..efeb97e5 100644 --- a/com.twin.app.shoptime/src/actions/playActions.js +++ b/com.twin.app.shoptime/src/actions/playActions.js @@ -209,6 +209,7 @@ export const startVideoPlayerNew = }; export const finishVideoPreview = () => (dispatch, getState) => { + console.log('@@@@@@@@@@@@@@@@@-finishVideoPreview'); const panels = getState().panels.panels; const topPanel = panels[panels.length - 1]; if (topPanel && topPanel.name === panel_names.PLAYER_PANEL && topPanel.panelInfo.modal) { 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 5aa5cba4..1730e736 100644 --- a/com.twin.app.shoptime/src/views/HomePanel/HomeBanner/RandomUnit.jsx +++ b/com.twin.app.shoptime/src/views/HomePanel/HomeBanner/RandomUnit.jsx @@ -264,7 +264,7 @@ export default function RandomUnit({ }, [randomData, dispatch]); // ํฌ์ปค์Šค ์ธ - const onFocus = useCallback(() => { + const handleFocus = useCallback(() => { // ๐Ÿ”ฝ [251116] ํ˜„์žฌ ๋น„๋””์˜ค ์ƒํƒœ ๋กœ๊ทธ ์ถœ๋ ฅ console.log('[RandomUnit] onFocus - ํ˜„์žฌ ๋น„๋””์˜ค ์ƒํƒœ', { playback: videoPlayState.playback, @@ -839,7 +839,7 @@ export default function RandomUnit({ { }); // ๐Ÿ”ฝ ๋น„๋””์˜ค ์žฌ์ƒ ์˜๋„ ๊ณต์œ  ref const videoPlayIntentRef = useRef(null); + // โœ… [251116] ๋น„๋””์˜ค ์ค‘๋ณต ์žฌ์ƒ ๋ฐฉ์ง€ ref + const lastPlayedBannerIdRef = useRef(null); // ๐Ÿ”ฝ useVideoMove - ํฌ์ปค์Šค ์ „ํ™˜ ๊ธฐ๋ฐ˜ ๋™์˜์ƒ ์ œ์–ด // [COMMENTED OUT] useVideoMove ๋ฏธ์‚ฌ์šฉ - cleanup() ํ˜ธ์ถœ๋˜์ง€ ์•Š์Œ @@ -562,9 +565,9 @@ const HomePanel = ({ isOnTop }) => { const isVideoShrunk = panels.some( (panel) => panel.name === panel_names.PLAYER_PANEL && panel.panelInfo?.shouldShrinkTo1px ); - if (Spotlight.getPointerMode() && !isVideoShrunk) { - dispatch(finishVideoPreview()); - } + // if (Spotlight.getPointerMode() && !isVideoShrunk) { + // dispatch(finishVideoPreview()); + // } if (panelInfo.currentCatCd) { Spotlight.focus('spotlightId-' + panelInfo.currentCatCd); } @@ -600,11 +603,11 @@ const HomePanel = ({ isOnTop }) => { isInitialRender.current = false; // โœ… ๋งˆ์šดํŠธ ์‹œ banner0 ์ž๋™ ์žฌ์ƒ ์„ค์ • - console.log('[HomePanel] ๋งˆ์šดํŠธ - banner0 ์žฌ์ƒ ์‹œ๋„', videoPlay); + // console.log('[HomePanel] ๋งˆ์šดํŠธ - banner0 ์žฌ์ƒ ์‹œ๋„', videoPlay); videoPlayIntentRef.current = { bannerId: 'banner0' }; - console.log('[HomePanel] videoPlayIntentRef ์„ค์ •:', videoPlayIntentRef.current); - videoPlay.playVideo('banner0', { reason: 'mount-init' }); - console.log('[HomePanel] playVideo ํ˜ธ์ถœ ์™„๋ฃŒ'); + // console.log('[HomePanel] videoPlayIntentRef ์„ค์ •:', videoPlayIntentRef.current); + // videoPlay.playVideo('banner0', { reason: 'mount-init' }); + // console.log('[HomePanel] playVideo ํ˜ธ์ถœ ์™„๋ฃŒ'); if (isDeepLink || (!panels.length && !panelInfo.focusedContainerId)) { dispatch(changeAppStatus({ showLoadingPanel: { show: true, type: 'wait' } })); @@ -693,25 +696,67 @@ const HomePanel = ({ isOnTop }) => { // โœ… HomePanel ํ™œ์„ฑํ™” ์กฐ๊ฑด: ์ตœ์ƒ๋‹จ ํŒจ๋„ ๋˜๋Š” PlayerPanel ์•„๋ž˜์˜ ๋‘ ๋ฒˆ์งธ ํŒจ๋„ // ๋น„๋””์˜ค๊ฐ€ ์žฌ์ƒ์ด ์•„๋‹ˆ๋ฉด videoPlayIntentRef์˜ bannerId๋กœ ๋น„๋””์˜ค ์žฌ์ƒ + // [251116] isHomeOnTop์ธ ๊ฒฝ์šฐ์—๋Š” ๋น„๋””์˜ค๊ฐ€ ํ•ญ์ƒ ์žฌ์ƒ๋˜์–ด์•ผ ํ•จ useEffect(() => { - const isHomePanelActive = - panels[0]?.name === panel_names.HOME_PANEL || - (panels.length >= 2 && - panels[0]?.name === panel_names.PLAYER_PANEL && - panels[1]?.name === panel_names.HOME_PANEL); + console.log('[HomeActive] useEffect ์‹คํ–‰ - isOnTop:', isOnTop); + console.log('[HomeActive] videoPlayIntentRef.current:', videoPlayIntentRef.current); + console.log( + '[HomeActive] panels ์ƒํƒœ:', + panels.map((p) => ({ name: p.name, modal: p.panelInfo?.modal })) + ); - if (isHomePanelActive && videoPlayIntentRef.current?.bannerId) { - const bannerId = videoPlayIntentRef.current.bannerId; - const currentPlaying = videoPlay.getCurrentPlayingBanner(); + const isHomePanelActive = isOnTop; + console.log('[HomeActive] isHomePanelActive:', isHomePanelActive); - // ์ด๋ฏธ ์žฌ์ƒ ์ค‘์ธ ๋ฐฐ๋„ˆ๊ฐ€ ๋‹ค๋ฅด๋ฉด ์ƒˆ๋กœ ์žฌ์ƒ - if (currentPlaying !== bannerId) { - videoPlay.playVideo(bannerId, { - reason: 'homePanel-active', - }); - } + if (!isHomePanelActive) { + console.log('[HomeActive] ์กฐ๊ฑด ์‹คํŒจ: isHomePanelActive๊ฐ€ false'); + return; } - }, [panels]); + + if (!videoPlayIntentRef.current?.bannerId) { + console.log('[HomeActive] ์กฐ๊ฑด ์‹คํŒจ: videoPlayIntentRef.current?.bannerId๊ฐ€ ์—†์Œ', { + hasRef: !!videoPlayIntentRef.current, + hasBannerId: !!videoPlayIntentRef.current?.bannerId, + }); + return; + } + + const bannerId = videoPlayIntentRef.current.bannerId; + console.log('[HomeActive] ๋น„๋””์˜ค ์žฌ์ƒ ์‹œ๋„ - bannerId:', bannerId); + console.log('[HomeActive] ๋งˆ์ง€๋ง‰ ์žฌ์ƒํ•œ ๋ฐฐ๋„ˆ:', lastPlayedBannerIdRef.current); + + // โœ… [251116] ์ค‘๋ณต ์žฌ์ƒ ๋ฐฉ์ง€: ๊ฐ™์€ ๋ฐฐ๋„ˆ๋ฉด ์Šคํ‚ต + if (lastPlayedBannerIdRef.current === bannerId) { + console.log('[HomeActive] ์ค‘๋ณต ํ˜ธ์ถœ ๊ฐ์ง€ - ์Šคํ‚ต (์ด๋ฏธ ์žฌ์ƒ ์ค‘)'); + return; + } + + // const currentPlaying = videoPlay.getCurrentPlayingBanner(); + + // ์ด๋ฏธ ์žฌ์ƒ ์ค‘์ธ ๋ฐฐ๋„ˆ๊ฐ€ ๋‹ค๋ฅด๋ฉด ์ƒˆ๋กœ ์žฌ์ƒ + // if (currentPlaying !== bannerId) { + // videoPlay.playVideo(bannerId, { + // reason: 'homePanel-active', + // }); + // } + + // โœ… [251116] startVideoPlayerNew๋กœ ๋น„๋””์˜ค ์ž๋™ ์žฌ์ƒ + console.log('[HomeActive] dispatch(startVideoPlayerNew) ํ˜ธ์ถœ ์ง์ „:', { bannerId, modal: true }); + + // Spotlight.focus(bannerId); + // dispatch( + // startVideoPlayerNew({ + // bannerId: bannerId, + // modal: true, + // modalContainerId: 'banner-modal-' + bannerId, + // }) + // ); + console.log('[HomeActive] dispatch(startVideoPlayerNew) ํ˜ธ์ถœ ์™„๋ฃŒ'); + + // ์žฌ์ƒ ๊ธฐ๋ก ์—…๋ฐ์ดํŠธ + lastPlayedBannerIdRef.current = bannerId; + console.log('[HomeActive] ์žฌ์ƒ ๊ธฐ๋ก ์—…๋ฐ์ดํŠธ:', bannerId); + }, [isOnTop, dispatch]); useEffect(() => { return () => { diff --git a/com.twin.app.shoptime/src/views/MainView/MainView.jsx b/com.twin.app.shoptime/src/views/MainView/MainView.jsx index 1a34875a..b60b3e79 100644 --- a/com.twin.app.shoptime/src/views/MainView/MainView.jsx +++ b/com.twin.app.shoptime/src/views/MainView/MainView.jsx @@ -79,7 +79,7 @@ import WelcomeEventPanel from '../WelcomeEventPanel/WelcomeEventPanel'; import css from './MainView.module.less'; // DEBUG_MODE ์ƒ์ˆ˜ - true์ผ ๋•Œ๋งŒ console.log ์ถœ๋ ฅ -const DEBUG_MODE = true; +const DEBUG_MODE = false; const preloadImages = [ LoadingPreloadImage,