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.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]);
|
@@ -13169,7 +13177,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
13169
13177
|
return null;
|
13170
13178
|
}
|
13171
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) },
|
13172
|
-
!isBgColor && isLoadFinish && (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) })),
|
13173
13181
|
React.createElement("canvas", { ref: canvasRef, style: { display: 'none' } }),
|
13174
13182
|
React.createElement("div", { style: {
|
13175
13183
|
position: 'absolute',
|