diff --git a/com.twin.app.shoptime/src/views/PlayerPanel/PlayerPanel.jsx b/com.twin.app.shoptime/src/views/PlayerPanel/PlayerPanel.jsx index 47612073..c5e09f33 100644 --- a/com.twin.app.shoptime/src/views/PlayerPanel/PlayerPanel.jsx +++ b/com.twin.app.shoptime/src/views/PlayerPanel/PlayerPanel.jsx @@ -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] ); diff --git a/com.twin.app.shoptime/src/views/PlayerPanel/PlayerTabContents/TabContainer.jsx b/com.twin.app.shoptime/src/views/PlayerPanel/PlayerTabContents/TabContainer.jsx index 04beb859..b7a0448f 100644 --- a/com.twin.app.shoptime/src/views/PlayerPanel/PlayerTabContents/TabContainer.jsx +++ b/com.twin.app.shoptime/src/views/PlayerPanel/PlayerTabContents/TabContainer.jsx @@ -130,6 +130,22 @@ export default function TabContainer({ handleItemFocus={_handleItemFocus} /> )} + {panelInfo?.shptmBanrTpNm === "VOD" && + panelInfo?.patnrId === "19" && + tab === 1 && ( + + )} {panelInfo?.shptmBanrTpNm === "VOD" && tab === 1 && ( { const { thumbnailUrl, + logoImgPath, + thumbnailImgPath, patncLogoPath, patnrId, showId, @@ -61,8 +68,8 @@ export default function FeaturedShowContents({ category: catNm, partner: patncNm, contextName: LOG_CONTEXT_NAME.SHOW, - messageId: LOG_MESSAGE_ID.CONTENTCLICK - } + messageId: LOG_MESSAGE_ID.CONTENTCLICK, + }; dispatch(sendLogTotalRecommend(params)); //중복클릭방지 if (isClickBlocked.current) { @@ -97,8 +104,14 @@ export default function FeaturedShowContents({ {...rest} key={prdtId} imageAlt={prdtId} - logo={patncLogoPath} - imageSource={thumbnailUrl ? thumbnailUrl : defaultImage} + logo={logoImgPath ? logoImgPath : patncLogoPath} + imageSource={ + thumbnailUrl + ? thumbnailUrl + : thumbnailImgPath + ? thumbnailImgPath + : defaultImage + } productName={showNameDangerouslySetInnerHTML} patnerName={patncNm} onClick={handleItemClick}