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.js CHANGED
@@ -12894,11 +12894,15 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
12894
12894
  }, [videoRef]);
12895
12895
  const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
12896
12896
  const handlePlaying = useCallback(() => {
12897
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
12898
12897
  if (!videoRef)
12899
12898
  return;
12900
12899
  setWaiting(false);
12901
12900
  setIsLoadFinish(true);
12901
+ }, []);
12902
+ const handleStartPlay = useCallback(() => {
12903
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
12904
+ if (!videoRef)
12905
+ return;
12902
12906
  setIsPauseVideo(false);
12903
12907
  const item = data[index];
12904
12908
  if (item && (videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration)) {
@@ -12949,8 +12953,9 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
12949
12953
  const handleLoadedmetadata = useCallback(() => {
12950
12954
  if (!videoRef)
12951
12955
  return;
12956
+ handleStartPlay();
12952
12957
  handLoadeddata();
12953
- }, [videoRef, handLoadeddata]);
12958
+ }, [videoRef, handLoadeddata, handleStartPlay]);
12954
12959
  const handleClickVideo = useCallback((type) => () => {
12955
12960
  if (!videoRef)
12956
12961
  return;
@@ -13040,6 +13045,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
13040
13045
  videoRef.setAttribute('webkit-playsinline', 'true');
13041
13046
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('loadedmetadata', handleLoadedmetadata);
13042
13047
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('loadeddata', handLoadeddata);
13048
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('play', handleStartPlay);
13043
13049
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('playing', handlePlaying);
13044
13050
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('pause', handlePause);
13045
13051
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('ended', handlePlay);
@@ -13050,9 +13056,11 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
13050
13056
  dom2 === null || dom2 === void 0 ? void 0 : dom2.appendChild(dom);
13051
13057
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('loadedmetadata', handleLoadedmetadata);
13052
13058
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('loadeddata', handLoadeddata);
13059
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('play', handleStartPlay);
13053
13060
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('playing', handlePlaying);
13054
13061
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('pause', handlePause);
13055
13062
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('ended', handlePlay);
13063
+ videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('canplay', handlePlay);
13056
13064
  videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('waiting', handleWaiting);
13057
13065
  };
13058
13066
  }, [isActive, videoId, rec, videoRef]);
@@ -13104,7 +13112,14 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
13104
13112
  if (!(sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image) || isLoadFinish) {
13105
13113
  return null;
13106
13114
  }
13107
- 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' }));
13115
+ return (React.createElement("img", { style: {
13116
+ position: 'absolute',
13117
+ left: 0,
13118
+ top: 0,
13119
+ width: '100%',
13120
+ height: '100%',
13121
+ objectFit: 'cover'
13122
+ }, src: sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image, alt: 'placeholder image' }));
13108
13123
  }, [isLoadFinish, sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image]);
13109
13124
  const renderLoading = useMemo(() => {
13110
13125
  if (!waiting || !isLoadFinish)
@@ -13139,7 +13154,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
13139
13154
  return null;
13140
13155
  }
13141
13156
  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) },
13142
- !isBgColor && (React.createElement(FormatImage$1, { src: blurBgSrc, style: Object.assign({ height: '100%', width: '100%', objectFit: 'cover' }, blurStyle) })),
13157
+ !isBgColor && isLoadFinish && blurBgSrc && (React.createElement(FormatImage$1, { src: blurBgSrc, style: Object.assign({ height: '100%', width: '100%', objectFit: 'cover' }, blurStyle) })),
13143
13158
  React.createElement("canvas", { ref: canvasRef, style: { display: 'none' } }),
13144
13159
  React.createElement("div", { style: {
13145
13160
  position: 'absolute',
@@ -13216,7 +13231,7 @@ const FingerSwipeTip = ({ imageUrl, style }) => {
13216
13231
  * @Author: binruan@chatlabs.com
13217
13232
  * @Date: 2024-03-20 10:27:31
13218
13233
  * @LastEditors: binruan@chatlabs.com
13219
- * @LastEditTime: 2024-04-30 18:36:47
13234
+ * @LastEditTime: 2024-06-24 10:37:19
13220
13235
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\PictureGroup\Picture.tsx
13221
13236
  *
13222
13237
  */
@@ -13256,7 +13271,7 @@ const Picture = (props) => {
13256
13271
  transform: translateY,
13257
13272
  left: 0,
13258
13273
  right: 0
13259
- } }))));
13274
+ }, onLoad: onShowFirstImage }))));
13260
13275
  };
13261
13276
 
13262
13277
  /*