[251026] feat: modal 모드에서 비디오 1px 축소/복구 기능 구현

- PlayerPanel useEffect에서 shouldShrinkTo1px 플래그로 인라인 스타일 제거
- shrinkVideoTo1px/expandVideoFrom1px 액션 추가 (배너 정보 playerState에 저장)
- PlayerPanel.module.less에 .shrinkTo1px 클래스 추가
- HomePanel onScroll에서 스크롤 방향 감지하여 축소/확대 제어
- RandomUnit onBlur에서의 축소 로직은 주석 처리 (스크롤로 제어)
This commit is contained in:
2025-10-26 21:44:13 +09:00
parent a7e9f4f0a0
commit 9f3cd62549
5 changed files with 143 additions and 5 deletions

View File

@@ -240,6 +240,83 @@ export const resumeFullscreenVideo = () => (dispatch, getState) => {
}
};
// 모달 비디오를 1px로 축소 (배너 정보 저장)
export const shrinkVideoTo1px = () => (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) {
const panelInfo = modalPlayerPanel.panelInfo;
console.log('[shrinkVideoTo1px] Shrinking modal video to 1px');
// 축소 전 배너 정보를 playerState에 저장
const updatedPlayerState = {
...(panelInfo.playerState || {}),
shrinkInfo: {
// 복구 시 필요한 정보
modalContainerId: panelInfo.modalContainerId,
modalClassName: panelInfo.modalClassName,
modalStyle: panelInfo.modalStyle,
modalScale: panelInfo.modalScale,
currentBannerId: panelInfo.playerState?.currentBannerId,
patnrId: panelInfo.patnrId,
showId: panelInfo.showId,
shptmBanrTpNm: panelInfo.shptmBanrTpNm,
lgCatCd: panelInfo.lgCatCd,
},
};
dispatch(
updatePanel({
name: panel_names.PLAYER_PANEL,
panelInfo: {
...panelInfo,
shouldShrinkTo1px: true, // 축소 플래그 설정
playerState: updatedPlayerState,
},
})
);
}
};
// 축소된 모달 비디오를 원래 크기로 복구
export const expandVideoFrom1px = () => (dispatch, getState) => {
const panels = getState().panels.panels;
// 축소된 modal PlayerPanel 찾기
const shrunkModalPlayerPanel = panels.find(
(panel) => panel.name === panel_names.PLAYER_PANEL && panel.panelInfo?.modal && panel.panelInfo?.shouldShrinkTo1px
);
if (shrunkModalPlayerPanel) {
const panelInfo = shrunkModalPlayerPanel.panelInfo;
const shrinkInfo = panelInfo.playerState?.shrinkInfo;
console.log('[expandVideoFrom1px] Expanding modal video from 1px', shrinkInfo);
dispatch(
updatePanel({
name: panel_names.PLAYER_PANEL,
panelInfo: {
...panelInfo,
shouldShrinkTo1px: false, // 축소 플래그 해제
// 저장된 정보로 복구
...(shrinkInfo && {
modalContainerId: shrinkInfo.modalContainerId,
modalClassName: shrinkInfo.modalClassName,
modalStyle: shrinkInfo.modalStyle,
modalScale: shrinkInfo.modalScale,
}),
},
})
);
}
};
// 채팅 로그 가져오기 IF-LGSP-371
export const getChatLog =
({ patnrId, showId }) =>