pb-sxp-ui 1.18.0 → 1.18.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +322 -394
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +15 -7
- package/dist/index.js +322 -394
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +6 -6
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +6 -6
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +322 -394
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +6 -6
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/DiyPortalPreview/VideoWidget.js +8 -10
- package/es/core/components/DiyPortalPreview/index.js +5 -3
- package/es/core/components/DiyStoryPreview/index.js +7 -18
- package/es/core/components/SxpPageRender/LikeButton/index.js +16 -18
- package/es/core/components/SxpPageRender/PictureGroup/index.d.ts +0 -5
- package/es/core/components/SxpPageRender/PictureGroup/index.js +13 -39
- package/es/core/components/SxpPageRender/RenderCard.d.ts +0 -1
- package/es/core/components/SxpPageRender/RenderCard.js +14 -2
- package/es/core/components/SxpPageRender/VideoWidget/index.js +45 -32
- package/es/core/components/SxpPageRender/WaterFall/index.js +3 -4
- package/es/core/components/SxpPageRender/index.js +41 -57
- package/es/core/context/SxpDataSourceProvider.d.ts +12 -5
- package/es/core/context/SxpDataSourceProvider.js +35 -62
- package/es/core/hooks/useEventReport.js +5 -6
- package/es/materials/sxp/consentPopup/Display/index.js +1 -1
- package/es/materials/sxp/cta/AniLinkPopup/material.js +2 -3
- package/es/materials/sxp/popup/CommodityDetail/material.js +1 -2
- package/es/materials/sxp/popup/CommodityList/index.js +4 -5
- package/es/materials/sxp/popup/CommodityList/material.js +1 -1
- package/es/materials/sxp/popup/CommodityList/settingRender.js +1 -1
- package/es/materials/sxp/template/Appoint/material.js +1 -2
- package/es/materials/sxp/template/Commodity/material.js +2 -3
- package/es/materials/sxp/template/CommodityDiro/material.js +2 -3
- package/es/materials/sxp/template/CommodityDiroNew/material.js +2 -4
- package/es/materials/sxp/template/Link/material.js +2 -4
- package/es/materials/sxp/template/MultiCommodity/index.js +2 -2
- package/es/materials/sxp/template/MultiCommodity/material.js +1 -2
- package/es/materials/sxp/template/MultiCommodityDiro/index.js +2 -2
- package/es/materials/sxp/template/MultiCommodityDiro/material.js +2 -3
- package/es/materials/sxp/template/MultiCommodityDiroNew/index.js +2 -2
- package/es/materials/sxp/template/MultiCommodityDiroNew/material.js +2 -4
- package/es/materials/sxp/template/NineCommodity/material.js +2 -3
- package/es/materials/sxp/template/components/CommodityGroup.js +1 -1
- package/es/materials/sxp/template/components/settingRender.js +1 -1
- package/lib/core/components/DiyPortalPreview/VideoWidget.js +8 -10
- package/lib/core/components/DiyPortalPreview/index.js +5 -3
- package/lib/core/components/DiyStoryPreview/index.js +7 -18
- package/lib/core/components/SxpPageRender/LikeButton/index.js +16 -18
- package/lib/core/components/SxpPageRender/PictureGroup/index.d.ts +0 -5
- package/lib/core/components/SxpPageRender/PictureGroup/index.js +12 -38
- package/lib/core/components/SxpPageRender/RenderCard.d.ts +0 -1
- package/lib/core/components/SxpPageRender/RenderCard.js +14 -2
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +45 -32
- package/lib/core/components/SxpPageRender/WaterFall/index.js +3 -4
- package/lib/core/components/SxpPageRender/index.js +41 -57
- package/lib/core/context/SxpDataSourceProvider.d.ts +12 -5
- package/lib/core/context/SxpDataSourceProvider.js +35 -62
- package/lib/core/hooks/useEventReport.js +5 -6
- package/lib/materials/sxp/consentPopup/Display/index.js +1 -1
- package/lib/materials/sxp/cta/AniLinkPopup/material.js +1 -2
- package/lib/materials/sxp/popup/CommodityDetail/material.js +1 -2
- package/lib/materials/sxp/popup/CommodityList/index.js +4 -5
- package/lib/materials/sxp/popup/CommodityList/material.js +1 -1
- package/lib/materials/sxp/popup/CommodityList/settingRender.js +1 -1
- package/lib/materials/sxp/template/Appoint/material.js +1 -2
- package/lib/materials/sxp/template/Commodity/material.js +2 -3
- package/lib/materials/sxp/template/CommodityDiro/material.js +2 -3
- package/lib/materials/sxp/template/CommodityDiroNew/material.js +2 -4
- package/lib/materials/sxp/template/Link/material.js +2 -4
- package/lib/materials/sxp/template/MultiCommodity/index.js +2 -2
- package/lib/materials/sxp/template/MultiCommodity/material.js +1 -2
- package/lib/materials/sxp/template/MultiCommodityDiro/index.js +2 -2
- package/lib/materials/sxp/template/MultiCommodityDiro/material.js +2 -3
- package/lib/materials/sxp/template/MultiCommodityDiroNew/index.js +2 -2
- package/lib/materials/sxp/template/MultiCommodityDiroNew/material.js +2 -4
- package/lib/materials/sxp/template/NineCommodity/material.js +2 -3
- package/lib/materials/sxp/template/components/CommodityGroup.js +1 -1
- package/lib/materials/sxp/template/components/settingRender.js +1 -1
- package/package.json +1 -1
@@ -22,7 +22,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
22
22
|
}, []);
|
23
23
|
const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
24
24
|
const handlePlaying = useCallback(() => {
|
25
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o
|
25
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
26
26
|
setIsPauseVideo(false);
|
27
27
|
const item = data[index];
|
28
28
|
if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
|
@@ -35,15 +35,14 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
35
35
|
eventSubject: 'playVideo',
|
36
36
|
eventDescription: 'User played the video',
|
37
37
|
contentId: (_h = (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
|
38
|
-
|
39
|
-
contentName: (_o = (_m = item === null || item === void 0 ? void 0 : item.video) === null || _m === void 0 ? void 0 : _m.title) !== null && _o !== void 0 ? _o : '',
|
38
|
+
contentName: (_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
|
40
39
|
playType,
|
41
40
|
startTime: videoCurrentTime,
|
42
41
|
videoDuration,
|
43
|
-
contentTags: JSON.stringify((
|
42
|
+
contentTags: JSON.stringify((_m = (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
|
44
43
|
position: index + '',
|
45
44
|
contentFormat: 'video',
|
46
|
-
traceInfo: (
|
45
|
+
traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
47
46
|
}
|
48
47
|
});
|
49
48
|
setIsFirstPlay(false);
|
@@ -82,7 +81,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
82
81
|
}
|
83
82
|
}, [isLoadFinish]);
|
84
83
|
const onPause = useCallback(() => {
|
85
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o
|
84
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
86
85
|
const item = data[index];
|
87
86
|
const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
88
87
|
const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
@@ -93,15 +92,14 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
93
92
|
eventSubject: 'playOverVideo',
|
94
93
|
eventDescription: 'User finished playing the video',
|
95
94
|
contentId: (_h = (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
|
96
|
-
|
97
|
-
contentName: (_o = (_m = item === null || item === void 0 ? void 0 : item.video) === null || _m === void 0 ? void 0 : _m.title) !== null && _o !== void 0 ? _o : '',
|
95
|
+
contentName: (_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
|
98
96
|
endTime: videoCurrentTime,
|
99
97
|
videoDuration,
|
100
98
|
playDuration,
|
101
|
-
contentTags: JSON.stringify((
|
99
|
+
contentTags: JSON.stringify((_m = (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
|
102
100
|
position: index + '',
|
103
101
|
contentFormat: 'video',
|
104
|
-
traceInfo: (
|
102
|
+
traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
105
103
|
}
|
106
104
|
});
|
107
105
|
}
|
@@ -59,7 +59,7 @@ const DiyPortalPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, de
|
|
59
59
|
const CTA = (rec, index) => {
|
60
60
|
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA)) {
|
61
61
|
return (React.createElement("div", { className: 'clc-sxp-bottom-card' },
|
62
|
-
React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER })));
|
62
|
+
React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER, isActive: true })));
|
63
63
|
}
|
64
64
|
return null;
|
65
65
|
};
|
@@ -72,8 +72,10 @@ const DiyPortalPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, de
|
|
72
72
|
React.createElement(Nudge, { nudge: nudge }),
|
73
73
|
CTA(rec, index),
|
74
74
|
React.createElement("div", null,
|
75
|
-
React.createElement(ExpandableText, { className: 'clc-sxp-bottom-text', isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (_c = (_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.title) !== null && _c !== void 0 ? _c : '', style: Object.assign(Object.assign({}, descStyle), { textShadow: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isOpenTextShadow) ? '2px 2px 4px rgba(0, 0, 0, 0.5)' : 'none' }) })
|
76
|
-
|
75
|
+
React.createElement(ExpandableText, { className: 'clc-sxp-bottom-text', isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (_c = (_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.title) !== null && _c !== void 0 ? _c : '', style: Object.assign(Object.assign({}, descStyle), { textShadow: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isOpenTextShadow) ? '2px 2px 4px rgba(0, 0, 0, 0.5)' : 'none' }) }),
|
76
|
+
React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER, includesCtaType: ['AniLink'], isActive: true })),
|
77
|
+
React.createElement(Hashtag, { index: index, tags: (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.hashTags) !== null && _e !== void 0 ? _e : [], itemId: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.itemId, itemType: ((_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.itemId) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle })),
|
78
|
+
React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER, includesCtaType: ['AniLinkPopup'], isActive: true })));
|
77
79
|
}
|
78
80
|
return null;
|
79
81
|
};
|
@@ -81,21 +81,10 @@ const DiyStoryPreview = forwardRef(({ data = [], globalConfig, tipText, nudge, t
|
|
81
81
|
return null;
|
82
82
|
}, [globalConfig]);
|
83
83
|
const renderBottom = (rec, index) => {
|
84
|
-
var _a, _b, _c, _d
|
84
|
+
var _a, _b, _c, _d;
|
85
85
|
if (rec === null || rec === void 0 ? void 0 : rec.video) {
|
86
|
-
let cta = null;
|
87
|
-
if ((_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) {
|
88
|
-
cta = '多商品CTA';
|
89
|
-
}
|
90
|
-
else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
|
91
|
-
cta = '商品CTA';
|
92
|
-
}
|
93
|
-
else {
|
94
|
-
cta = (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.bindCta) === null || _e === void 0 ? void 0 : _e.itemId;
|
95
|
-
}
|
96
|
-
const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
|
97
86
|
return (React.createElement(React.Fragment, null,
|
98
|
-
((
|
87
|
+
((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.title) && (React.createElement("div", { style: {
|
99
88
|
background: 'repeating-linear-gradient(0deg, rgba(26, 26, 25, 0.7), hsla(0, 0%, 100%, 0))',
|
100
89
|
height: '130px',
|
101
90
|
position: 'absolute',
|
@@ -106,7 +95,7 @@ const DiyStoryPreview = forwardRef(({ data = [], globalConfig, tipText, nudge, t
|
|
106
95
|
pointerEvents
|
107
96
|
} })),
|
108
97
|
React.createElement("div", { style: {
|
109
|
-
marginBottom: `${(
|
98
|
+
marginBottom: `${(_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.bottomInfoDist) !== null && _b !== void 0 ? _b : 40}px`,
|
110
99
|
zIndex: 999,
|
111
100
|
position: 'absolute',
|
112
101
|
bottom: 0,
|
@@ -115,11 +104,11 @@ const DiyStoryPreview = forwardRef(({ data = [], globalConfig, tipText, nudge, t
|
|
115
104
|
paddingTop: '20px'
|
116
105
|
} },
|
117
106
|
(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) ? (React.createElement("div", { style: {} },
|
118
|
-
React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER, isActive: index === activeIndex
|
107
|
+
React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER, isActive: index === activeIndex }))) : null,
|
119
108
|
React.createElement("div", null,
|
120
|
-
React.createElement(ExpandableText, { isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (
|
121
|
-
React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER, includesCtaType: ['AniLink'], isActive: index === activeIndex
|
122
|
-
React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex
|
109
|
+
React.createElement(ExpandableText, { isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.title) !== null && _d !== void 0 ? _d : '', style: Object.assign(Object.assign({}, descStyle), { textShadow: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isOpenTextShadow) ? '2px 2px 4px rgba(0, 0, 0, 0.5)' : 'none', padding: '0 20px', fontSize: '12px' }) }),
|
110
|
+
React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER, includesCtaType: ['AniLink'], isActive: index === activeIndex }))),
|
111
|
+
React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex })));
|
123
112
|
}
|
124
113
|
return null;
|
125
114
|
};
|
@@ -13,62 +13,60 @@ const LikeButton = (_a) => {
|
|
13
13
|
const likeIcon = useIconLink(defaultLikeIconPath);
|
14
14
|
const unlikeIcon = useIconLink(defaultUnLikeIconPath);
|
15
15
|
const handleClick = debounce(() => __awaiter(void 0, void 0, void 0, function* () {
|
16
|
-
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z
|
16
|
+
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
17
17
|
if (state) {
|
18
18
|
setState(false);
|
19
|
-
const result = (_e = (yield (mutateUnlike === null || mutateUnlike === void 0 ? void 0 : mutateUnlike({
|
19
|
+
const result = (_e = (yield (mutateUnlike === null || mutateUnlike === void 0 ? void 0 : mutateUnlike({ videoItemId: (_d = (_c = recData === null || recData === void 0 ? void 0 : recData.video) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '' })))) !== null && _e !== void 0 ? _e : false;
|
20
20
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
21
21
|
eventInfo: {
|
22
22
|
eventSubject: 'favoriteContentCanceled',
|
23
23
|
eventDescription: 'This content was unfavorite by the user',
|
24
24
|
contentId: (_g = (_f = recData === null || recData === void 0 ? void 0 : recData.video) === null || _f === void 0 ? void 0 : _f.itemId) !== null && _g !== void 0 ? _g : '',
|
25
|
-
|
26
|
-
|
27
|
-
contentTags: JSON.stringify((_p = (_o = recData === null || recData === void 0 ? void 0 : recData.video) === null || _o === void 0 ? void 0 : _o.tags) !== null && _p !== void 0 ? _p : []),
|
25
|
+
contentName: (_j = (_h = recData === null || recData === void 0 ? void 0 : recData.video) === null || _h === void 0 ? void 0 : _h.title) !== null && _j !== void 0 ? _j : '',
|
26
|
+
contentTags: JSON.stringify((_l = (_k = recData === null || recData === void 0 ? void 0 : recData.video) === null || _k === void 0 ? void 0 : _k.tags) !== null && _l !== void 0 ? _l : []),
|
28
27
|
position: position + '',
|
29
|
-
contentFormat: ((
|
30
|
-
traceInfo: (
|
28
|
+
contentFormat: ((_m = recData === null || recData === void 0 ? void 0 : recData.video) === null || _m === void 0 ? void 0 : _m.url) ? 'video' : 'image',
|
29
|
+
traceInfo: (_o = recData === null || recData === void 0 ? void 0 : recData.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
31
30
|
}
|
32
31
|
});
|
33
32
|
if (!result) {
|
34
33
|
setState(true);
|
35
34
|
}
|
36
35
|
else {
|
37
|
-
const nRtcList = (
|
36
|
+
const nRtcList = (_p = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
|
38
37
|
if (index === position) {
|
39
38
|
item.isCollected = false;
|
40
39
|
}
|
41
40
|
return item;
|
42
|
-
})) !== null &&
|
41
|
+
})) !== null && _p !== void 0 ? _p : [];
|
43
42
|
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
|
44
43
|
}
|
45
44
|
}
|
46
45
|
else {
|
47
46
|
setState(true);
|
48
|
-
const result = (
|
47
|
+
const result = (_q = (yield (mutateLike === null || mutateLike === void 0 ? void 0 : mutateLike({ content: JSON.stringify(recData) })))) !== null && _q !== void 0 ? _q : false;
|
49
48
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
50
49
|
eventInfo: {
|
51
50
|
eventSubject: 'favoriteContent',
|
52
51
|
eventDescription: 'This content was favorite by the user',
|
53
|
-
contentId: (
|
54
|
-
|
55
|
-
|
56
|
-
contentTags: JSON.stringify((_4 = (_3 = recData === null || recData === void 0 ? void 0 : recData.video) === null || _3 === void 0 ? void 0 : _3.tags) !== null && _4 !== void 0 ? _4 : []),
|
52
|
+
contentId: (_s = (_r = recData === null || recData === void 0 ? void 0 : recData.video) === null || _r === void 0 ? void 0 : _r.itemId) !== null && _s !== void 0 ? _s : '',
|
53
|
+
contentName: (_u = (_t = recData === null || recData === void 0 ? void 0 : recData.video) === null || _t === void 0 ? void 0 : _t.title) !== null && _u !== void 0 ? _u : '',
|
54
|
+
contentTags: JSON.stringify((_w = (_v = recData === null || recData === void 0 ? void 0 : recData.video) === null || _v === void 0 ? void 0 : _v.tags) !== null && _w !== void 0 ? _w : []),
|
57
55
|
position: position + '',
|
58
|
-
contentFormat: ((
|
59
|
-
traceInfo: (
|
56
|
+
contentFormat: ((_x = recData === null || recData === void 0 ? void 0 : recData.video) === null || _x === void 0 ? void 0 : _x.url) ? 'video' : 'image',
|
57
|
+
traceInfo: (_y = recData === null || recData === void 0 ? void 0 : recData.video) === null || _y === void 0 ? void 0 : _y.traceInfo
|
60
58
|
}
|
61
59
|
});
|
62
60
|
if (!result) {
|
63
61
|
setState(false);
|
64
62
|
}
|
65
63
|
else {
|
66
|
-
const nRtcList = (
|
64
|
+
const nRtcList = (_z = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
|
67
65
|
if (index === position) {
|
68
66
|
item.isCollected = true;
|
69
67
|
}
|
70
68
|
return item;
|
71
|
-
})) !== null &&
|
69
|
+
})) !== null && _z !== void 0 ? _z : [];
|
72
70
|
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
|
73
71
|
}
|
74
72
|
}
|
@@ -12,11 +12,6 @@ interface IPictureGroupProps {
|
|
12
12
|
loadTime: string;
|
13
13
|
}, enableCapi?: boolean) => void;
|
14
14
|
imgUrlsPostConfig?: postConfigType;
|
15
|
-
data: RecItemType[];
|
16
|
-
swiperRef?: any;
|
17
|
-
}
|
18
|
-
export interface IPictureGroupRef {
|
19
|
-
setLoopPlay: (v: boolean) => void;
|
20
15
|
}
|
21
16
|
declare const _default: React.NamedExoticComponent<IPictureGroupProps>;
|
22
17
|
export default _default;
|
@@ -1,51 +1,25 @@
|
|
1
1
|
import { __awaiter } from "tslib";
|
2
|
-
import React, {
|
2
|
+
import React, { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
3
3
|
import { Autoplay, Pagination, Navigation, A11y, Mousewheel, Keyboard } from 'swiper/modules';
|
4
4
|
import { Swiper, SwiperSlide, useSwiperSlide } from 'swiper/react';
|
5
|
-
import { css } from '@emotion/css';
|
6
5
|
import Picture from './Picture';
|
7
6
|
import { useSxpDataSource } from '../../../../core/hooks';
|
7
|
+
import { css } from '@emotion/css';
|
8
8
|
import SXP_EVENT_BUS, { SXP_EVENT_TYPE } from '../../../../core/utils/event';
|
9
9
|
import { getScreenReader } from '../../../../core/utils/tool';
|
10
|
-
const PictureGroup =
|
10
|
+
const PictureGroup = ({ imgUrls, width, height, rec, index, onViewImageEndEvent, onViewImageStartEvent, imgUrlsPostConfig }) => {
|
11
11
|
var _a, _b;
|
12
12
|
const { isActive } = useSwiperSlide();
|
13
|
-
const {
|
13
|
+
const { sxpParameter, openHashtag } = useSxpDataSource();
|
14
14
|
const [isLoad, setIsLoad] = useState(false);
|
15
15
|
const [imgInfo, setImgInfo] = useState();
|
16
16
|
const [swiperActiveIndex, setSwiperActiveIndex] = useState(0);
|
17
|
-
const
|
17
|
+
const swiperRef = useRef();
|
18
18
|
const isFirstPlayRef = useRef(true);
|
19
|
-
const loopPlayRef = useRef(true);
|
20
19
|
const initTime = new Date();
|
21
|
-
useImperativeHandle(ref, () => {
|
22
|
-
return {
|
23
|
-
setLoopPlay(v) {
|
24
|
-
loopPlayRef.current = v;
|
25
|
-
}
|
26
|
-
};
|
27
|
-
});
|
28
|
-
useEffect(() => {
|
29
|
-
let timerId;
|
30
|
-
if (isLoad && isActive && isDiyH5) {
|
31
|
-
timerId = setTimeout(() => {
|
32
|
-
var _a, _b, _c, _d;
|
33
|
-
if (!loopPlayRef.current)
|
34
|
-
return;
|
35
|
-
if (firstRtcList && index < (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) - 1) {
|
36
|
-
const i = (_b = (_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper) === null || _b === void 0 ? void 0 : _b.activeIndex;
|
37
|
-
(_d = (_c = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _c === void 0 ? void 0 : _c.swiper) === null || _d === void 0 ? void 0 : _d.slideTo(i + 1);
|
38
|
-
}
|
39
|
-
}, 3000);
|
40
|
-
}
|
41
|
-
return () => {
|
42
|
-
if (timerId)
|
43
|
-
clearTimeout(timerId);
|
44
|
-
};
|
45
|
-
}, [isLoad, isActive, isDiyH5, index, swiperRef, firstRtcList]);
|
46
20
|
useEffect(() => {
|
47
21
|
if (isLoad && isActive) {
|
48
|
-
(
|
22
|
+
(swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) && swiperRef.current.swiper.autoplay.start();
|
49
23
|
if (openHashtag) {
|
50
24
|
onViewImageEndEvent(rec);
|
51
25
|
}
|
@@ -55,7 +29,7 @@ const PictureGroup = forwardRef(({ imgUrls, data, height, rec, index, onViewImag
|
|
55
29
|
}
|
56
30
|
}
|
57
31
|
else {
|
58
|
-
(
|
32
|
+
(swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) && swiperRef.current.swiper.autoplay.stop();
|
59
33
|
}
|
60
34
|
}, [rec, isActive, onViewImageEndEvent, openHashtag, index, onViewImageStartEvent, isLoad, imgInfo]);
|
61
35
|
const showFirstImageFn = useCallback((e) => __awaiter(void 0, void 0, void 0, function* () {
|
@@ -79,13 +53,13 @@ const PictureGroup = forwardRef(({ imgUrls, data, height, rec, index, onViewImag
|
|
79
53
|
};
|
80
54
|
}, [isActive, imgInfo]);
|
81
55
|
const handleMouseEnter = useCallback(() => {
|
82
|
-
if (
|
83
|
-
|
56
|
+
if (swiperRef.current && swiperRef.current.swiper && isAlly) {
|
57
|
+
swiperRef.current.swiper.autoplay.stop();
|
84
58
|
}
|
85
59
|
}, []);
|
86
60
|
const handleMouseLeave = useCallback(() => {
|
87
|
-
if (
|
88
|
-
|
61
|
+
if (swiperRef.current && swiperRef.current.swiper && isAlly) {
|
62
|
+
swiperRef.current.swiper.autoplay.start();
|
89
63
|
}
|
90
64
|
}, []);
|
91
65
|
const handleSlideChange = useCallback((swiper) => {
|
@@ -106,7 +80,7 @@ const PictureGroup = forwardRef(({ imgUrls, data, height, rec, index, onViewImag
|
|
106
80
|
enabled: true
|
107
81
|
}
|
108
82
|
}
|
109
|
-
: {}), { loop: true, ref:
|
83
|
+
: {}), { loop: true, ref: swiperRef, onSlideChange: handleSlideChange, className: css(Object.assign(Object.assign({ '.swiper-pagination': {
|
110
84
|
bottom: (_a = imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.marginBottom) !== null && _a !== void 0 ? _a : 0,
|
111
85
|
fontSize: '14px'
|
112
86
|
} }, ((imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.dotsBgColor) && {
|
@@ -123,5 +97,5 @@ const PictureGroup = forwardRef(({ imgUrls, data, height, rec, index, onViewImag
|
|
123
97
|
return (React.createElement(SwiperSlide, { key: srcKey, "aria-hidden": srcKey !== swiperActiveIndex },
|
124
98
|
React.createElement(Picture, { src: !isLoad && srcKey > 0 ? '' : url, height: height, imgUrlsPostConfig: imgUrlsPostConfig, onShowFirstImage: showFirstImageFn })));
|
125
99
|
}))));
|
126
|
-
}
|
100
|
+
};
|
127
101
|
export default memo(PictureGroup);
|
@@ -3,10 +3,22 @@ import './index.less';
|
|
3
3
|
import { cloneDeep } from 'lodash';
|
4
4
|
import withBindDataSource from '../../../core/hoc/withBindDataSource';
|
5
5
|
import { useEditor } from '../../../core/hooks';
|
6
|
-
const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType, isActive,
|
6
|
+
const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType, isActive, isNineProduct }) => {
|
7
|
+
var _a, _b, _c, _d, _e;
|
7
8
|
const { schema } = useEditor();
|
8
9
|
if (!(rec === null || rec === void 0 ? void 0 : rec.video))
|
9
10
|
return null;
|
11
|
+
let cta = null;
|
12
|
+
if ((_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) {
|
13
|
+
cta = '多商品CTA';
|
14
|
+
}
|
15
|
+
else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
|
16
|
+
cta = '商品CTA';
|
17
|
+
}
|
18
|
+
else {
|
19
|
+
cta = (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.bindCta) === null || _e === void 0 ? void 0 : _e.itemId;
|
20
|
+
}
|
21
|
+
const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
|
10
22
|
const renderComp = useMemo(() => {
|
11
23
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3;
|
12
24
|
if (includesCtaType && !(includesCtaType === null || includesCtaType === void 0 ? void 0 : includesCtaType.includes((_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type)))
|
@@ -31,7 +43,7 @@ const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType, isActive,
|
|
31
43
|
const sbf = style.backdropFilter;
|
32
44
|
style.backdropFilter = `blur(${sbf !== null && sbf !== void 0 ? sbf : 0}px)`;
|
33
45
|
}
|
34
|
-
return (React.createElement(Component, Object.assign({ style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), style), { zIndex: 50,
|
46
|
+
return (React.createElement(Component, Object.assign({ style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), style), { zIndex: 50, marginInlineStart: '20px', boxSizing: 'border-box', transform: 'translate3d(0px, 0px, 0px)' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_z = value === null || value === void 0 ? void 0 : value.item) === null || _z === void 0 ? void 0 : _z.textStyle), bindDatas: (_1 = (_0 = value === null || value === void 0 ? void 0 : value.item) === null || _0 === void 0 ? void 0 : _0.bindDatas) !== null && _1 !== void 0 ? _1 : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_2 = value === null || value === void 0 ? void 0 : value.item) === null || _2 === void 0 ? void 0 : _2.props, { event: ((_3 = value === null || value === void 0 ? void 0 : value.item) === null || _3 === void 0 ? void 0 : _3.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, key: value === null || value === void 0 ? void 0 : value.id, recData: rec, isExternalLink: isExternalLink, index: index, isActive: isActive })));
|
35
47
|
}
|
36
48
|
else {
|
37
49
|
return null;
|
@@ -10,7 +10,7 @@ import SXP_EVENT_BUS, { SXP_EVENT_TYPE } from '../../../../core/utils/event';
|
|
10
10
|
const VideoWidget = forwardRef(({ rec, index, height, data, muted, activeIndex, videoPostConfig, videoPlayIcon, loopPlay, swiperRef }, ref) => {
|
11
11
|
var _a, _b;
|
12
12
|
const [isPauseVideo, setIsPauseVideo] = useState(false);
|
13
|
-
const { bffEventReport, sxpParameter,
|
13
|
+
const { bffEventReport, sxpParameter, waterFallData, openHashtag, bffFbReport, isDiyH5 } = useSxpDataSource();
|
14
14
|
const videoStartTime = useRef(0);
|
15
15
|
const [isLoadFinish, setIsLoadFinish] = useState(false);
|
16
16
|
const { isActive } = useSwiperSlide();
|
@@ -76,23 +76,6 @@ const VideoWidget = forwardRef(({ rec, index, height, data, muted, activeIndex,
|
|
76
76
|
return;
|
77
77
|
(_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
78
78
|
}, [videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
79
|
-
const handleEnd = () => {
|
80
|
-
var _a, _b, _c, _d, _e, _f;
|
81
|
-
if (!videoRef.current)
|
82
|
-
return;
|
83
|
-
if (isDiyH5) {
|
84
|
-
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.pause();
|
85
|
-
if (!loopPlayRef.current)
|
86
|
-
return;
|
87
|
-
if (firstRtcList && index < (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) - 1) {
|
88
|
-
const i = (_c = (_b = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _b === void 0 ? void 0 : _b.swiper) === null || _c === void 0 ? void 0 : _c.activeIndex;
|
89
|
-
(_e = (_d = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _d === void 0 ? void 0 : _d.swiper) === null || _e === void 0 ? void 0 : _e.slideTo(i + 1);
|
90
|
-
}
|
91
|
-
}
|
92
|
-
else {
|
93
|
-
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.play();
|
94
|
-
}
|
95
|
-
};
|
96
79
|
const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
97
80
|
const handlePlaying = useCallback(() => {
|
98
81
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
@@ -101,7 +84,7 @@ const VideoWidget = forwardRef(({ rec, index, height, data, muted, activeIndex,
|
|
101
84
|
setIsLoadFinish(true);
|
102
85
|
}, []);
|
103
86
|
const handleStartPlay = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
104
|
-
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q
|
87
|
+
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
105
88
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
106
89
|
return;
|
107
90
|
setIsPauseVideo(false);
|
@@ -112,11 +95,16 @@ const VideoWidget = forwardRef(({ rec, index, height, data, muted, activeIndex,
|
|
112
95
|
const videoCurrentTime = ((_h = (_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.currentTime) !== null && _h !== void 0 ? _h : 0).toFixed(2);
|
113
96
|
const playType = (isFirstPlayRef === null || isFirstPlayRef === void 0 ? void 0 : isFirstPlayRef.current) ? '0' : '1';
|
114
97
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
115
|
-
eventInfo: Object.assign({ eventSubject: 'playVideo', eventDescription: 'User played the video', contentId: (_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.itemId) !== null && _k !== void 0 ? _k : '',
|
98
|
+
eventInfo: Object.assign({ eventSubject: 'playVideo', eventDescription: 'User played the video', contentId: (_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.itemId) !== null && _k !== void 0 ? _k : '', contentName: (_m = (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.title) !== null && _m !== void 0 ? _m : '', playType, startTime: videoCurrentTime, videoDuration, contentTags: JSON.stringify((_p = (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.tags) !== null && _p !== void 0 ? _p : []), position: index + '', contentFormat: 'video', traceInfo: (_q = item === null || item === void 0 ? void 0 : item.video) === null || _q === void 0 ? void 0 : _q.traceInfo }, ((isFirstPlayRef === null || isFirstPlayRef === void 0 ? void 0 : isFirstPlayRef.current) && { loadTime: (loadedTimeRef === null || loadedTimeRef === void 0 ? void 0 : loadedTimeRef.current) - (initTimeRef === null || initTimeRef === void 0 ? void 0 : initTimeRef.current) + '' }))
|
116
99
|
});
|
117
100
|
isFirstPlayRef.current = false;
|
118
101
|
}
|
119
102
|
}), [bffEventReport, data, index, isFirstPlayRef, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
103
|
+
const setCurrentTimeByStartTime = useCallback(() => {
|
104
|
+
if (isDiyH5) {
|
105
|
+
videoRef.current.currentTime = scene === null || scene === void 0 ? void 0 : scene.startTime;
|
106
|
+
}
|
107
|
+
}, []);
|
120
108
|
const handLoadeddata = useCallback(() => {
|
121
109
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || firstFrameSrc || !blur)
|
122
110
|
return;
|
@@ -141,12 +129,13 @@ const VideoWidget = forwardRef(({ rec, index, height, data, muted, activeIndex,
|
|
141
129
|
const handleLoadedmetadata = useCallback(() => {
|
142
130
|
if (!videoRef.current)
|
143
131
|
return;
|
132
|
+
setCurrentTimeByStartTime();
|
144
133
|
loadedTimeRef.current = new Date();
|
145
134
|
handleStartPlay();
|
146
135
|
handLoadeddata();
|
147
136
|
}, [videoRef.current, handLoadeddata, handleStartPlay]);
|
148
137
|
const handleClickVideo = useCallback((type) => () => {
|
149
|
-
var _a, _b, _c, _d, _e;
|
138
|
+
var _a, _b, _c, _d, _e, _f;
|
150
139
|
if (!videoRef.current)
|
151
140
|
return;
|
152
141
|
if (!isLoadFinish)
|
@@ -167,17 +156,20 @@ const VideoWidget = forwardRef(({ rec, index, height, data, muted, activeIndex,
|
|
167
156
|
break;
|
168
157
|
default:
|
169
158
|
if (isPause) {
|
170
|
-
(_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.
|
159
|
+
if (isDiyH5 && Math.round((_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.currentTime) >= (scene === null || scene === void 0 ? void 0 : scene.endTime)) {
|
160
|
+
videoRef.current.currentTime = scene === null || scene === void 0 ? void 0 : scene.startTime;
|
161
|
+
}
|
162
|
+
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.play();
|
171
163
|
}
|
172
164
|
else {
|
173
|
-
(
|
165
|
+
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.pause();
|
174
166
|
}
|
175
167
|
setIsPauseVideo(!isPause);
|
176
168
|
break;
|
177
169
|
}
|
178
170
|
}, [isLoadFinish, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
179
171
|
const handlePause = useCallback(() => {
|
180
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o
|
172
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
181
173
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
182
174
|
return;
|
183
175
|
if (activeIndex !== index)
|
@@ -193,15 +185,14 @@ const VideoWidget = forwardRef(({ rec, index, height, data, muted, activeIndex,
|
|
193
185
|
eventSubject: 'playOverVideo',
|
194
186
|
eventDescription: 'User finished playing the video',
|
195
187
|
contentId: (_h = (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
|
196
|
-
|
197
|
-
contentName: (_o = (_m = item === null || item === void 0 ? void 0 : item.video) === null || _m === void 0 ? void 0 : _m.title) !== null && _o !== void 0 ? _o : '',
|
188
|
+
contentName: (_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
|
198
189
|
endTime: videoCurrentTime,
|
199
190
|
videoDuration,
|
200
191
|
playDuration,
|
201
|
-
contentTags: JSON.stringify((
|
192
|
+
contentTags: JSON.stringify((_m = (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
|
202
193
|
position: index + '',
|
203
194
|
contentFormat: 'video',
|
204
|
-
traceInfo: (
|
195
|
+
traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
205
196
|
}
|
206
197
|
});
|
207
198
|
}
|
@@ -209,8 +200,27 @@ const VideoWidget = forwardRef(({ rec, index, height, data, muted, activeIndex,
|
|
209
200
|
const handleWaiting = useCallback(() => {
|
210
201
|
setWaiting(true);
|
211
202
|
}, []);
|
203
|
+
const handleTimeUpload = () => {
|
204
|
+
if (!videoRef.current || !isDiyH5)
|
205
|
+
return;
|
206
|
+
setTimeout(() => {
|
207
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
208
|
+
if (Math.round((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.currentTime) >= ((_b = scene === null || scene === void 0 ? void 0 : scene.endTime) !== null && _b !== void 0 ? _b : 0)) {
|
209
|
+
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
|
210
|
+
if (!loopPlayRef.current)
|
211
|
+
return;
|
212
|
+
if (index === (data === null || data === void 0 ? void 0 : data.length) - 1) {
|
213
|
+
(_e = (_d = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _d === void 0 ? void 0 : _d.swiper) === null || _e === void 0 ? void 0 : _e.slideTo(0);
|
214
|
+
}
|
215
|
+
else {
|
216
|
+
const i = (_g = (_f = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _f === void 0 ? void 0 : _f.swiper) === null || _g === void 0 ? void 0 : _g.activeIndex;
|
217
|
+
(_j = (_h = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _h === void 0 ? void 0 : _h.swiper) === null || _j === void 0 ? void 0 : _j.slideTo(i + 1);
|
218
|
+
}
|
219
|
+
}
|
220
|
+
});
|
221
|
+
};
|
212
222
|
useEffect(() => {
|
213
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
223
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
214
224
|
if (!isActive)
|
215
225
|
return;
|
216
226
|
const videoSrc = videoUrl;
|
@@ -231,6 +241,7 @@ const VideoWidget = forwardRef(({ rec, index, height, data, muted, activeIndex,
|
|
231
241
|
hls === null || hls === void 0 ? void 0 : hls.attachMedia(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current);
|
232
242
|
hls === null || hls === void 0 ? void 0 : hls.on(Hls.Events.MANIFEST_PARSED, function () {
|
233
243
|
var _a;
|
244
|
+
setCurrentTimeByStartTime();
|
234
245
|
(_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
235
246
|
});
|
236
247
|
}
|
@@ -244,11 +255,12 @@ const VideoWidget = forwardRef(({ rec, index, height, data, muted, activeIndex,
|
|
244
255
|
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.addEventListener('play', handleStartPlay);
|
245
256
|
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.addEventListener('playing', handlePlaying);
|
246
257
|
(_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.addEventListener('pause', handlePause);
|
247
|
-
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.addEventListener('ended',
|
258
|
+
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.addEventListener('ended', handlePlay);
|
248
259
|
(_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.addEventListener('canplay', handlePlay);
|
249
260
|
(_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.addEventListener('waiting', handleWaiting);
|
261
|
+
(_l = videoRef.current) === null || _l === void 0 ? void 0 : _l.addEventListener('timeupdate', handleTimeUpload);
|
250
262
|
return () => {
|
251
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
263
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
252
264
|
const isPause = (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
|
253
265
|
if (!isPause)
|
254
266
|
handlePause();
|
@@ -260,9 +272,10 @@ const VideoWidget = forwardRef(({ rec, index, height, data, muted, activeIndex,
|
|
260
272
|
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.removeEventListener('play', handleStartPlay);
|
261
273
|
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.removeEventListener('playing', handlePlaying);
|
262
274
|
(_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.removeEventListener('pause', handlePause);
|
263
|
-
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('ended',
|
275
|
+
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('ended', handlePlay);
|
264
276
|
(_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.removeEventListener('canplay', handlePlay);
|
265
277
|
(_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.removeEventListener('waiting', handleWaiting);
|
278
|
+
(_l = videoRef.current) === null || _l === void 0 ? void 0 : _l.removeEventListener('timeupdate', handleTimeUpload);
|
266
279
|
};
|
267
280
|
}, [isActive]);
|
268
281
|
useEffect(() => {
|
@@ -41,7 +41,7 @@ const WaterFall = (props) => {
|
|
41
41
|
}
|
42
42
|
}, [waterFallData]);
|
43
43
|
const reportTagsView = useCallback(() => {
|
44
|
-
var _a, _b, _c, _d, _e, _f
|
44
|
+
var _a, _b, _c, _d, _e, _f;
|
45
45
|
const rec = recData === null || recData === void 0 ? void 0 : recData.rec;
|
46
46
|
if (!rec)
|
47
47
|
return;
|
@@ -61,10 +61,9 @@ const WaterFall = (props) => {
|
|
61
61
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
62
62
|
eventInfo: {
|
63
63
|
contentId: (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
64
|
-
sceneId: (_g = (_f = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.scene) === null || _f === void 0 ? void 0 : _f.sceneId) !== null && _g !== void 0 ? _g : '',
|
65
64
|
position: cacheActiveIndex + '',
|
66
|
-
contentTags: JSON.stringify((
|
67
|
-
traceInfo: (
|
65
|
+
contentTags: JSON.stringify((_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.tags),
|
66
|
+
traceInfo: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.traceInfo,
|
68
67
|
hashTags: JSON.stringify([recData === null || recData === void 0 ? void 0 : recData.hashTag]),
|
69
68
|
fromKName,
|
70
69
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|