pb-sxp-ui 1.0.93 → 1.0.95

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 CHANGED
@@ -12917,11 +12917,15 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
12917
12917
  }, [videoRef]);
12918
12918
  const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
12919
12919
  const handlePlaying = React.useCallback(() => {
12920
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
12921
12920
  if (!videoRef)
12922
12921
  return;
12923
12922
  setWaiting(false);
12924
12923
  setIsLoadFinish(true);
12924
+ }, []);
12925
+ const handleStartPlay = React.useCallback(() => {
12926
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
12927
+ if (!videoRef)
12928
+ return;
12925
12929
  setIsPauseVideo(false);
12926
12930
  const item = data[index];
12927
12931
  if (item && (videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration)) {
@@ -12972,8 +12976,9 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
12972
12976
  const handleLoadedmetadata = React.useCallback(() => {
12973
12977
  if (!videoRef)
12974
12978
  return;
12979
+ handleStartPlay();
12975
12980
  handLoadeddata();
12976
- }, [videoRef, handLoadeddata]);
12981
+ }, [videoRef, handLoadeddata, handleStartPlay]);
12977
12982
  const handleClickVideo = React.useCallback((type) => () => {
12978
12983
  if (!videoRef)
12979
12984
  return;
@@ -13063,6 +13068,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
13063
13068
  videoRef.setAttribute('webkit-playsinline', 'true');
13064
13069
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('loadedmetadata', handleLoadedmetadata);
13065
13070
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('loadeddata', handLoadeddata);
13071
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('play', handleStartPlay);
13066
13072
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('playing', handlePlaying);
13067
13073
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('pause', handlePause);
13068
13074
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('ended', handlePlay);
@@ -13073,9 +13079,11 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
13073
13079
  dom2 === null || dom2 === void 0 ? void 0 : dom2.appendChild(dom);
13074
13080
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('loadedmetadata', handleLoadedmetadata);
13075
13081
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('loadeddata', handLoadeddata);
13082
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('play', handleStartPlay);
13076
13083
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('playing', handlePlaying);
13077
13084
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('pause', handlePause);
13078
13085
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('ended', handlePlay);
13086
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('canplay', handlePlay);
13079
13087
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('waiting', handleWaiting);
13080
13088
  };
13081
13089
  }, [isActive, videoId, rec, videoRef]);
@@ -13127,7 +13135,14 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
13127
13135
  if (!(sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image) || isLoadFinish) {
13128
13136
  return null;
13129
13137
  }
13130
- return (React.createElement("img", { style: { position: 'absolute', left: 0, top: 0, width: '100%', height: '100%', objectFit: 'cover' }, src: sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image, alt: 'placeholder image' }));
13138
+ return (React.createElement("img", { style: {
13139
+ position: 'absolute',
13140
+ left: 0,
13141
+ top: 0,
13142
+ width: '100%',
13143
+ height: '100%',
13144
+ objectFit: 'cover'
13145
+ }, src: sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image, alt: 'placeholder image' }));
13131
13146
  }, [isLoadFinish, sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image]);
13132
13147
  const renderLoading = React.useMemo(() => {
13133
13148
  if (!waiting || !isLoadFinish)
@@ -13162,7 +13177,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
13162
13177
  return null;
13163
13178
  }
13164
13179
  return (React.createElement(React.Fragment, null, blur ? (React.createElement("div", { className: 'video-container', key: rec === null || rec === void 0 ? void 0 : rec.video.itemId, onClick: handleClickVideo(), style: Object.assign({ position: 'relative', width: '100%', height, overflow: 'hidden' }, bgStyle) },
13165
- !isBgColor && (React.createElement(FormatImage$1, { src: blurBgSrc, style: Object.assign({ height: '100%', width: '100%', objectFit: 'cover' }, blurStyle) })),
13180
+ !isBgColor && isLoadFinish && blurBgSrc && (React.createElement(FormatImage$1, { src: blurBgSrc, style: Object.assign({ height: '100%', width: '100%', objectFit: 'cover' }, blurStyle) })),
13166
13181
  React.createElement("canvas", { ref: canvasRef, style: { display: 'none' } }),
13167
13182
  React.createElement("div", { style: {
13168
13183
  position: 'absolute',
@@ -13239,7 +13254,7 @@ const FingerSwipeTip = ({ imageUrl, style }) => {
13239
13254
  * @Author: binruan@chatlabs.com
13240
13255
  * @Date: 2024-03-20 10:27:31
13241
13256
  * @LastEditors: binruan@chatlabs.com
13242
- * @LastEditTime: 2024-04-30 18:36:47
13257
+ * @LastEditTime: 2024-06-24 10:37:19
13243
13258
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\PictureGroup\Picture.tsx
13244
13259
  *
13245
13260
  */
@@ -13279,7 +13294,7 @@ const Picture = (props) => {
13279
13294
  transform: translateY,
13280
13295
  left: 0,
13281
13296
  right: 0
13282
- } }))));
13297
+ }, onLoad: onShowFirstImage }))));
13283
13298
  };
13284
13299
 
13285
13300
  /*