[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:
2025-10-26 20:17:23 +09:00
parent efbe4c866c
commit a7e9f4f0a0
3 changed files with 137 additions and 68 deletions

View File

@@ -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];