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]
|
||||
);
|
||||
|
||||
@@ -130,6 +130,22 @@ export default function TabContainer({
|
||||
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 && (
|
||||
<FeaturedShowContents
|
||||
tabTitle={tabList}
|
||||
|
||||
@@ -7,7 +7,12 @@ import Spotlight from "@enact/spotlight";
|
||||
import defaultImage from "../../../../../assets/images/img-thumb-empty-144@3x.png";
|
||||
import { updatePanel } from "../../../../actions/panelActions";
|
||||
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 PlayerItemCard, { TYPES } from "../../PlayerItemCard/PlayerItemCard";
|
||||
import ListEmptyContents from "../TabContents/ListEmptyContents/ListEmptyContents";
|
||||
@@ -25,7 +30,7 @@ export default function FeaturedShowContents({
|
||||
tabIndex,
|
||||
handleItemFocus,
|
||||
tabTitle,
|
||||
panelInfo
|
||||
panelInfo,
|
||||
}) {
|
||||
const dispatch = useDispatch();
|
||||
const isClickBlocked = useRef(false);
|
||||
@@ -42,6 +47,8 @@ export default function FeaturedShowContents({
|
||||
({ index, ...rest }) => {
|
||||
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}
|
||||
|
||||
Reference in New Issue
Block a user