vod 자동재생 추가
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user