Revert "[251118] feat: playActions 함수 추가"

This reverts commit ae0e24144a.
This commit is contained in:
2025-11-18 05:50:26 +09:00
parent ae0e24144a
commit 7af47679cc
4 changed files with 22 additions and 245 deletions

View File

@@ -217,7 +217,7 @@ export const finishVideoPreview = () => (dispatch, getState) => {
clearTimeout(startVideoFocusTimer);
startVideoFocusTimer = null;
}
// dispatch(popPanel());
dispatch(popPanel());
}
};
@@ -235,7 +235,7 @@ export const finishModalVideoForce = () => (dispatch, getState) => {
startVideoFocusTimer = null;
}
// panelName을 지정하면 스택 어디에 있든 해당 패널을 제거
// dispatch(popPanel(panel_names.PLAYER_PANEL));
dispatch(popPanel(panel_names.PLAYER_PANEL));
}
};
@@ -256,123 +256,6 @@ export const finishAllVideoForce = () => (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());
}
};
// 모달 비디오를 일시정지 (패널은 유지)
export const pauseModalVideo = () => (dispatch, getState) => {
const panels = getState().panels.panels;
@@ -475,7 +358,7 @@ export const resumeFullscreenVideo = () => (dispatch, getState) => {
};
// 모달 비디오를 1px로 축소 (배너 정보 저장)
export const hideModalVideo = () => (dispatch, getState) => {
export const shrinkVideoTo1px = () => (dispatch, getState) => {
const panels = getState().panels.panels;
// modal PlayerPanel 찾기
@@ -506,7 +389,7 @@ export const hideModalVideo = () => (dispatch, getState) => {
},
};
// console.log('[HomePanel] hideModalVideo: saving shrinkInfo', {
// console.log('[HomePanel] shrinkVideoTo1px: saving shrinkInfo', {
// shrinkInfo: updatedPlayerState.shrinkInfo,
// modalStyle: panelInfo.modalStyle,
// });
@@ -522,7 +405,7 @@ export const hideModalVideo = () => (dispatch, getState) => {
})
);
} else {
console.log('[HomePanel] hideModalVideo: No modal PlayerPanel found', {
console.log('[HomePanel] shrinkVideoTo1px: No modal PlayerPanel found', {
panels: panels.map((p) => ({
name: p.name,
modal: p.panelInfo?.modal,
@@ -533,7 +416,7 @@ export const hideModalVideo = () => (dispatch, getState) => {
};
// 축소된 모달 비디오를 원래 크기로 복구
export const showModalVideo = () => (dispatch, getState) => {
export const expandVideoFrom1px = () => (dispatch, getState) => {
const panels = getState().panels.panels;
// 축소된 modal PlayerPanel 찾기
@@ -548,7 +431,7 @@ export const showModalVideo = () => (dispatch, getState) => {
const panelInfo = shrunkModalPlayerPanel.panelInfo;
const shrinkInfo = panelInfo.playerState?.shrinkInfo;
// console.log('[HomePanel] showModalVideo: expanding video', {
// console.log('[HomePanel] expandVideoFrom1px: expanding video', {
// hasShrinkInfo: !!shrinkInfo,
// hasModalStyle: !!shrinkInfo?.modalStyle,
// hasModalContainerId: !!shrinkInfo?.modalContainerId,
@@ -567,7 +450,7 @@ export const showModalVideo = () => (dispatch, getState) => {
}),
};
// console.log('[HomePanel] showModalVideo: updated panelInfo shouldShrinkTo1px=false, modalStyle restored, skipModalStyleRecalculation=true');
// console.log('[HomePanel] expandVideoFrom1px: updated panelInfo shouldShrinkTo1px=false, modalStyle restored, skipModalStyleRecalculation=true');
dispatch(
updatePanel({
@@ -576,7 +459,7 @@ export const showModalVideo = () => (dispatch, getState) => {
})
);
} else {
console.log('[HomePanel] showModalVideo: No shrunk modal PlayerPanel found', {
console.log('[HomePanel] expandVideoFrom1px: No shrunk modal PlayerPanel found', {
panels: panels.map((p) => ({
name: p.name,
modal: p.panelInfo?.modal,