featured brand list 있을경우 pinkpong vod 자동재생

This commit is contained in:
opacity@t-win.kr
2025-10-21 17:03:57 +09:00
parent fd638bd736
commit bfc74f713a
3 changed files with 111 additions and 8 deletions

View File

@@ -35,6 +35,7 @@ import {
getMainLiveShow, getMainLiveShow,
getMainLiveShowNowProduct, getMainLiveShowNowProduct,
} from "../../actions/mainActions"; } from "../../actions/mainActions";
import { getBrandLiveChannelInfo } from "../../actions/brandActions";
import * as PanelActions from "../../actions/panelActions"; import * as PanelActions from "../../actions/panelActions";
import { updatePanel } from "../../actions/panelActions"; import { updatePanel } from "../../actions/panelActions";
import { import {
@@ -296,6 +297,11 @@ const PlayerPanel = ({
(state) => state.common.broadcast (state) => state.common.broadcast
); );
const brandLiveChannelInfo = USE_SELECTOR(
"brandLiveChannelInfo",
(state) => state.brand.brandLiveChannelInfoData
);
const lastPanelAction = USE_SELECTOR( const lastPanelAction = USE_SELECTOR(
"lastPanelAction", "lastPanelAction",
(state) => state.panels.lastPanelAction (state) => state.panels.lastPanelAction
@@ -362,6 +368,13 @@ const PlayerPanel = ({
return {}; return {};
}, [panelInfo?.shptmBanrTpNm, showDetailInfo]); }, [panelInfo?.shptmBanrTpNm, showDetailInfo]);
// patnrId가 19일 때 getBrandLiveChannelInfo API 호출
useEffect(() => {
if (panelInfo?.patnrId === "19") {
dispatch(getBrandLiveChannelInfo({ patnrId: panelInfo.patnrId }));
}
}, [panelInfo?.patnrId, dispatch]);
useEffect(() => { useEffect(() => {
if (!panelInfo?.modal && panelInfo?.shptmBanrTpNm === "MEDIA") { if (!panelInfo?.modal && panelInfo?.shptmBanrTpNm === "MEDIA") {
dispatch(sendLogGNB(Config.LOG_MENU.FULL)); dispatch(sendLogGNB(Config.LOG_MENU.FULL));
@@ -1213,16 +1226,37 @@ const PlayerPanel = ({
panelInfo.shptmBanrTpNm, panelInfo.shptmBanrTpNm,
]); ]);
// get PlayListInfo // get PlayListInfo for VOD
useEffect(() => { useEffect(() => {
if (panelInfo?.shptmBanrTpNm === "VOD") { 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 (showDetailInfo && showDetailInfo.length > 0) {
if (featuredShowsInfos && featuredShowsInfos.length > 0) { if (featuredShowsInfos && featuredShowsInfos.length > 0) {
addPanelInfoToPlayList(featuredShowsInfos); addPanelInfoToPlayList(featuredShowsInfos);
} }
} }
} }
}, [featuredShowsInfos]); }, [
panelInfo?.shptmBanrTpNm,
panelInfo?.patnrId,
featuredShowsInfos,
brandLiveChannelInfo,
showDetailInfo,
]);
// get PlayListInfo // get PlayListInfo
useEffect(() => { useEffect(() => {
@@ -1904,6 +1938,46 @@ const PlayerPanel = ({
e?.preventDefault(); e?.preventDefault();
return; 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] [selectedIndex, playListInfo, dispatch]
); );

View File

@@ -130,6 +130,22 @@ export default function TabContainer({
handleItemFocus={_handleItemFocus} handleItemFocus={_handleItemFocus}
/> />
)} )}
{panelInfo?.shptmBanrTpNm === "VOD" &&
panelInfo?.patnrId === "19" &&
tab === 1 && (
<FeaturedShowContents
tabTitle={tabList}
featuredShowsInfos={playListInfo}
currentVideoInfo={playListInfo[selectedIndex]}
setSelectedIndex={setSelectedIndex}
selectedIndex={selectedIndex}
videoVerticalVisible={videoVerticalVisible}
currentVideoShowId={playListInfo[selectedIndex]?.showId}
tabIndex={tab}
panelInfo={panelInfo}
handleItemFocus={_handleItemFocus}
/>
)}
{panelInfo?.shptmBanrTpNm === "VOD" && tab === 1 && ( {panelInfo?.shptmBanrTpNm === "VOD" && tab === 1 && (
<FeaturedShowContents <FeaturedShowContents
tabTitle={tabList} tabTitle={tabList}

View File

@@ -7,7 +7,12 @@ import Spotlight from "@enact/spotlight";
import defaultImage from "../../../../../assets/images/img-thumb-empty-144@3x.png"; import defaultImage from "../../../../../assets/images/img-thumb-empty-144@3x.png";
import { updatePanel } from "../../../../actions/panelActions"; import { updatePanel } from "../../../../actions/panelActions";
import TVirtualGridList from "../../../../components/TVirtualGridList/TVirtualGridList"; import TVirtualGridList from "../../../../components/TVirtualGridList/TVirtualGridList";
import { LOG_CONTEXT_NAME, LOG_MENU, LOG_MESSAGE_ID, panel_names } from "../../../../utils/Config"; import {
LOG_CONTEXT_NAME,
LOG_MENU,
LOG_MESSAGE_ID,
panel_names,
} from "../../../../utils/Config";
import { $L, removeSpecificTags } from "../../../../utils/helperMethods"; import { $L, removeSpecificTags } from "../../../../utils/helperMethods";
import PlayerItemCard, { TYPES } from "../../PlayerItemCard/PlayerItemCard"; import PlayerItemCard, { TYPES } from "../../PlayerItemCard/PlayerItemCard";
import ListEmptyContents from "../TabContents/ListEmptyContents/ListEmptyContents"; import ListEmptyContents from "../TabContents/ListEmptyContents/ListEmptyContents";
@@ -25,7 +30,7 @@ export default function FeaturedShowContents({
tabIndex, tabIndex,
handleItemFocus, handleItemFocus,
tabTitle, tabTitle,
panelInfo panelInfo,
}) { }) {
const dispatch = useDispatch(); const dispatch = useDispatch();
const isClickBlocked = useRef(false); const isClickBlocked = useRef(false);
@@ -42,6 +47,8 @@ export default function FeaturedShowContents({
({ index, ...rest }) => { ({ index, ...rest }) => {
const { const {
thumbnailUrl, thumbnailUrl,
logoImgPath,
thumbnailImgPath,
patncLogoPath, patncLogoPath,
patnrId, patnrId,
showId, showId,
@@ -61,8 +68,8 @@ export default function FeaturedShowContents({
category: catNm, category: catNm,
partner: patncNm, partner: patncNm,
contextName: LOG_CONTEXT_NAME.SHOW, contextName: LOG_CONTEXT_NAME.SHOW,
messageId: LOG_MESSAGE_ID.CONTENTCLICK messageId: LOG_MESSAGE_ID.CONTENTCLICK,
} };
dispatch(sendLogTotalRecommend(params)); dispatch(sendLogTotalRecommend(params));
//중복클릭방지 //중복클릭방지
if (isClickBlocked.current) { if (isClickBlocked.current) {
@@ -97,8 +104,14 @@ export default function FeaturedShowContents({
{...rest} {...rest}
key={prdtId} key={prdtId}
imageAlt={prdtId} imageAlt={prdtId}
logo={patncLogoPath} logo={logoImgPath ? logoImgPath : patncLogoPath}
imageSource={thumbnailUrl ? thumbnailUrl : defaultImage} imageSource={
thumbnailUrl
? thumbnailUrl
: thumbnailImgPath
? thumbnailImgPath
: defaultImage
}
productName={showNameDangerouslySetInnerHTML} productName={showNameDangerouslySetInnerHTML}
patnerName={patncNm} patnerName={patncNm}
onClick={handleItemClick} onClick={handleItemClick}