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 +21 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +21 -6
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +3 -3
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +3 -3
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +21 -6
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +3 -3
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/SxpPageRender/PictureGroup/Picture.js +1 -1
- package/es/core/components/SxpPageRender/VideoWidget/index.js +19 -4
- package/lib/core/components/SxpPageRender/PictureGroup/Picture.js +1 -1
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +19 -4
- package/package.json +1 -1
package/dist/pb-ui.js
CHANGED
@@ -12910,11 +12910,15 @@ Made in Italy` })));
|
|
12910
12910
|
}, [videoRef]);
|
12911
12911
|
const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
12912
12912
|
const handlePlaying = React.useCallback(() => {
|
12913
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
12914
12913
|
if (!videoRef)
|
12915
12914
|
return;
|
12916
12915
|
setWaiting(false);
|
12917
12916
|
setIsLoadFinish(true);
|
12917
|
+
}, []);
|
12918
|
+
const handleStartPlay = React.useCallback(() => {
|
12919
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
12920
|
+
if (!videoRef)
|
12921
|
+
return;
|
12918
12922
|
setIsPauseVideo(false);
|
12919
12923
|
const item = data[index];
|
12920
12924
|
if (item && (videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration)) {
|
@@ -12965,8 +12969,9 @@ Made in Italy` })));
|
|
12965
12969
|
const handleLoadedmetadata = React.useCallback(() => {
|
12966
12970
|
if (!videoRef)
|
12967
12971
|
return;
|
12972
|
+
handleStartPlay();
|
12968
12973
|
handLoadeddata();
|
12969
|
-
}, [videoRef, handLoadeddata]);
|
12974
|
+
}, [videoRef, handLoadeddata, handleStartPlay]);
|
12970
12975
|
const handleClickVideo = React.useCallback((type) => () => {
|
12971
12976
|
if (!videoRef)
|
12972
12977
|
return;
|
@@ -13056,6 +13061,7 @@ Made in Italy` })));
|
|
13056
13061
|
videoRef.setAttribute('webkit-playsinline', 'true');
|
13057
13062
|
videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('loadedmetadata', handleLoadedmetadata);
|
13058
13063
|
videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('loadeddata', handLoadeddata);
|
13064
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('play', handleStartPlay);
|
13059
13065
|
videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('playing', handlePlaying);
|
13060
13066
|
videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('pause', handlePause);
|
13061
13067
|
videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('ended', handlePlay);
|
@@ -13066,9 +13072,11 @@ Made in Italy` })));
|
|
13066
13072
|
dom2 === null || dom2 === void 0 ? void 0 : dom2.appendChild(dom);
|
13067
13073
|
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('loadedmetadata', handleLoadedmetadata);
|
13068
13074
|
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('loadeddata', handLoadeddata);
|
13075
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('play', handleStartPlay);
|
13069
13076
|
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('playing', handlePlaying);
|
13070
13077
|
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('pause', handlePause);
|
13071
13078
|
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('ended', handlePlay);
|
13079
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('canplay', handlePlay);
|
13072
13080
|
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('waiting', handleWaiting);
|
13073
13081
|
};
|
13074
13082
|
}, [isActive, videoId, rec, videoRef]);
|
@@ -13120,7 +13128,14 @@ Made in Italy` })));
|
|
13120
13128
|
if (!(sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image) || isLoadFinish) {
|
13121
13129
|
return null;
|
13122
13130
|
}
|
13123
|
-
return (React.createElement("img", { style: {
|
13131
|
+
return (React.createElement("img", { style: {
|
13132
|
+
position: 'absolute',
|
13133
|
+
left: 0,
|
13134
|
+
top: 0,
|
13135
|
+
width: '100%',
|
13136
|
+
height: '100%',
|
13137
|
+
objectFit: 'cover'
|
13138
|
+
}, src: sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image, alt: 'placeholder image' }));
|
13124
13139
|
}, [isLoadFinish, sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image]);
|
13125
13140
|
const renderLoading = React.useMemo(() => {
|
13126
13141
|
if (!waiting || !isLoadFinish)
|
@@ -13155,7 +13170,7 @@ Made in Italy` })));
|
|
13155
13170
|
return null;
|
13156
13171
|
}
|
13157
13172
|
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) },
|
13158
|
-
!isBgColor && (React.createElement(FormatImage$1, { src: blurBgSrc, style: Object.assign({ height: '100%', width: '100%', objectFit: 'cover' }, blurStyle) })),
|
13173
|
+
!isBgColor && isLoadFinish && blurBgSrc && (React.createElement(FormatImage$1, { src: blurBgSrc, style: Object.assign({ height: '100%', width: '100%', objectFit: 'cover' }, blurStyle) })),
|
13159
13174
|
React.createElement("canvas", { ref: canvasRef, style: { display: 'none' } }),
|
13160
13175
|
React.createElement("div", { style: {
|
13161
13176
|
position: 'absolute',
|
@@ -13232,7 +13247,7 @@ Made in Italy` })));
|
|
13232
13247
|
* @Author: binruan@chatlabs.com
|
13233
13248
|
* @Date: 2024-03-20 10:27:31
|
13234
13249
|
* @LastEditors: binruan@chatlabs.com
|
13235
|
-
* @LastEditTime: 2024-
|
13250
|
+
* @LastEditTime: 2024-06-24 10:37:19
|
13236
13251
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\PictureGroup\Picture.tsx
|
13237
13252
|
*
|
13238
13253
|
*/
|
@@ -13272,7 +13287,7 @@ Made in Italy` })));
|
|
13272
13287
|
transform: translateY,
|
13273
13288
|
left: 0,
|
13274
13289
|
right: 0
|
13275
|
-
} }))));
|
13290
|
+
}, onLoad: onShowFirstImage }))));
|
13276
13291
|
};
|
13277
13292
|
|
13278
13293
|
/*
|