diff --git a/com.twin.app.shoptime/src/actions/videoPlayActions.js b/com.twin.app.shoptime/src/actions/videoPlayActions.js index 33177fbc..02d38683 100644 --- a/com.twin.app.shoptime/src/actions/videoPlayActions.js +++ b/com.twin.app.shoptime/src/actions/videoPlayActions.js @@ -9,6 +9,9 @@ export const VIDEO_PLAY_ACTIONS = { SET_VIDEO_BANNER: 'SET_VIDEO_BANNER', SET_VIDEO_FULLSCREEN: 'SET_VIDEO_FULLSCREEN', SET_VIDEO_MINIMIZED: 'SET_VIDEO_MINIMIZED', + HIDE_PLAYER_OVERLAYS: 'HIDE_PLAYER_OVERLAYS', + SHOW_PLAYER_OVERLAYS: 'SHOW_PLAYER_OVERLAYS', + RESET_PLAYER_OVERLAYS: 'RESET_PLAYER_OVERLAYS', }; // Video Play States @@ -92,3 +95,24 @@ export const setVideoMinimized = curry((videoInfo) => ({ timestamp: Date.now(), }, })); + +/** + * PlayerPanel 오버레이를 숨김 (DetailPanel 진입 시) + */ +export const hidePlayerOverlays = () => ({ + type: VIDEO_PLAY_ACTIONS.HIDE_PLAYER_OVERLAYS, +}); + +/** + * PlayerPanel 오버레이를 표시 (DetailPanel에서 복귀 시) + */ +export const showPlayerOverlays = () => ({ + type: VIDEO_PLAY_ACTIONS.SHOW_PLAYER_OVERLAYS, +}); + +/** + * 오버레이 상태를 리셋 + */ +export const resetPlayerOverlays = () => ({ + type: VIDEO_PLAY_ACTIONS.RESET_PLAYER_OVERLAYS, +}); diff --git a/com.twin.app.shoptime/src/components/VideoPlayer/VideoPlayer.js b/com.twin.app.shoptime/src/components/VideoPlayer/VideoPlayer.js index 3b5c00ed..d9d87287 100644 --- a/com.twin.app.shoptime/src/components/VideoPlayer/VideoPlayer.js +++ b/com.twin.app.shoptime/src/components/VideoPlayer/VideoPlayer.js @@ -2582,6 +2582,7 @@ const VideoPlayer = ApiDecorator( 'showControls', 'showFeedback', 'toggleControls', + 'onVideoClick', ], }, I18nContextDecorator( diff --git a/com.twin.app.shoptime/src/reducers/videoPlayReducer.js b/com.twin.app.shoptime/src/reducers/videoPlayReducer.js index 9f07a4e1..30bbfc46 100644 --- a/com.twin.app.shoptime/src/reducers/videoPlayReducer.js +++ b/com.twin.app.shoptime/src/reducers/videoPlayReducer.js @@ -5,6 +5,8 @@ const initialState = { state: VIDEO_STATES.STOPPED, // 'stopped', 'banner', 'fullscreen', 'minimized' videoInfo: {}, // 비디오 관련 정보 (showUrl, thumbnail, modalContainerId 등) timestamp: null, // 마지막 상태 변경 시간 + shouldHideOverlays: false, // 오버레이 숨김 플래그 + shouldShowOverlays: false, // 오버레이 표시 플래그 }; // FP handlers (curried) with immutable updates only @@ -53,15 +55,30 @@ const handleSetVideoMinimized = curry((state, action) => { ); }); +const handleHidePlayerOverlays = curry((state) => { + return set('shouldHideOverlays', true, set('shouldShowOverlays', false, state)); +}); + +const handleShowPlayerOverlays = curry((state) => { + return set('shouldShowOverlays', true, set('shouldHideOverlays', false, state)); +}); + +const handleResetPlayerOverlays = curry((state) => { + return set('shouldHideOverlays', false, set('shouldShowOverlays', false, state)); +}); + const handlers = { [VIDEO_PLAY_ACTIONS.UPDATE_VIDEO_STATE]: handleUpdateVideoState, [VIDEO_PLAY_ACTIONS.SET_VIDEO_STOPPED]: handleSetVideoStopped, [VIDEO_PLAY_ACTIONS.SET_VIDEO_BANNER]: handleSetVideoBanner, [VIDEO_PLAY_ACTIONS.SET_VIDEO_FULLSCREEN]: handleSetVideoFullscreen, [VIDEO_PLAY_ACTIONS.SET_VIDEO_MINIMIZED]: handleSetVideoMinimized, + [VIDEO_PLAY_ACTIONS.HIDE_PLAYER_OVERLAYS]: handleHidePlayerOverlays, + [VIDEO_PLAY_ACTIONS.SHOW_PLAYER_OVERLAYS]: handleShowPlayerOverlays, + [VIDEO_PLAY_ACTIONS.RESET_PLAYER_OVERLAYS]: handleResetPlayerOverlays, }; -export default function videoPlayReducer(state = initialState, action = {}) { +export function videoPlayReducer(state = initialState, action = {}) { const type = get('type', action); const handler = handlers[type]; return handler ? handler(state, action) : state; diff --git a/com.twin.app.shoptime/src/views/DetailPanel/DetailPanel.jsx b/com.twin.app.shoptime/src/views/DetailPanel/DetailPanel.jsx index 9764f561..f6e7a0f1 100644 --- a/com.twin.app.shoptime/src/views/DetailPanel/DetailPanel.jsx +++ b/com.twin.app.shoptime/src/views/DetailPanel/DetailPanel.jsx @@ -69,6 +69,11 @@ export default function DetailPanel({ panelInfo, isOnTop, spotlightId }) { [panelInfo] ); const panelBgImgNo = useMemo(() => fp.pipe(() => panelInfo, fp.get('bgImgNo'))(), [panelInfo]); + // PlayerPanel에서 진입했는지 여부를 panelInfo에서 추출 + const panelLaunchedFromPlayer = useMemo( + () => fp.pipe(() => panelInfo, fp.get('launchedFromPlayer'))(), + [panelInfo] + ); const productPmtSuptYn = useMemo( () => fp.pipe(() => productData, fp.get('pmtSuptYn'))(), [productData] @@ -142,6 +147,7 @@ export default function DetailPanel({ panelInfo, isOnTop, spotlightId }) { }) ); } + // PlayerPanel의 isOnTop useEffect가 자동으로 오버레이 표시 } )(); @@ -603,7 +609,7 @@ export default function DetailPanel({ panelInfo, isOnTop, spotlightId }) { }, [imageUrl]); */ - console.log('productDataSource :', productDataSource); + // console.log('productDataSource :', productDataSource); // 언마운트 시 인덱스 초기화가 필요하면: // useEffect(() => () => setSelectedIndex(0), []) @@ -620,7 +626,8 @@ export default function DetailPanel({ panelInfo, isOnTop, spotlightId }) { return (