pb-sxp-ui 1.15.22-alpha.2 → 1.15.22-alpha.4

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.
@@ -8,6 +8,7 @@ import { mountVideoPlayerAtNode } from './VideoPlayer';
8
8
  import { useSxpDataSource } from '../../../../core/hooks';
9
9
  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
+ var _a, _b, _c, _d, _e;
11
12
  const [isPauseVideo, setIsPauseVideo] = useState(false);
12
13
  const { bffEventReport, sxpParameter, waterFallData, openHashtag, bffFbReport, isDiyH5 } = useSxpDataSource();
13
14
  const videoStartTime = useRef(0);
@@ -25,6 +26,11 @@ const VideoWidget = forwardRef(({ rec, index, height, data, muted, activeIndex,
25
26
  const isFirstPlayRef = useRef(true);
26
27
  const loopPlayRef = useRef(loopPlay);
27
28
  const scene = rec.video.scene;
29
+ const videoUrl = (scene === null || scene === void 0 ? void 0 : scene.mediaUrl) || ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.url);
30
+ const videoCover = (scene === null || scene === void 0 ? void 0 : scene.mediaUrl) ? scene === null || scene === void 0 ? void 0 : scene.cover : (_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.cover;
31
+ const videoPoster = (scene === null || scene === void 0 ? void 0 : scene.mediaUrl)
32
+ ? (_c = scene === null || scene === void 0 ? void 0 : scene.cover) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image
33
+ : (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.cover) !== null && _e !== void 0 ? _e : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image;
28
34
  useImperativeHandle(ref, () => {
29
35
  return {
30
36
  setLoopPlay(v) {
@@ -45,8 +51,7 @@ const VideoWidget = forwardRef(({ rec, index, height, data, muted, activeIndex,
45
51
  : 'translateY(-50%)';
46
52
  }, [videoPostConfig]);
47
53
  const blurBgSrc = useMemo(() => {
48
- var _a;
49
- return ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || firstFrameSrc;
54
+ return videoCover || firstFrameSrc;
50
55
  }, [firstFrameSrc, rec]);
51
56
  const blurStyle = useMemo(() => {
52
57
  return blur
@@ -81,28 +86,27 @@ const VideoWidget = forwardRef(({ rec, index, height, data, muted, activeIndex,
81
86
  setIsLoadFinish(true);
82
87
  }, []);
83
88
  const handleStartPlay = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
84
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
89
+ var _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
85
90
  if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
86
91
  return;
87
92
  setIsPauseVideo(false);
88
93
  const item = data[index];
89
- if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
90
- videoStartTime.current = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.currentTime) || 0;
91
- const videoDuration = ((_d = (_c = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _c === void 0 ? void 0 : _c.duration) !== null && _d !== void 0 ? _d : 0).toFixed(2);
92
- const videoCurrentTime = ((_f = (_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.currentTime) !== null && _f !== void 0 ? _f : 0).toFixed(2);
94
+ if (item && ((_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.duration)) {
95
+ videoStartTime.current = ((_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.currentTime) || 0;
96
+ const videoDuration = ((_j = (_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.duration) !== null && _j !== void 0 ? _j : 0).toFixed(2);
97
+ const videoCurrentTime = ((_l = (_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.currentTime) !== null && _l !== void 0 ? _l : 0).toFixed(2);
93
98
  const playType = (isFirstPlayRef === null || isFirstPlayRef === void 0 ? void 0 : isFirstPlayRef.current) ? '0' : '1';
94
99
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
95
- eventInfo: Object.assign({ eventSubject: 'playVideo', eventDescription: 'User played the video', 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 : '', 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 : '', playType, startTime: videoCurrentTime, videoDuration, 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 : []), position: index + '', contentFormat: 'video', traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.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) + '' }))
100
+ eventInfo: Object.assign({ eventSubject: 'playVideo', eventDescription: 'User played the video', contentId: (_o = (_m = item === null || item === void 0 ? void 0 : item.video) === null || _m === void 0 ? void 0 : _m.itemId) !== null && _o !== void 0 ? _o : '', contentName: (_q = (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.title) !== null && _q !== void 0 ? _q : '', playType, startTime: videoCurrentTime, videoDuration, contentTags: JSON.stringify((_s = (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.tags) !== null && _s !== void 0 ? _s : []), position: index + '', contentFormat: 'video', traceInfo: (_t = item === null || item === void 0 ? void 0 : item.video) === null || _t === void 0 ? void 0 : _t.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) + '' }))
96
101
  });
97
102
  isFirstPlayRef.current = false;
98
103
  }
99
104
  }), [bffEventReport, data, index, isFirstPlayRef, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
100
105
  const handLoadeddata = useCallback(() => {
101
- var _a;
102
106
  if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || firstFrameSrc || !blur)
103
107
  return;
104
108
  videoRef.current.style.objectFit = 'contain';
105
- if (((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || !canvasRef || !canvasRef.current || isBgColor)
109
+ if (videoCover || !canvasRef || !canvasRef.current || isBgColor)
106
110
  return;
107
111
  const setFrameImg = () => {
108
112
  const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
@@ -169,6 +173,7 @@ const VideoWidget = forwardRef(({ rec, index, height, data, muted, activeIndex,
169
173
  return;
170
174
  if (activeIndex !== index)
171
175
  return;
176
+ setIsPauseVideo(true);
172
177
  const item = data[index];
173
178
  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);
174
179
  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);
@@ -217,7 +222,7 @@ const VideoWidget = forwardRef(({ rec, index, height, data, muted, activeIndex,
217
222
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
218
223
  if (!isActive)
219
224
  return;
220
- const videoSrc = rec === null || rec === void 0 ? void 0 : rec.video.url;
225
+ const videoSrc = videoUrl;
221
226
  if (!videoSrc)
222
227
  return;
223
228
  const videoPlayerWrapperNode = document.querySelector(`#${videoId}`);
@@ -318,7 +323,7 @@ const VideoWidget = forwardRef(({ rec, index, height, data, muted, activeIndex,
318
323
  };
319
324
  }, [handleClickVideo, isActive]);
320
325
  const renderPoster = useMemo(() => {
321
- if (!(sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image) || isLoadFinish) {
326
+ if (!videoPoster || isLoadFinish) {
322
327
  return null;
323
328
  }
324
329
  return (React.createElement("img", { style: {
@@ -328,8 +333,8 @@ const VideoWidget = forwardRef(({ rec, index, height, data, muted, activeIndex,
328
333
  width: '100%',
329
334
  height: '100%',
330
335
  objectFit: 'cover'
331
- }, src: sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image, alt: 'placeholder image' }));
332
- }, [isLoadFinish, sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image]);
336
+ }, src: videoPoster, alt: 'placeholder image' }));
337
+ }, [isLoadFinish]);
333
338
  const renderLoading = useMemo(() => {
334
339
  if (!waiting || !isLoadFinish)
335
340
  return;
@@ -349,8 +354,7 @@ const VideoWidget = forwardRef(({ rec, index, height, data, muted, activeIndex,
349
354
  if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
350
355
  return;
351
356
  const handleBeforeUnload = () => {
352
- var _a;
353
- if (activeIndex === index && ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.url) && (videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) && !isPauseVideo) {
357
+ if (activeIndex === index && videoUrl && (videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) && !isPauseVideo) {
354
358
  handleClickVideo('pause')();
355
359
  }
356
360
  };
@@ -214,7 +214,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
214
214
  }, [minusHeight, containerHeight, tagHeight]);
215
215
  const visList = useMemo(() => {
216
216
  var _a;
217
- const list = activeIndex === 0 && !waterFallData && !isEditor
217
+ const list = activeIndex === 0 && !waterFallData && !isEditor && !isDiyH5
218
218
  ? [(_a = data === null || data === void 0 ? void 0 : data[0]) !== null && _a !== void 0 ? _a : null]
219
219
  : data === null || data === void 0 ? void 0 : data.map((item, index) => {
220
220
  if (activeIndex === index || index - 1 === activeIndex || index + 1 === activeIndex) {
@@ -226,8 +226,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
226
226
  });
227
227
  if (!(list === null || list === void 0 ? void 0 : list.length))
228
228
  return [];
229
- return !waterFallData && !isNoMoreData ? list.concat([{ loading: true }]) : list;
230
- }, [data, activeIndex, waterFallData, isEditor, isNoMoreData]);
229
+ return !waterFallData && !isNoMoreData && !isDiyH5 ? list.concat([{ loading: true }]) : list;
230
+ }, [data, activeIndex, waterFallData, isEditor, isNoMoreData, isDiyH5]);
231
231
  const renderLogo = useMemo(() => {
232
232
  var _a, _b, _c, _d;
233
233
  if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
@@ -10,6 +10,7 @@ const VideoPlayer_1 = require("./VideoPlayer");
10
10
  const hooks_1 = require("../../../../core/hooks");
11
11
  const event_1 = tslib_1.__importStar(require("../../../../core/utils/event"));
12
12
  const VideoWidget = (0, react_1.forwardRef)(({ rec, index, height, data, muted, activeIndex, videoPostConfig, videoPlayIcon, loopPlay, swiperRef }, ref) => {
13
+ var _a, _b, _c, _d, _e;
13
14
  const [isPauseVideo, setIsPauseVideo] = (0, react_1.useState)(false);
14
15
  const { bffEventReport, sxpParameter, waterFallData, openHashtag, bffFbReport, isDiyH5 } = (0, hooks_1.useSxpDataSource)();
15
16
  const videoStartTime = (0, react_1.useRef)(0);
@@ -27,6 +28,11 @@ const VideoWidget = (0, react_1.forwardRef)(({ rec, index, height, data, muted,
27
28
  const isFirstPlayRef = (0, react_1.useRef)(true);
28
29
  const loopPlayRef = (0, react_1.useRef)(loopPlay);
29
30
  const scene = rec.video.scene;
31
+ const videoUrl = (scene === null || scene === void 0 ? void 0 : scene.mediaUrl) || ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.url);
32
+ const videoCover = (scene === null || scene === void 0 ? void 0 : scene.mediaUrl) ? scene === null || scene === void 0 ? void 0 : scene.cover : (_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.cover;
33
+ const videoPoster = (scene === null || scene === void 0 ? void 0 : scene.mediaUrl)
34
+ ? (_c = scene === null || scene === void 0 ? void 0 : scene.cover) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image
35
+ : (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.cover) !== null && _e !== void 0 ? _e : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image;
30
36
  (0, react_1.useImperativeHandle)(ref, () => {
31
37
  return {
32
38
  setLoopPlay(v) {
@@ -47,8 +53,7 @@ const VideoWidget = (0, react_1.forwardRef)(({ rec, index, height, data, muted,
47
53
  : 'translateY(-50%)';
48
54
  }, [videoPostConfig]);
49
55
  const blurBgSrc = (0, react_1.useMemo)(() => {
50
- var _a;
51
- return ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || firstFrameSrc;
56
+ return videoCover || firstFrameSrc;
52
57
  }, [firstFrameSrc, rec]);
53
58
  const blurStyle = (0, react_1.useMemo)(() => {
54
59
  return blur
@@ -83,28 +88,27 @@ const VideoWidget = (0, react_1.forwardRef)(({ rec, index, height, data, muted,
83
88
  setIsLoadFinish(true);
84
89
  }, []);
85
90
  const handleStartPlay = (0, react_1.useCallback)(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
86
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
91
+ var _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
87
92
  if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
88
93
  return;
89
94
  setIsPauseVideo(false);
90
95
  const item = data[index];
91
- if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
92
- videoStartTime.current = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.currentTime) || 0;
93
- const videoDuration = ((_d = (_c = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _c === void 0 ? void 0 : _c.duration) !== null && _d !== void 0 ? _d : 0).toFixed(2);
94
- const videoCurrentTime = ((_f = (_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.currentTime) !== null && _f !== void 0 ? _f : 0).toFixed(2);
96
+ if (item && ((_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.duration)) {
97
+ videoStartTime.current = ((_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.currentTime) || 0;
98
+ const videoDuration = ((_j = (_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.duration) !== null && _j !== void 0 ? _j : 0).toFixed(2);
99
+ const videoCurrentTime = ((_l = (_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.currentTime) !== null && _l !== void 0 ? _l : 0).toFixed(2);
95
100
  const playType = (isFirstPlayRef === null || isFirstPlayRef === void 0 ? void 0 : isFirstPlayRef.current) ? '0' : '1';
96
101
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
97
- eventInfo: Object.assign({ eventSubject: 'playVideo', eventDescription: 'User played the video', 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 : '', 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 : '', playType, startTime: videoCurrentTime, videoDuration, 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 : []), position: index + '', contentFormat: 'video', traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.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) + '' }))
102
+ eventInfo: Object.assign({ eventSubject: 'playVideo', eventDescription: 'User played the video', contentId: (_o = (_m = item === null || item === void 0 ? void 0 : item.video) === null || _m === void 0 ? void 0 : _m.itemId) !== null && _o !== void 0 ? _o : '', contentName: (_q = (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.title) !== null && _q !== void 0 ? _q : '', playType, startTime: videoCurrentTime, videoDuration, contentTags: JSON.stringify((_s = (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.tags) !== null && _s !== void 0 ? _s : []), position: index + '', contentFormat: 'video', traceInfo: (_t = item === null || item === void 0 ? void 0 : item.video) === null || _t === void 0 ? void 0 : _t.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) + '' }))
98
103
  });
99
104
  isFirstPlayRef.current = false;
100
105
  }
101
106
  }), [bffEventReport, data, index, isFirstPlayRef, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
102
107
  const handLoadeddata = (0, react_1.useCallback)(() => {
103
- var _a;
104
108
  if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || firstFrameSrc || !blur)
105
109
  return;
106
110
  videoRef.current.style.objectFit = 'contain';
107
- if (((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || !canvasRef || !canvasRef.current || isBgColor)
111
+ if (videoCover || !canvasRef || !canvasRef.current || isBgColor)
108
112
  return;
109
113
  const setFrameImg = () => {
110
114
  const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
@@ -171,6 +175,7 @@ const VideoWidget = (0, react_1.forwardRef)(({ rec, index, height, data, muted,
171
175
  return;
172
176
  if (activeIndex !== index)
173
177
  return;
178
+ setIsPauseVideo(true);
174
179
  const item = data[index];
175
180
  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);
176
181
  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);
@@ -219,7 +224,7 @@ const VideoWidget = (0, react_1.forwardRef)(({ rec, index, height, data, muted,
219
224
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
220
225
  if (!isActive)
221
226
  return;
222
- const videoSrc = rec === null || rec === void 0 ? void 0 : rec.video.url;
227
+ const videoSrc = videoUrl;
223
228
  if (!videoSrc)
224
229
  return;
225
230
  const videoPlayerWrapperNode = document.querySelector(`#${videoId}`);
@@ -320,7 +325,7 @@ const VideoWidget = (0, react_1.forwardRef)(({ rec, index, height, data, muted,
320
325
  };
321
326
  }, [handleClickVideo, isActive]);
322
327
  const renderPoster = (0, react_1.useMemo)(() => {
323
- if (!(sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image) || isLoadFinish) {
328
+ if (!videoPoster || isLoadFinish) {
324
329
  return null;
325
330
  }
326
331
  return (react_1.default.createElement("img", { style: {
@@ -330,8 +335,8 @@ const VideoWidget = (0, react_1.forwardRef)(({ rec, index, height, data, muted,
330
335
  width: '100%',
331
336
  height: '100%',
332
337
  objectFit: 'cover'
333
- }, src: sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image, alt: 'placeholder image' }));
334
- }, [isLoadFinish, sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image]);
338
+ }, src: videoPoster, alt: 'placeholder image' }));
339
+ }, [isLoadFinish]);
335
340
  const renderLoading = (0, react_1.useMemo)(() => {
336
341
  if (!waiting || !isLoadFinish)
337
342
  return;
@@ -351,8 +356,7 @@ const VideoWidget = (0, react_1.forwardRef)(({ rec, index, height, data, muted,
351
356
  if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
352
357
  return;
353
358
  const handleBeforeUnload = () => {
354
- var _a;
355
- if (activeIndex === index && ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.url) && (videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) && !isPauseVideo) {
359
+ if (activeIndex === index && videoUrl && (videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) && !isPauseVideo) {
356
360
  handleClickVideo('pause')();
357
361
  }
358
362
  };
@@ -217,7 +217,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
217
217
  }, [minusHeight, containerHeight, tagHeight]);
218
218
  const visList = (0, react_1.useMemo)(() => {
219
219
  var _a;
220
- const list = activeIndex === 0 && !waterFallData && !isEditor
220
+ const list = activeIndex === 0 && !waterFallData && !isEditor && !isDiyH5
221
221
  ? [(_a = data === null || data === void 0 ? void 0 : data[0]) !== null && _a !== void 0 ? _a : null]
222
222
  : data === null || data === void 0 ? void 0 : data.map((item, index) => {
223
223
  if (activeIndex === index || index - 1 === activeIndex || index + 1 === activeIndex) {
@@ -229,8 +229,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
229
229
  });
230
230
  if (!(list === null || list === void 0 ? void 0 : list.length))
231
231
  return [];
232
- return !waterFallData && !isNoMoreData ? list.concat([{ loading: true }]) : list;
233
- }, [data, activeIndex, waterFallData, isEditor, isNoMoreData]);
232
+ return !waterFallData && !isNoMoreData && !isDiyH5 ? list.concat([{ loading: true }]) : list;
233
+ }, [data, activeIndex, waterFallData, isEditor, isNoMoreData, isDiyH5]);
234
234
  const renderLogo = (0, react_1.useMemo)(() => {
235
235
  var _a, _b, _c, _d;
236
236
  if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pb-sxp-ui",
3
- "version": "1.15.22-alpha.2",
3
+ "version": "1.15.22-alpha.4",
4
4
  "description": "React enterprise-class UI components",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",