vod 자동재생 추가

This commit is contained in:
opacity@t-win.kr
2025-10-21 10:10:22 +09:00
parent 86893ca547
commit fd638bd736

View File

@@ -1844,39 +1844,69 @@ const PlayerPanel = ({
};
}, []);
const onEnded = useCallback((e) => {
if (panelInfoRef.current.shptmBanrTpNm === "MEDIA") {
dispatch(
updatePanel({
name: panel_names.DETAIL_PANEL,
panelInfo: {
launchedFromPlayer: true,
isPlayerFinished: true,
},
})
);
Spotlight.pause();
setTimeout(() => {
Spotlight.resume();
dispatch(PanelActions.popPanel());
}, VIDEO_END_ACTION_DELAY);
return;
}
if (panelInfoRef.current.shptmBanrTpNm === "VOD") {
Spotlight.pause();
setTimeout(() => {
Spotlight.resume();
if (panelInfoRef.current.modal) {
videoPlayer.current.play();
const onEnded = useCallback(
(e) => {
if (panelInfoRef.current.shptmBanrTpNm === "MEDIA") {
dispatch(
updatePanel({
name: panel_names.DETAIL_PANEL,
panelInfo: {
launchedFromPlayer: true,
isPlayerFinished: true,
},
})
);
Spotlight.pause();
setTimeout(() => {
Spotlight.resume();
dispatch(PanelActions.popPanel());
}, VIDEO_END_ACTION_DELAY);
return;
}
if (panelInfoRef.current.shptmBanrTpNm === "VOD") {
// 플레이리스트에서 다음 비디오가 있는지 확인
const currentIndex = selectedIndex;
const nextIndex = currentIndex + 1;
if (
playListInfo &&
nextIndex < playListInfo.length &&
playListInfo[nextIndex]?.showId
) {
// 다음 비디오가 있으면 자동으로 다음 비디오 재생
setSelectedIndex(nextIndex);
dispatch(
getMainCategoryShowDetail({
patnrId: playListInfo[nextIndex]?.patnrId,
showId: playListInfo[nextIndex]?.showId,
curationId: playListInfo[nextIndex]?.curationId,
})
);
// 비디오가 로드될 때까지 잠시 대기 후 재생
setTimeout(() => {
if (videoPlayer.current) {
videoPlayer.current.play();
}
}, 1000);
} else {
dispatch(PanelActions.popPanel(panel_names.PLAYER_PANEL));
// 다음 비디오가 없으면 기존 로직 실행
Spotlight.pause();
setTimeout(() => {
Spotlight.resume();
if (panelInfoRef.current.modal) {
videoPlayer.current.play();
} else {
dispatch(PanelActions.popPanel(panel_names.PLAYER_PANEL));
}
}, VIDEO_END_ACTION_DELAY);
}
}, VIDEO_END_ACTION_DELAY);
e?.stopPropagation();
e?.preventDefault();
return;
}
}, []);
e?.stopPropagation();
e?.preventDefault();
return;
}
},
[selectedIndex, playListInfo, dispatch]
);
const onKeyDown = (ev) => {
if (ev.keyCode === 34) {