pb-sxp-ui 1.0.27 → 1.0.28
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 +32 -28
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +32 -28
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +4 -3
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +4 -3
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +32 -28
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +4 -3
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/SxpPageRender/VideoWidget/index.js +27 -28
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +27 -28
- package/package.json +1 -1
package/dist/pb-ui.js
CHANGED
@@ -12085,13 +12085,24 @@ Made in Italy` })));
|
|
12085
12085
|
});
|
12086
12086
|
}
|
12087
12087
|
}, [data, index, bffEventReport]);
|
12088
|
+
const blur = React.useMemo(() => {
|
12089
|
+
return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2';
|
12090
|
+
}, [videoPostConfig]);
|
12091
|
+
const translateY = React.useMemo(() => {
|
12092
|
+
var _a;
|
12093
|
+
return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2'
|
12094
|
+
? `translateY(-${50 + ((_a = videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.offsetTop) !== null && _a !== void 0 ? _a : 0)}%)`
|
12095
|
+
: 'translateY(-50%)';
|
12096
|
+
}, [videoPostConfig]);
|
12097
|
+
const blurBgSrc = React.useMemo(() => {
|
12098
|
+
var _a;
|
12099
|
+
return ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || firstFrameSrc;
|
12100
|
+
}, [firstFrameSrc, rec]);
|
12088
12101
|
const handLoadeddata = React.useCallback(() => {
|
12089
|
-
|
12090
|
-
if (!video)
|
12102
|
+
if (!canvasRef || !videoRef || !videoRef.current || !canvasRef.current)
|
12091
12103
|
return;
|
12104
|
+
const video = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current;
|
12092
12105
|
const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
|
12093
|
-
if (!canvas)
|
12094
|
-
return;
|
12095
12106
|
const ctx = canvas.getContext('2d');
|
12096
12107
|
const targetWidth = window === null || window === void 0 ? void 0 : window.innerWidth;
|
12097
12108
|
const targetHeight = window === null || window === void 0 ? void 0 : window.innerHeight;
|
@@ -12099,10 +12110,9 @@ Made in Italy` })));
|
|
12099
12110
|
canvas.width = targetWidth;
|
12100
12111
|
ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
|
12101
12112
|
setFirstFrameSrc(canvas.toDataURL());
|
12102
|
-
canvas.remove();
|
12103
12113
|
}, []);
|
12104
12114
|
React.useEffect(() => {
|
12105
|
-
var _a, _b, _c;
|
12115
|
+
var _a, _b, _c, _d;
|
12106
12116
|
if (!videoRef.current)
|
12107
12117
|
return;
|
12108
12118
|
setIsPauseVideo(false);
|
@@ -12125,14 +12135,16 @@ Made in Italy` })));
|
|
12125
12135
|
videoRef.current.setAttribute('x5-playsinline', 'true');
|
12126
12136
|
videoRef.current.setAttribute('webkit-playsinline', 'true');
|
12127
12137
|
}
|
12128
|
-
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener('
|
12129
|
-
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.addEventListener('
|
12130
|
-
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.addEventListener('
|
12138
|
+
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener('loadedmetadata', handleLoadedMetadata);
|
12139
|
+
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.addEventListener('canplay', handleLoadedMetadata);
|
12140
|
+
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.addEventListener('playing', handlePlaying);
|
12141
|
+
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.addEventListener('loadeddata', handLoadeddata);
|
12131
12142
|
return () => {
|
12132
|
-
var _a, _b, _c;
|
12133
|
-
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('
|
12134
|
-
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('
|
12135
|
-
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('
|
12143
|
+
var _a, _b, _c, _d;
|
12144
|
+
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('loadedmetadata', handleLoadedMetadata);
|
12145
|
+
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('canplay', handleLoadedMetadata);
|
12146
|
+
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('playing', handlePlaying);
|
12147
|
+
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.removeEventListener('loadeddata', handLoadeddata);
|
12136
12148
|
};
|
12137
12149
|
}, [handleLoadedMetadata, handlePlaying, rec.video, handLoadeddata]);
|
12138
12150
|
React.useEffect(() => {
|
@@ -12191,19 +12203,6 @@ Made in Italy` })));
|
|
12191
12203
|
window.removeEventListener('beforeunload', handleBeforeUnload);
|
12192
12204
|
};
|
12193
12205
|
}, [activeIndex, index, rec, videoRef, handleClickVideo, isPauseVideo]);
|
12194
|
-
const blur = React.useMemo(() => {
|
12195
|
-
return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2';
|
12196
|
-
}, [videoPostConfig]);
|
12197
|
-
const translateY = React.useMemo(() => {
|
12198
|
-
var _a;
|
12199
|
-
return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2'
|
12200
|
-
? `translateY(-${50 + ((_a = videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.offsetTop) !== null && _a !== void 0 ? _a : 0)}%)`
|
12201
|
-
: 'translateY(-50%)';
|
12202
|
-
}, [videoPostConfig]);
|
12203
|
-
const blurBgSrc = React.useMemo(() => {
|
12204
|
-
var _a;
|
12205
|
-
return ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || firstFrameSrc;
|
12206
|
-
}, [firstFrameSrc, rec]);
|
12207
12206
|
if (!rec.video) {
|
12208
12207
|
return null;
|
12209
12208
|
}
|
@@ -12231,7 +12230,9 @@ Made in Italy` })));
|
|
12231
12230
|
right: 0
|
12232
12231
|
} },
|
12233
12232
|
React.createElement("div", { style: { position: 'relative' } },
|
12234
|
-
React.createElement("video", { id: `pb-video-${index}`, className: 'clc-pb-video', ref: videoRef, crossOrigin: 'anonymous',
|
12233
|
+
React.createElement("video", { id: `pb-video-${index}`, className: 'clc-pb-video', ref: videoRef, crossOrigin: 'anonymous',
|
12234
|
+
// poster={sxpParameter?.placeholder_image}
|
12235
|
+
muted: true, controls: false, playsInline: true, preload: 'auto', onPause: onPause, onEnded: handleVideoStart, style: {
|
12235
12236
|
width: '100%',
|
12236
12237
|
height: 'auto',
|
12237
12238
|
objectFit: 'contain'
|
@@ -12243,7 +12244,9 @@ Made in Italy` })));
|
|
12243
12244
|
height,
|
12244
12245
|
overflow: 'hidden'
|
12245
12246
|
} },
|
12246
|
-
React.createElement("video", { id: `pb-video-${index}`, className: 'clc-pb-video', ref: videoRef, crossOrigin: 'anonymous',
|
12247
|
+
React.createElement("video", { id: `pb-video-${index}`, className: 'clc-pb-video', ref: videoRef, crossOrigin: 'anonymous',
|
12248
|
+
// poster={sxpParameter?.placeholder_image}
|
12249
|
+
muted: true, controls: false, playsInline: true, preload: 'auto', onPause: onPause, onEnded: handleVideoStart }),
|
12247
12250
|
renderPoster,
|
12248
12251
|
React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON })))));
|
12249
12252
|
};
|
@@ -13109,3 +13112,4 @@ Made in Italy` })));
|
|
13109
13112
|
Object.defineProperty(exports, '__esModule', { value: true });
|
13110
13113
|
|
13111
13114
|
}));
|
13115
|
+
//# sourceMappingURL=pb-ui.js.map
|