pb-sxp-ui 1.0.94 → 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 +11 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +11 -3
- 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 +11 -3
- 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/VideoWidget/index.js +11 -3
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +11 -3
- package/package.json +1 -1
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]);
|
@@ -13146,7 +13154,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
13146
13154
|
return null;
|
13147
13155
|
}
|
13148
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) },
|
13149
|
-
!isBgColor && isLoadFinish && (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) })),
|
13150
13158
|
React.createElement("canvas", { ref: canvasRef, style: { display: 'none' } }),
|
13151
13159
|
React.createElement("div", { style: {
|
13152
13160
|
position: 'absolute',
|