From fd638bd736fc7454cf26024ac9bfadb33c48d860 Mon Sep 17 00:00:00 2001 From: "opacity@t-win.kr" Date: Tue, 21 Oct 2025 10:10:22 +0900 Subject: [PATCH] =?UTF-8?q?vod=20=EC=9E=90=EB=8F=99=EC=9E=AC=EC=83=9D=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/PlayerPanel/PlayerPanel.jsx | 92 ++++++++++++------- 1 file changed, 61 insertions(+), 31 deletions(-) diff --git a/com.twin.app.shoptime/src/views/PlayerPanel/PlayerPanel.jsx b/com.twin.app.shoptime/src/views/PlayerPanel/PlayerPanel.jsx index f90baf96..47612073 100644 --- a/com.twin.app.shoptime/src/views/PlayerPanel/PlayerPanel.jsx +++ b/com.twin.app.shoptime/src/views/PlayerPanel/PlayerPanel.jsx @@ -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) {