pb-sxp-ui 1.15.22-alpha.1 → 1.15.22-alpha.3

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.
@@ -10,184 +10,6 @@ import PictureGroup from './PictureGroup';
10
10
  import VideoWidget from './VideoWidget';
11
11
  import * as _materials_ from '../../../materials';
12
12
  import '../SxpPageRender/index.less';
13
- const recData = {
14
- position: 0,
15
- isCollected: false,
16
- product: null,
17
- video: {
18
- appId: null,
19
- itemId: 'VIDEOSsRgI1695278974368',
20
- title: '8张尺寸不一样的图片8张尺寸不一样的图片8张尺寸不一样的图片8张尺寸不一样的图片8张尺寸不一样的图片8张尺寸不一样的图片8张尺寸不一样的图片8张尺寸不一样的图片8张尺寸不一样的图片8张尺寸不一样的图片8张尺寸不一样的图片',
21
- enTitle: null,
22
- icon: null,
23
- cover: 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20231017/fsJFWmW1dGyW7XmDspbJPTn5esL3U1697538777398.png',
24
- link: null,
25
- linkTitle: null,
26
- linkType: null,
27
- menuCategoryId: null,
28
- remark: null,
29
- tags: [
30
- 'Gift-Giving',
31
- 'Daily Wear',
32
- 'Business Formal',
33
- 'Sports/Casual',
34
- 'Anniversary Gifts',
35
- 'Wedding/Engagement',
36
- 'Formal Dinner/Party'
37
- ],
38
- traceInfo: ':VIDEO:VIDEOSsRgI1695278974368:regular:1:VPRHSkRS1697701789894:main::0:EXPMW20250305155940:COMBTh20250305160047:',
39
- value: 385,
40
- weight: null,
41
- bindCta: null,
42
- bindProduct: null,
43
- bindProducts: [
44
- {
45
- appId: 'wx448578f8851f3dce',
46
- itemId: 'test02178888',
47
- title: 'christian dior小包包 新CDN',
48
- enTitle: null,
49
- icon: null,
50
- cover: 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20240913/fs2jqiurjftpoaba67iiwr9jt5sc31726213277754.avif',
51
- link: '/pages/details/index?spu_id=1702262707659534338',
52
- linkTitle: '',
53
- linkType: 'MP',
54
- menuCategoryId: null,
55
- remark: null,
56
- tags: [],
57
- traceInfo: ':PRODUCT:test02178888:regular:1:VPRHSkRS1697701789894:main::0:EXPMW20250305155940:COMBTh20250305160047:',
58
- value: null,
59
- weight: null,
60
- bindCta: {
61
- appId: 'wx448578f8851f3dce',
62
- itemId: 'CTA3KofE1716186622249',
63
- title: 'SHOP NOW 立即购买',
64
- enTitle: 'BUY NOW立即购买,选择你所喜爱的;',
65
- icon: 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20240520/fssfxbmiwghixmgblz9uriwennd2r1716186615574.avif',
66
- cover: null,
67
- link: '/pages/details/index?spu_id=1702262707659534338',
68
- linkTitle: '',
69
- linkType: 'MP',
70
- menuCategoryId: '64b60b202caf0e1c1ce1e17d',
71
- remark: null,
72
- tags: [
73
- "Woman's Perfumes",
74
- 'Plates & Bowls',
75
- 'Glasses',
76
- 'Multicolor',
77
- 'Carafes',
78
- 'Tea & Coffee',
79
- 'Green',
80
- 'Grey',
81
- 'Cutlery'
82
- ],
83
- traceInfo: ':CTA:CTA3KofE1716186622249:regular:1:VPRHSkRS1697701789894:main::0:EXPMW20250305155940:COMBTh20250305160047:',
84
- value: null,
85
- weight: null
86
- },
87
- collection: 'Ricco',
88
- currency: 'INR-₹',
89
- homePage: [
90
- 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20240913/fs2jqiurjftpoaba67iiwr9jt5sc31726213277754.avif',
91
- 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20240913/fsr9ttuzuljs85smqi6lsidovnyoy1726213285994.avif',
92
- 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20240913/fsknmfhx2lxukxews05guwwxr8rju1726213281108.avif',
93
- 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20240913/fs0acnua4f1clamdpwdsrh0v5dgc61726213289247.avif'
94
- ],
95
- info: 'test',
96
- price: 53200,
97
- shippingInfo: null,
98
- taxInfo: null
99
- },
100
- {
101
- appId: null,
102
- itemId: '113J631A0684_C520',
103
- title: 'Sweatshirt à capuche Dior Oblique, coupe relax',
104
- enTitle: null,
105
- icon: null,
106
- cover: 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20241115/fsaf0xq8vx8gkkl30y1h1swpinmbt1731661943891.avif',
107
- link: 'https://www.dior.com/fr_fr/fashion/products/113J631A0684_C520',
108
- linkTitle: null,
109
- linkType: 'WEB',
110
- menuCategoryId: null,
111
- remark: null,
112
- tags: [],
113
- traceInfo: ':PRODUCT:113J631A0684_C520:regular:1:VPRHSkRS1697701789894:main::0:EXPMW20250305155940:COMBTh20250305160047:',
114
- value: null,
115
- weight: null,
116
- bindCta: {
117
- appId: null,
118
- itemId: 'CTAAfaKf1730796437032',
119
- title: 'test',
120
- enTitle: 'test',
121
- icon: 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20241105/fsjblxoud2tmehpiqqomh0oktwqrd1730796431496.avif',
122
- cover: null,
123
- link: null,
124
- linkTitle: null,
125
- linkType: null,
126
- menuCategoryId: '64b60b202caf0e1c1ce1e17d',
127
- remark: '',
128
- tags: [],
129
- traceInfo: ':CTA:CTAAfaKf1730796437032:regular:1:VPRHSkRS1697701789894:main::0:EXPMW20250305155940:COMBTh20250305160047:',
130
- value: null,
131
- weight: null
132
- },
133
- collection: 'Jacquard de coton éponge bleu',
134
- currency: 'EUR-€',
135
- homePage: [
136
- 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20241115/fsaf0xq8vx8gkkl30y1h1swpinmbt1731661943891.avif',
137
- 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20241115/fszxkdcjfjql2oiy90ffbal5tsfd81731661964913.avif',
138
- 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20241115/fs1jhd9jwxvfqmrbjwy5abfzb0fde1731661994996.avif'
139
- ],
140
- info: "Le sweatshirt à capuche bleu met à l'honneur l'emblématique motif dior oblique. Confectionné en jacquard de coton éponge bleu, il présente une coupe relax très confortable. Doté de poches latérales fendues, ce sweatshirt à capuche s'associera à tous vos jeans ou pantalons de survêtement pour un look décontracté.. Sweatshirt à capuche dior oblique, coupe relax Jacquard de coton éponge bleu",
141
- price: 1800,
142
- shippingInfo: null,
143
- taxInfo: null
144
- },
145
- {
146
- appId: null,
147
- itemId: 'S5573CRIW_M928',
148
- title: 'Mini Dior Book Tote',
149
- enTitle: null,
150
- icon: null,
151
- cover: 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20250213/fsvewk9etrawxrzznmvvewgt1bctu1739415576729.avif',
152
- link: 'https://www.dior.com/en_gb/fashion/products/S5573CRIW_M928',
153
- linkTitle: null,
154
- linkType: 'WEB',
155
- menuCategoryId: null,
156
- remark: null,
157
- tags: ['ダイヤモンド'],
158
- traceInfo: ':PRODUCT:S5573CRIW_M928:regular:1:VPRHSkRS1697701789894:main::0:EXPMW20250305155940:COMBTh20250305160047:',
159
- value: null,
160
- weight: null,
161
- bindCta: null,
162
- collection: null,
163
- currency: 'GBP-£',
164
- homePage: [
165
- 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20250213/fsvewk9etrawxrzznmvvewgt1bctu1739415576729.avif',
166
- 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20250213/fsngtlvhid7xwt5if0viw7vqanm831739415582147.avif',
167
- 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20250213/fs4hotdvyzjtnqb9vszlynuzplddc1739415586910.avif',
168
- 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20250213/fswffx9kwexf3z3vcnxisut1qxtez1739415591629.avif',
169
- 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20250213/fsbfsi7tttx1hnzldoiw7eoea7fvh1739415597388.avif'
170
- ],
171
- info: "The Dior Book Tote is a House classic and original design by Maria Grazia Chiuri, Creative Director of Christian Dior. The style is fully embroidered with the House's hallmark blue Dior Oblique motif and showcases the Christian Dior Paris signature. Exemplifying House savoir-faire, the miniature style features an adjustable and removable strap that allows it to be carried by hand, worn over the shoulder or crossbody.",
172
- price: 1950,
173
- shippingInfo: null,
174
- taxInfo: null
175
- }
176
- ],
177
- url: null,
178
- blockCta: 1,
179
- blockProduct: 1,
180
- hashTags: [
181
- 'Sports/Casual',
182
- 'Formal Dinner/Party',
183
- 'Business Formal',
184
- 'Wedding/Engagement',
185
- 'Gift-Giving',
186
- 'Daily Wear',
187
- 'Anniversary Gifts'
188
- ]
189
- }
190
- };
191
13
  const RESOLVER = {};
192
14
  Object.values(_materials_).forEach((v) => {
193
15
  RESOLVER[v.extend.type] = v;
@@ -1,7 +1,6 @@
1
1
  import React, { memo, useMemo, useState } from 'react';
2
2
  import SxpPageRender from '../SxpPageRender';
3
3
  import Popup from '../SxpPageRender/Popup';
4
- import DiyStoryPreview from '../DiyStoryPreview';
5
4
  import * as _materials_ from '../../../materials';
6
5
  import { EditorCore } from '../../../core';
7
6
  import SxpDataSourceProvider from '../../../core/context/SxpDataSourceProvider';
@@ -21,9 +20,9 @@ const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, l
21
20
  const [channel, setChannel] = useState();
22
21
  return (React.createElement(EditorCore, { resolver: RESOLVER, enableDataSource: false, schema: _schema, utmVal: channel || utmVal },
23
22
  React.createElement(SxpDataSourceProvider, { utmVal: utmVal, dataSources: data === null || data === void 0 ? void 0 : data.data_sources, sxpParameter: data === null || data === void 0 ? void 0 : data.sxp_parameter, maxSize: (_c = (_b = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _b === void 0 ? void 0 : _b.personalized_recommend) !== null && _c !== void 0 ? _c : maxSize, defaultSize: (_e = (_d = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _d === void 0 ? void 0 : _d.default_recommend) !== null && _e !== void 0 ? _e : defaultSize, hashTagSize: (_g = (_f = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _f === void 0 ? void 0 : _f.hash_tag_size) !== null && _g !== void 0 ? _g : hashTagSize, loadingImage: loadingImage, appDomain: appDomain, enabledMetaConversionApi: enabledMetaConversionApi, utmParameter: data === null || data === void 0 ? void 0 : data.utm_parameter, data: data, dataList: dataList, isDiyH5: isDiyH5, onUpdateSchema: (d) => setSchema(d), onUpdateChannel: (d) => setChannel(d), render: ({ rtcList, tagList, pageData }) => {
24
- var _a, _b;
23
+ var _a;
25
24
  return (React.createElement(React.Fragment, null,
26
- isDiyH5 ? (React.createElement(DiyStoryPreview, Object.assign({ defaultData: data }, (_a = pageData === null || pageData === void 0 ? void 0 : pageData.data) === null || _a === void 0 ? void 0 : _a.sxpPageConf, { tagList: tagList, data: rtcList, resolver: RESOLVER, containerHeight: window === null || window === void 0 ? void 0 : window.innerHeight, pointerEvents: 'all', loopPlay: true }))) : (React.createElement(SxpPageRender, Object.assign({ defaultData: data }, (_b = pageData === null || pageData === void 0 ? void 0 : pageData.data) === null || _b === void 0 ? void 0 : _b.sxpPageConf, { tagList: tagList, data: rtcList, resolver: RESOLVER }))),
25
+ React.createElement(SxpPageRender, Object.assign({ defaultData: data }, (_a = pageData === null || pageData === void 0 ? void 0 : pageData.data) === null || _a === void 0 ? void 0 : _a.sxpPageConf, { tagList: tagList, data: rtcList, resolver: RESOLVER })),
27
26
  React.createElement(Popup, null)));
28
27
  } })));
29
28
  };
@@ -10,6 +10,11 @@ interface IVideoWidgetProps {
10
10
  activeIndex?: number;
11
11
  videoPostConfig?: postConfigType;
12
12
  videoPlayIcon?: string;
13
+ loopPlay: any;
14
+ swiperRef?: any;
13
15
  }
14
- declare const _default: React.NamedExoticComponent<IVideoWidgetProps>;
16
+ export interface IVideoWidgetRef {
17
+ setLoopPlay: (v: boolean) => void;
18
+ }
19
+ declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<IVideoWidgetProps & React.RefAttributes<IVideoWidgetRef>>>;
15
20
  export default _default;
@@ -1,15 +1,15 @@
1
1
  import { __awaiter } from "tslib";
2
- import React, { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
2
+ import React, { forwardRef, memo, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
3
3
  import { useSwiperSlide } from 'swiper/react';
4
4
  import { useIconLink } from '../useIconLink';
5
5
  import FormatImage from '../FormatImage';
6
- import { useSxpDataSource } from '../../../../core/hooks';
7
- import SXP_EVENT_BUS, { SXP_EVENT_TYPE } from '../../../../core/utils/event';
8
6
  import loading_gif from './loading.gif';
9
7
  import { mountVideoPlayerAtNode } from './VideoPlayer';
10
- const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, videoPlayIcon }) => {
8
+ import { useSxpDataSource } from '../../../../core/hooks';
9
+ import SXP_EVENT_BUS, { SXP_EVENT_TYPE } from '../../../../core/utils/event';
10
+ const VideoWidget = forwardRef(({ rec, index, height, data, muted, activeIndex, videoPostConfig, videoPlayIcon, loopPlay, swiperRef }, ref) => {
11
11
  const [isPauseVideo, setIsPauseVideo] = useState(false);
12
- const { bffEventReport, sxpParameter, waterFallData, openHashtag, bffFbReport } = useSxpDataSource();
12
+ const { bffEventReport, sxpParameter, waterFallData, openHashtag, bffFbReport, isDiyH5 } = useSxpDataSource();
13
13
  const videoStartTime = useRef(0);
14
14
  const [isLoadFinish, setIsLoadFinish] = useState(false);
15
15
  const { isActive } = useSwiperSlide();
@@ -23,6 +23,18 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
23
23
  const initTimeRef = useRef();
24
24
  const loadedTimeRef = useRef();
25
25
  const isFirstPlayRef = useRef(true);
26
+ const loopPlayRef = useRef(loopPlay);
27
+ const scene = rec.video.scene;
28
+ useImperativeHandle(ref, () => {
29
+ return {
30
+ setLoopPlay(v) {
31
+ loopPlayRef.current = v;
32
+ }
33
+ };
34
+ });
35
+ useEffect(() => {
36
+ loopPlayRef.current = loopPlay;
37
+ }, [loopPlay]);
26
38
  const blur = useMemo(() => {
27
39
  return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2';
28
40
  }, [videoPostConfig]);
@@ -110,12 +122,15 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
110
122
  const handleLoadedmetadata = useCallback(() => {
111
123
  if (!videoRef.current)
112
124
  return;
125
+ if (isDiyH5) {
126
+ videoRef.current.currentTime = scene === null || scene === void 0 ? void 0 : scene.startTime;
127
+ }
113
128
  loadedTimeRef.current = new Date();
114
129
  handleStartPlay();
115
130
  handLoadeddata();
116
131
  }, [videoRef.current, handLoadeddata, handleStartPlay]);
117
132
  const handleClickVideo = useCallback((type) => () => {
118
- var _a, _b, _c, _d, _e;
133
+ var _a, _b, _c, _d, _e, _f;
119
134
  if (!videoRef.current)
120
135
  return;
121
136
  if (!isLoadFinish)
@@ -136,10 +151,13 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
136
151
  break;
137
152
  default:
138
153
  if (isPause) {
139
- (_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.play();
154
+ 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)) {
155
+ videoRef.current.currentTime = scene === null || scene === void 0 ? void 0 : scene.startTime;
156
+ }
157
+ (_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.play();
140
158
  }
141
159
  else {
142
- (_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.pause();
160
+ (_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.pause();
143
161
  }
144
162
  setIsPauseVideo(!isPause);
145
163
  break;
@@ -151,6 +169,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
151
169
  return;
152
170
  if (activeIndex !== index)
153
171
  return;
172
+ setIsPauseVideo(true);
154
173
  const item = data[index];
155
174
  const videoDuration = ((_b = (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
156
175
  const videoCurrentTime = ((_d = (_c = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
@@ -176,8 +195,27 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
176
195
  const handleWaiting = useCallback(() => {
177
196
  setWaiting(true);
178
197
  }, []);
198
+ const handleTimeUpload = () => {
199
+ if (!videoRef.current || !isDiyH5)
200
+ return;
201
+ setTimeout(() => {
202
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
203
+ 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)) {
204
+ (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
205
+ if (!loopPlayRef.current)
206
+ return;
207
+ if (index === (data === null || data === void 0 ? void 0 : data.length) - 1) {
208
+ (_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);
209
+ }
210
+ else {
211
+ 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;
212
+ (_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);
213
+ }
214
+ }
215
+ });
216
+ };
179
217
  useEffect(() => {
180
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
218
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
181
219
  if (!isActive)
182
220
  return;
183
221
  const videoSrc = rec === null || rec === void 0 ? void 0 : rec.video.url;
@@ -198,6 +236,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
198
236
  hls === null || hls === void 0 ? void 0 : hls.attachMedia(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current);
199
237
  hls === null || hls === void 0 ? void 0 : hls.on(Hls.Events.MANIFEST_PARSED, function () {
200
238
  var _a;
239
+ videoRef.current.currentTime = scene === null || scene === void 0 ? void 0 : scene.startTime;
201
240
  (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
202
241
  });
203
242
  }
@@ -214,8 +253,9 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
214
253
  (_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.addEventListener('ended', handlePlay);
215
254
  (_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.addEventListener('canplay', handlePlay);
216
255
  (_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.addEventListener('waiting', handleWaiting);
256
+ (_l = videoRef.current) === null || _l === void 0 ? void 0 : _l.addEventListener('timeupdate', handleTimeUpload);
217
257
  return () => {
218
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
258
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
219
259
  const isPause = (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
220
260
  if (!isPause)
221
261
  handlePause();
@@ -230,6 +270,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
230
270
  (_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('ended', handlePlay);
231
271
  (_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.removeEventListener('canplay', handlePlay);
232
272
  (_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.removeEventListener('waiting', handleWaiting);
273
+ (_l = videoRef.current) === null || _l === void 0 ? void 0 : _l.removeEventListener('timeupdate', handleTimeUpload);
233
274
  };
234
275
  }, [isActive]);
235
276
  useEffect(() => {
@@ -278,7 +319,8 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
278
319
  };
279
320
  }, [handleClickVideo, isActive]);
280
321
  const renderPoster = useMemo(() => {
281
- if (!(sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image) || isLoadFinish) {
322
+ var _a, _b;
323
+ if ((!((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) && !(sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image)) || isLoadFinish) {
282
324
  return null;
283
325
  }
284
326
  return (React.createElement("img", { style: {
@@ -288,8 +330,8 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
288
330
  width: '100%',
289
331
  height: '100%',
290
332
  objectFit: 'cover'
291
- }, src: sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image, alt: 'placeholder image' }));
292
- }, [isLoadFinish, sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image]);
333
+ }, src: ((_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.cover) || (sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image), alt: 'placeholder image' }));
334
+ }, [rec, isLoadFinish, sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image]);
293
335
  const renderLoading = useMemo(() => {
294
336
  if (!waiting || !isLoadFinish)
295
337
  return;
@@ -347,6 +389,6 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
347
389
  React.createElement("div", { className: 'n-full-screen', ref: videoEleRef, id: videoId, style: { width: '100%', height: '100%' } }),
348
390
  renderPoster,
349
391
  renderLoading,
350
- isPauseVideo && React.createElement(FormatImage, { className: 'clc-pb-video-pause', src: videoPlayIcon !== null && videoPlayIcon !== void 0 ? videoPlayIcon : PAUSE_ICON, alt: 'pause' })))));
351
- };
392
+ isPauseVideo && (React.createElement(FormatImage, { className: 'clc-pb-video-pause', src: videoPlayIcon !== null && videoPlayIcon !== void 0 ? videoPlayIcon : PAUSE_ICON, alt: 'pause' }))))));
393
+ });
352
394
  export default memo(VideoWidget);
@@ -41,7 +41,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
41
41
  const [isReload, setIsReload] = useState(new Date().getTime());
42
42
  const skipLinkRef = useRef(false);
43
43
  const [pageNum, setPageNum] = useState(2);
44
- const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData, bffFbReport, curTime, h5EnterLink, isShowConsent, selectTag, isPreview, isEditor, cacheRtcList, setRtcList, cacheActiveIndex, rtcList, isNoMoreData, channel, refreshFeSession } = useSxpDataSource();
44
+ const videoWidgetRef = useRef(null);
45
+ const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData, bffFbReport, curTime, h5EnterLink, isShowConsent, selectTag, isPreview, isEditor, cacheRtcList, setRtcList, cacheActiveIndex, rtcList, isNoMoreData, channel, refreshFeSession, isDiyH5 } = useSxpDataSource();
45
46
  const { backMainFeed, productView, jumpToWeb } = useEventReport();
46
47
  const isShowFingerTip = useMemo(() => {
47
48
  return data.length > 0 && !loading && (getFeUserState() || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enableSwiperTip));
@@ -176,6 +177,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
176
177
  refreshFeSession
177
178
  ]);
178
179
  const handleSessionExpire = useCallback(debounce(() => {
180
+ var _a;
181
+ (_a = videoWidgetRef.current) === null || _a === void 0 ? void 0 : _a.setLoopPlay(false);
179
182
  refreshFeSession === null || refreshFeSession === void 0 ? void 0 : refreshFeSession(false, handleSessionCompleted);
180
183
  }, 1000), [handleSessionCompleted, refreshFeSession]);
181
184
  useEffect(() => {
@@ -211,7 +214,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
211
214
  }, [minusHeight, containerHeight, tagHeight]);
212
215
  const visList = useMemo(() => {
213
216
  var _a;
214
- const list = activeIndex === 0 && !waterFallData && !isEditor
217
+ const list = activeIndex === 0 && !waterFallData && !isEditor && !isDiyH5
215
218
  ? [(_a = data === null || data === void 0 ? void 0 : data[0]) !== null && _a !== void 0 ? _a : null]
216
219
  : data === null || data === void 0 ? void 0 : data.map((item, index) => {
217
220
  if (activeIndex === index || index - 1 === activeIndex || index + 1 === activeIndex) {
@@ -223,8 +226,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
223
226
  });
224
227
  if (!(list === null || list === void 0 ? void 0 : list.length))
225
228
  return [];
226
- return !waterFallData && !isNoMoreData ? list.concat([{ loading: true }]) : list;
227
- }, [data, activeIndex, waterFallData, isEditor, isNoMoreData]);
229
+ return !waterFallData && !isNoMoreData && !isDiyH5 ? list.concat([{ loading: true }]) : list;
230
+ }, [data, activeIndex, waterFallData, isEditor, isNoMoreData, isDiyH5]);
228
231
  const renderLogo = useMemo(() => {
229
232
  var _a, _b, _c, _d;
230
233
  if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
@@ -250,7 +253,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
250
253
  return (React.createElement(MultiPosts, Object.assign({ recData: data === null || data === void 0 ? void 0 : data[1] }, (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props, (_f = (_e = (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.item) === null || _f === void 0 ? void 0 : _f.event)));
251
254
  }
252
255
  if ((_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.url) {
253
- return (React.createElement(VideoWidget, { key: isReload, rec: rec, index: index, muted: isMuted, data: data, height: height, activeIndex: activeIndex, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost, videoPlayIcon: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPlayIcon }));
256
+ return (React.createElement(VideoWidget, Object.assign({ key: isReload }, (activeIndex === index && { ref: videoWidgetRef }), { rec: rec, index: index, muted: isMuted, data: data, height: height, activeIndex: activeIndex, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost, videoPlayIcon: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPlayIcon, loopPlay: true, swiperRef: swiperRef })));
254
257
  }
255
258
  if ((_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.imgUrls) {
256
259
  return (React.createElement(PictureGroup, { key: rec === null || rec === void 0 ? void 0 : rec.video.itemId, imgUrls: rec === null || rec === void 0 ? void 0 : rec.video.imgUrls, width: containerWidth, height: height, rec: rec, index: index, onViewImageEndEvent: handleViewImageStartEnd, onViewImageStartEvent: handleViewImageStartEvent, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost }));
@@ -594,7 +597,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
594
597
  if (openHashtag)
595
598
  return;
596
599
  handleScrollEvent(swiper);
597
- if (waterFallData || isEditor)
600
+ if (waterFallData || isEditor || isDiyH5)
598
601
  return;
599
602
  if ((swiper === null || swiper === void 0 ? void 0 : swiper.activeIndex) + 1 >= (data === null || data === void 0 ? void 0 : data.length)) {
600
603
  if (!isLoadMore) {
@@ -92,6 +92,7 @@ export interface ISxpDataSourceContext {
92
92
  refreshFeSession?: (enableReSid?: boolean, event?: (fk: string) => void) => void;
93
93
  getAccount?: () => Promise<any>;
94
94
  accountSonsent?: (v: boolean) => Promise<boolean>;
95
+ isDiyH5?: boolean;
95
96
  }
96
97
  export declare const SxpDataSourceContext: React.Context<ISxpDataSourceContext>;
97
98
  export interface SxpDataSourceProviderProps {
@@ -625,7 +625,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
625
625
  multiPostTimeRef,
626
626
  refreshFeSession,
627
627
  getAccount,
628
- accountSonsent
628
+ accountSonsent,
629
+ isDiyH5
629
630
  } }, isShowConsent ? (React.createElement(Consent, Object.assign({}, (_e = (_d = (_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.consent) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.item) === null || _e === void 0 ? void 0 : _e.props))) : (render({
630
631
  rtcList,
631
632
  mutateLike: bffMutateLike,