featured brand list 있을경우 pinkpong vod 자동재생
This commit is contained in:
@@ -35,6 +35,7 @@ import {
|
||||
getMainLiveShow,
|
||||
getMainLiveShowNowProduct,
|
||||
} from "../../actions/mainActions";
|
||||
import { getBrandLiveChannelInfo } from "../../actions/brandActions";
|
||||
import * as PanelActions from "../../actions/panelActions";
|
||||
import { updatePanel } from "../../actions/panelActions";
|
||||
import {
|
||||
@@ -296,6 +297,11 @@ const PlayerPanel = ({
|
||||
(state) => state.common.broadcast
|
||||
);
|
||||
|
||||
const brandLiveChannelInfo = USE_SELECTOR(
|
||||
"brandLiveChannelInfo",
|
||||
(state) => state.brand.brandLiveChannelInfoData
|
||||
);
|
||||
|
||||
const lastPanelAction = USE_SELECTOR(
|
||||
"lastPanelAction",
|
||||
(state) => state.panels.lastPanelAction
|
||||
@@ -362,6 +368,13 @@ const PlayerPanel = ({
|
||||
return {};
|
||||
}, [panelInfo?.shptmBanrTpNm, showDetailInfo]);
|
||||
|
||||
// patnrId가 19일 때 getBrandLiveChannelInfo API 호출
|
||||
useEffect(() => {
|
||||
if (panelInfo?.patnrId === "19") {
|
||||
dispatch(getBrandLiveChannelInfo({ patnrId: panelInfo.patnrId }));
|
||||
}
|
||||
}, [panelInfo?.patnrId, dispatch]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!panelInfo?.modal && panelInfo?.shptmBanrTpNm === "MEDIA") {
|
||||
dispatch(sendLogGNB(Config.LOG_MENU.FULL));
|
||||
@@ -1213,16 +1226,37 @@ const PlayerPanel = ({
|
||||
panelInfo.shptmBanrTpNm,
|
||||
]);
|
||||
|
||||
// get PlayListInfo
|
||||
// get PlayListInfo for VOD
|
||||
useEffect(() => {
|
||||
if (panelInfo?.shptmBanrTpNm === "VOD") {
|
||||
// patnrId가 19일 때 brandLiveChannelInfo 사용
|
||||
if (panelInfo?.patnrId === "19") {
|
||||
if (
|
||||
brandLiveChannelInfo &&
|
||||
brandLiveChannelInfo.data &&
|
||||
brandLiveChannelInfo.data.brandChanInfo &&
|
||||
Array.isArray(brandLiveChannelInfo.data.brandChanInfo) &&
|
||||
brandLiveChannelInfo.data.brandChanInfo.length > 0
|
||||
) {
|
||||
addPanelInfoToPlayList(brandLiveChannelInfo.data.brandChanInfo);
|
||||
return; // patnrId 19일 때는 여기서 종료
|
||||
}
|
||||
}
|
||||
|
||||
// 일반적인 경우 featuredShowsInfos 사용
|
||||
if (showDetailInfo && showDetailInfo.length > 0) {
|
||||
if (featuredShowsInfos && featuredShowsInfos.length > 0) {
|
||||
addPanelInfoToPlayList(featuredShowsInfos);
|
||||
}
|
||||
}
|
||||
}
|
||||
}, [featuredShowsInfos]);
|
||||
}, [
|
||||
panelInfo?.shptmBanrTpNm,
|
||||
panelInfo?.patnrId,
|
||||
featuredShowsInfos,
|
||||
brandLiveChannelInfo,
|
||||
showDetailInfo,
|
||||
]);
|
||||
|
||||
// get PlayListInfo
|
||||
useEffect(() => {
|
||||
@@ -1904,6 +1938,46 @@ const PlayerPanel = ({
|
||||
e?.preventDefault();
|
||||
return;
|
||||
}
|
||||
|
||||
// LIVE 타입이면서 patnrId가 19일 때 자동재생 처리
|
||||
if (
|
||||
panelInfoRef.current.shptmBanrTpNm === "LIVE" &&
|
||||
panelInfoRef.current.patnrId === "19"
|
||||
) {
|
||||
const currentIndex = selectedIndex;
|
||||
const nextIndex = currentIndex + 1;
|
||||
|
||||
if (
|
||||
playListInfo &&
|
||||
nextIndex < playListInfo.length &&
|
||||
playListInfo[nextIndex]?.showId
|
||||
) {
|
||||
// 다음 비디오가 있으면 자동으로 다음 비디오 재생
|
||||
setSelectedIndex(nextIndex);
|
||||
|
||||
// LIVE 비디오의 경우 startVideoPlayer 호출
|
||||
dispatch(
|
||||
startVideoPlayer({
|
||||
chanId: playListInfo[nextIndex]?.chanId,
|
||||
modal: panelInfoRef.current.modal || false,
|
||||
patnrId: playListInfo[nextIndex]?.patnrId,
|
||||
showId: playListInfo[nextIndex]?.showId,
|
||||
showUrl: playListInfo[nextIndex]?.showUrl,
|
||||
shptmBanrTpNm: "LIVE",
|
||||
})
|
||||
);
|
||||
} else {
|
||||
// 다음 비디오가 없으면 기존 로직 실행
|
||||
Spotlight.pause();
|
||||
setTimeout(() => {
|
||||
Spotlight.resume();
|
||||
dispatch(PanelActions.popPanel(panel_names.PLAYER_PANEL));
|
||||
}, VIDEO_END_ACTION_DELAY);
|
||||
}
|
||||
e?.stopPropagation();
|
||||
e?.preventDefault();
|
||||
return;
|
||||
}
|
||||
},
|
||||
[selectedIndex, playListInfo, dispatch]
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user