From 7c073165bbaf547e7e31f77ae70b73cbbde49eee Mon Sep 17 00:00:00 2001 From: optrader Date: Tue, 18 Nov 2025 05:51:30 +0900 Subject: [PATCH] =?UTF-8?q?[251118]=20feat:=20playActions=20=ED=95=A8?= =?UTF-8?q?=EC=88=98=20=EB=B3=B5=EA=B5=AC=20(hideModalVideo,=20showModalVi?= =?UTF-8?q?deo,=20stop=20=ED=95=A8=EC=88=98=EB=93=A4)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ae0e2414를 revert 후 playActions.js의 추가 함수들만 복구 🔽 추가된 함수들: - hideModalVideo() - 모달 비디오를 1px로 축소 - showModalVideo() - 축소된 비디오를 원래 크기로 복구 - stopModalVideoWithoutClosingPanel() - 모달 비디오 중지 (패널 유지) - stopFullscreenVideoWithoutClosingPanel() - 전체화면 비디오 중지 (패널 유지) - stopAllVideosWithoutClosingPanel() - 모든 비디오 중지 (패널 유지) 🤖 Generated with Claude Code Co-Authored-By: Claude --- .../src/actions/playActions.js | 121 +++++++++++++++++- 1 file changed, 119 insertions(+), 2 deletions(-) diff --git a/com.twin.app.shoptime/src/actions/playActions.js b/com.twin.app.shoptime/src/actions/playActions.js index efeb97e5..37cbb0e6 100644 --- a/com.twin.app.shoptime/src/actions/playActions.js +++ b/com.twin.app.shoptime/src/actions/playActions.js @@ -358,7 +358,7 @@ export const resumeFullscreenVideo = () => (dispatch, getState) => { }; // 모달 비디오를 1px로 축소 (배너 정보 저장) -export const shrinkVideoTo1px = () => (dispatch, getState) => { +export const hideModalVideo = () => (dispatch, getState) => { const panels = getState().panels.panels; // modal PlayerPanel 찾기 @@ -416,7 +416,7 @@ export const shrinkVideoTo1px = () => (dispatch, getState) => { }; // 축소된 모달 비디오를 원래 크기로 복구 -export const expandVideoFrom1px = () => (dispatch, getState) => { +export const showModalVideo = () => (dispatch, getState) => { const panels = getState().panels.panels; // 축소된 modal PlayerPanel 찾기 @@ -469,6 +469,123 @@ export const expandVideoFrom1px = () => (dispatch, getState) => { } }; +// 🔽 패널은 유지하고 비디오만 중지하는 함수들 + +/** + * 패널을 닫지 않고(popPanel 하지 않고) 비디오만 중지합니다. + * 모달 비디오의 재생을 중지하고 숨김 상태로 만듭니다. + */ +export const stopModalVideoWithoutClosingPanel = () => (dispatch, getState) => { + const panels = getState().panels.panels; + + // modal PlayerPanel 찾기 + const modalPlayerPanel = panels.find( + (panel) => panel.name === panel_names.PLAYER_PANEL && panel.panelInfo?.modal + ); + + if (modalPlayerPanel) { + console.log('[stopModalVideoWithoutClosingPanel] Stopping modal video playback'); + + // 타이머 정리 + if (startVideoFocusTimer) { + clearTimeout(startVideoFocusTimer); + startVideoFocusTimer = null; + } + + // 패널은 유지하되, 비디오 중지 상태로 업데이트 + dispatch( + updatePanel({ + name: panel_names.PLAYER_PANEL, + panelInfo: { + ...modalPlayerPanel.panelInfo, + shouldStop: true, // 비디오 중지 플래그 + isPaused: true, // 일시정지 상태 + isHidden: true, // 화면에서 숨김 + }, + }) + ); + + // Redux 상태도 중지로 업데이트 + dispatch(setVideoStopped()); + } +}; + +/** + * 패널을 닫지 않고 전체화면 비디오만 중지합니다. + */ +export const stopFullscreenVideoWithoutClosingPanel = () => (dispatch, getState) => { + const panels = getState().panels.panels; + + // 전체화면 PlayerPanel 찾기 + const fullscreenPlayerPanel = panels.find( + (panel) => panel.name === panel_names.PLAYER_PANEL && !panel.panelInfo?.modal + ); + + if (fullscreenPlayerPanel) { + console.log('[stopFullscreenVideoWithoutClosingPanel] Stopping fullscreen video playback'); + + // 타이머 정리 + if (startVideoFocusTimer) { + clearTimeout(startVideoFocusTimer); + startVideoFocusTimer = null; + } + + // 패널은 유지하되, 비디오 중지 상태로 업데이트 + dispatch( + updatePanel({ + name: panel_names.PLAYER_PANEL, + panelInfo: { + ...fullscreenPlayerPanel.panelInfo, + shouldStop: true, // 비디오 중지 플래그 + isPaused: true, + isHidden: true, + }, + }) + ); + + // Redux 상태도 중지로 업데이트 + dispatch(setVideoStopped()); + } +}; + +/** + * 모든 비디오(모달+전체화면)를 패널 닫지 않고 중지합니다. + */ +export const stopAllVideosWithoutClosingPanel = () => (dispatch, getState) => { + const panels = getState().panels.panels; + + // 모든 PlayerPanel 찾기 + const playerPanels = panels.filter((panel) => panel.name === panel_names.PLAYER_PANEL); + + if (playerPanels.length > 0) { + console.log('[stopAllVideosWithoutClosingPanel] Stopping all video playback'); + + // 타이머 정리 + if (startVideoFocusTimer) { + clearTimeout(startVideoFocusTimer); + startVideoFocusTimer = null; + } + + // 모든 PlayerPanel을 중지 상태로 업데이트 + playerPanels.forEach((playerPanel) => { + dispatch( + updatePanel({ + name: panel_names.PLAYER_PANEL, + panelInfo: { + ...playerPanel.panelInfo, + shouldStop: true, + isPaused: true, + isHidden: true, + }, + }) + ); + }); + + // Redux 상태도 중지로 업데이트 + dispatch(setVideoStopped()); + } +}; + // 채팅 로그 가져오기 IF-LGSP-371 export const getChatLog = ({ patnrId, showId }) =>