pb-sxp-ui 1.0.49 → 1.0.51

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.
@@ -57,6 +57,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
57
57
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
58
58
  if (!videoRef)
59
59
  return;
60
+ setIsLoadFinish(true);
60
61
  setIsPauseVideo(false);
61
62
  const item = data[index];
62
63
  if (item && (videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration())) {
@@ -84,13 +85,15 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
84
85
  }, [bffEventReport, data, index, isFirstPlay, videoRef]);
85
86
  const handLoadeddata = useCallback(() => {
86
87
  var _a;
87
- if (!videoRef || isBgColor || firstFrameSrc || !blur)
88
+ if (!videoRef || firstFrameSrc || !blur)
88
89
  return;
89
90
  const videoDomRef = document.getElementById('player-container-id_html5_api');
90
- if (((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || !canvasRef || !videoDomRef || !canvasRef.current)
91
+ if (!videoDomRef)
92
+ return;
93
+ videoDomRef.style.objectFit = 'contain';
94
+ if (((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || !canvasRef || !canvasRef.current || isBgColor)
91
95
  return;
92
96
  const setFrameImg = () => {
93
- videoDomRef.style.objectFit = 'contain';
94
97
  const video = videoDomRef;
95
98
  const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
96
99
  const ctx = canvas.getContext('2d');
@@ -110,7 +113,6 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
110
113
  if (!videoRef)
111
114
  return;
112
115
  handLoadeddata();
113
- setIsLoadFinish(true);
114
116
  }, [videoRef, handLoadeddata]);
115
117
  const handleCanplay = useCallback(() => {
116
118
  setIsLoadFinish(true);
@@ -186,11 +188,9 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
186
188
  if (!dom && !dom2)
187
189
  return;
188
190
  videoPlayerWrapperNode === null || videoPlayerWrapperNode === void 0 ? void 0 : videoPlayerWrapperNode.appendChild(dom || dom2);
189
- videoRef.poster('https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20240218/fsTan2fgYKJWrCpJtGZPogm0NnvdT1708239153661.jpeg');
190
191
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.src(videoSrc);
191
192
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.on('loadedmetadata', handleLoadedmetadata);
192
193
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.on('loadeddata', handLoadeddata);
193
- videoRef === null || videoRef === void 0 ? void 0 : videoRef.on('canplay', handleCanplay);
194
194
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.on('playing', handlePlaying);
195
195
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.on('pause', handlePause);
196
196
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.on('ended', handleEnded);
@@ -198,7 +198,6 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
198
198
  dom2 === null || dom2 === void 0 ? void 0 : dom2.appendChild(dom);
199
199
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.off('loadedmetadata', handleLoadedmetadata);
200
200
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.off('loadeddata', handLoadeddata);
201
- videoRef === null || videoRef === void 0 ? void 0 : videoRef.off('canplay', handleCanplay);
202
201
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.off('playing', handlePlaying);
203
202
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.off('pause', handlePause);
204
203
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.off('ended', handleEnded);
@@ -166,9 +166,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
166
166
  if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
167
167
  minusHeight += 45;
168
168
  }
169
- if (tagList.length > 0) {
170
- minusHeight += 45;
171
- }
172
169
  return containerHeight - minusHeight;
173
170
  }, [globalConfig, containerHeight, tagList]);
174
171
  const renderLogo = useMemo(() => {
@@ -60,6 +60,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
60
60
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
61
61
  if (!videoRef)
62
62
  return;
63
+ setIsLoadFinish(true);
63
64
  setIsPauseVideo(false);
64
65
  const item = data[index];
65
66
  if (item && (videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration())) {
@@ -87,13 +88,15 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
87
88
  }, [bffEventReport, data, index, isFirstPlay, videoRef]);
88
89
  const handLoadeddata = (0, react_1.useCallback)(() => {
89
90
  var _a;
90
- if (!videoRef || isBgColor || firstFrameSrc || !blur)
91
+ if (!videoRef || firstFrameSrc || !blur)
91
92
  return;
92
93
  const videoDomRef = document.getElementById('player-container-id_html5_api');
93
- if (((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || !canvasRef || !videoDomRef || !canvasRef.current)
94
+ if (!videoDomRef)
95
+ return;
96
+ videoDomRef.style.objectFit = 'contain';
97
+ if (((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || !canvasRef || !canvasRef.current || isBgColor)
94
98
  return;
95
99
  const setFrameImg = () => {
96
- videoDomRef.style.objectFit = 'contain';
97
100
  const video = videoDomRef;
98
101
  const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
99
102
  const ctx = canvas.getContext('2d');
@@ -113,7 +116,6 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
113
116
  if (!videoRef)
114
117
  return;
115
118
  handLoadeddata();
116
- setIsLoadFinish(true);
117
119
  }, [videoRef, handLoadeddata]);
118
120
  const handleCanplay = (0, react_1.useCallback)(() => {
119
121
  setIsLoadFinish(true);
@@ -189,11 +191,9 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
189
191
  if (!dom && !dom2)
190
192
  return;
191
193
  videoPlayerWrapperNode === null || videoPlayerWrapperNode === void 0 ? void 0 : videoPlayerWrapperNode.appendChild(dom || dom2);
192
- videoRef.poster('https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20240218/fsTan2fgYKJWrCpJtGZPogm0NnvdT1708239153661.jpeg');
193
194
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.src(videoSrc);
194
195
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.on('loadedmetadata', handleLoadedmetadata);
195
196
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.on('loadeddata', handLoadeddata);
196
- videoRef === null || videoRef === void 0 ? void 0 : videoRef.on('canplay', handleCanplay);
197
197
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.on('playing', handlePlaying);
198
198
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.on('pause', handlePause);
199
199
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.on('ended', handleEnded);
@@ -201,7 +201,6 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
201
201
  dom2 === null || dom2 === void 0 ? void 0 : dom2.appendChild(dom);
202
202
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.off('loadedmetadata', handleLoadedmetadata);
203
203
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.off('loadeddata', handLoadeddata);
204
- videoRef === null || videoRef === void 0 ? void 0 : videoRef.off('canplay', handleCanplay);
205
204
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.off('playing', handlePlaying);
206
205
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.off('pause', handlePause);
207
206
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.off('ended', handleEnded);
@@ -169,9 +169,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
169
169
  if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
170
170
  minusHeight += 45;
171
171
  }
172
- if (tagList.length > 0) {
173
- minusHeight += 45;
174
- }
175
172
  return containerHeight - minusHeight;
176
173
  }, [globalConfig, containerHeight, tagList]);
177
174
  const renderLogo = (0, react_1.useMemo)(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pb-sxp-ui",
3
- "version": "1.0.49",
3
+ "version": "1.0.51",
4
4
  "description": "React enterprise-class UI components",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",