[251114] fix: HomePanel,HomeBanner 초기 비디오 로드 보장-1
🕐 커밋 시간: 2025. 11. 14. 16:32:22 📊 변경 통계: • 총 파일: 1개 • 추가: +22줄 • 삭제: -4줄 📝 수정된 파일: ~ com.twin.app.shoptime/src/views/HomePanel/HomeBanner/RandomUnit.jsx 🔧 함수 변경 내용: 📄 com.twin.app.shoptime/src/views/HomePanel/HomeBanner/RandomUnit.jsx (javascript): 🔄 Modified: SpotlightContainerDecorator()
This commit is contained in:
@@ -33,6 +33,7 @@ import {
|
||||
LOG_TP_NO,
|
||||
panel_names,
|
||||
} from '../../../utils/Config';
|
||||
import { selectIsPlaying } from '../../../utils/playerState/playerStateSelectors';
|
||||
import { $L, formatGMTString } from '../../../utils/helperMethods';
|
||||
import { TEMPLATE_CODE_CONF } from '../HomePanel';
|
||||
import css from './RandomUnit.module.less';
|
||||
@@ -69,6 +70,11 @@ export default function RandomUnit({
|
||||
return playerPanel?.panelInfo?.playerState?.currentBannerId;
|
||||
});
|
||||
|
||||
const isVideoPlaying = useSelector(selectIsPlaying);
|
||||
const isCurrentBannerVideoPlaying = Boolean(
|
||||
currentVideoBannerId && isVideoPlaying && currentVideoBannerId === spotlightId
|
||||
);
|
||||
|
||||
// 정상적으로 로딩되면 빈객체로 넘어가고 , 에러가 나면 객체안에 타입이 담겨옵니다.
|
||||
const broadcast = useSelector((state) => state.common.broadcast);
|
||||
const { curationId, curationTitle } = useSelector((state) => state.home);
|
||||
@@ -230,7 +236,7 @@ export default function RandomUnit({
|
||||
}
|
||||
|
||||
// video가 플레이 불가능한 경우: 재생 중인 비디오를 1px로 축소
|
||||
if (!videoPlayerable && currentVideoBannerId) {
|
||||
if (!videoPlayerable && currentVideoBannerId && isCurrentBannerVideoPlaying) {
|
||||
console.log('[RandomUnit] videoPlayerable=false, shrinking video to 1px', {
|
||||
videoPlayerable,
|
||||
currentVideoBannerId,
|
||||
@@ -397,7 +403,7 @@ export default function RandomUnit({
|
||||
let action = linkType === 'DSP00507' ? startVideoPlayer : pushPanel;
|
||||
|
||||
const isNavigatingToDetail = linkInfo.name === panel_names.DETAIL_PANEL;
|
||||
if (isNavigatingToDetail && playerPanelInfo?.modal !== false) {
|
||||
if (isNavigatingToDetail && playerPanelInfo?.modal !== false && isCurrentBannerVideoPlaying) {
|
||||
dispatch(finishVideoPreview());
|
||||
}
|
||||
|
||||
@@ -422,11 +428,12 @@ export default function RandomUnit({
|
||||
topContentsLogInfo,
|
||||
playerPanelInfo?.modal,
|
||||
sendBannerLog,
|
||||
isCurrentBannerVideoPlaying,
|
||||
]);
|
||||
|
||||
// 투데이즈딜 클릭
|
||||
const todayDealClick = useCallback(() => {
|
||||
if (playerPanelInfo?.modal !== false) {
|
||||
if (playerPanelInfo?.modal !== false && isCurrentBannerVideoPlaying) {
|
||||
dispatch(finishVideoPreview());
|
||||
}
|
||||
|
||||
@@ -456,6 +463,7 @@ export default function RandomUnit({
|
||||
topContentsLogInfo,
|
||||
sendBannerLog,
|
||||
playerPanelInfo?.modal,
|
||||
isCurrentBannerVideoPlaying,
|
||||
]);
|
||||
|
||||
// 비디오 클릭
|
||||
|
||||
Reference in New Issue
Block a user