[251026] feat: HomeBaner Video-1
🕐 커밋 시간: 2025. 10. 26. 20:17:22 📊 변경 통계: • 총 파일: 3개 • 추가: +139줄 • 삭제: -70줄 📝 수정된 파일: ~ com.twin.app.shoptime/src/actions/playActions.js ~ com.twin.app.shoptime/src/views/HomePanel/HomeBanner/HomeBanner.jsx ~ com.twin.app.shoptime/src/views/HomePanel/HomeBanner/RandomUnit.jsx 🔧 주요 변경 내용: • 핵심 비즈니스 로직 개선 • 중간 규모 기능 개선 • 코드 정리 및 최적화
This commit is contained in:
@@ -59,6 +59,56 @@ export const startVideoPlayer =
|
||||
}
|
||||
};
|
||||
|
||||
export const startVideoPlayerNew =
|
||||
({ modal, modalContainerId, modalClassName, spotlightDisable, useNewPlayer, bannerId, ...rest }) =>
|
||||
(dispatch, getState) => {
|
||||
const panels = getState().panels.panels;
|
||||
const topPanel = panels[panels.length - 1];
|
||||
let panelWorkingAction = pushPanel;
|
||||
|
||||
// const panelName = useNewPlayer ? panel_names.PLAYER_PANEL_NEW : panel_names.PLAYER_PANEL;
|
||||
const panelName = panel_names.PLAYER_PANEL;
|
||||
|
||||
if (topPanel && topPanel.name === panelName) {
|
||||
panelWorkingAction = updatePanel;
|
||||
}
|
||||
|
||||
// playerState 업데이트: 기존 playerState와 새 데이터 병합
|
||||
const currentPlayerState = topPanel?.panelInfo?.playerState || {};
|
||||
|
||||
// 같은 배너에서 이미 비디오가 재생 중이면 return (중복 재생 방지)
|
||||
if (currentPlayerState.currentBannerId === bannerId) {
|
||||
return;
|
||||
}
|
||||
|
||||
const newPlayerState = {
|
||||
...currentPlayerState,
|
||||
currentBannerId: bannerId,
|
||||
};
|
||||
|
||||
dispatch(
|
||||
panelWorkingAction(
|
||||
{
|
||||
name: panelName,
|
||||
panelInfo: {
|
||||
modal,
|
||||
modalContainerId,
|
||||
modalClassName,
|
||||
playerState: newPlayerState,
|
||||
...rest,
|
||||
},
|
||||
},
|
||||
true
|
||||
)
|
||||
);
|
||||
if (modal && modalContainerId && !spotlightDisable) {
|
||||
Spotlight.setPointerMode(false);
|
||||
startVideoFocusTimer = setTimeout(() => {
|
||||
Spotlight.focus(modalContainerId);
|
||||
}, 0);
|
||||
}
|
||||
};
|
||||
|
||||
export const finishVideoPreview = () => (dispatch, getState) => {
|
||||
const panels = getState().panels.panels;
|
||||
const topPanel = panels[panels.length - 1];
|
||||
|
||||
Reference in New Issue
Block a user