pb-sxp-ui 1.0.90 → 1.0.92
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 +19 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +19 -16
- 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 +23 -19
- 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 +13 -13
- package/es/materials/sxp/template/components/Img.js +5 -2
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +13 -13
- package/lib/materials/sxp/template/components/Img.js +4 -1
- package/package.json +1 -2
package/dist/index.cjs
CHANGED
@@ -10,7 +10,6 @@ var qs = require('qs');
|
|
10
10
|
var EventEmitter = require('eventemitter3');
|
11
11
|
var css = require('@emotion/css');
|
12
12
|
var ReactDOM = require('react-dom');
|
13
|
-
var Hls = require('hls.js');
|
14
13
|
|
15
14
|
function _interopNamespaceDefault(e) {
|
16
15
|
var n = Object.create(null);
|
@@ -9684,7 +9683,7 @@ function useOnScreen(ref) {
|
|
9684
9683
|
* @Author: binruan@chatlabs.com
|
9685
9684
|
* @Date: 2024-01-16 14:50:13
|
9686
9685
|
* @LastEditors: binruan@chatlabs.com
|
9687
|
-
* @LastEditTime: 2024-06-21
|
9686
|
+
* @LastEditTime: 2024-06-21 16:34:48
|
9688
9687
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\components\Img.tsx
|
9689
9688
|
*
|
9690
9689
|
*/
|
@@ -9700,9 +9699,12 @@ const Img = ({ src, rec, item, index, style, translateY, imgStyle }) => {
|
|
9700
9699
|
}, rec, item, index);
|
9701
9700
|
}
|
9702
9701
|
}, [isOnScreen, src, ref, rec, ctaEvent, item, index]);
|
9702
|
+
const imgSrc = React.useMemo(() => {
|
9703
|
+
return (src === null || src === void 0 ? void 0 : src.includes('.avif')) ? src : `${src}?imrquality/rquality/40`;
|
9704
|
+
}, [src]);
|
9703
9705
|
return (React.createElement("div", { className: css.css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, imgStyle)) },
|
9704
9706
|
React.createElement("div", { ref: ref, hidden: !src, className: css.css({ width: '100%', height: '100%' }) },
|
9705
|
-
React.createElement(FormatImage$1, { className: css.css(Object.assign({ width: '100%', objectFit: 'cover', height: '100%', display: 'block', objectPosition: `50% ${translateY ? -translateY + 50 : 50}%` }, style)), src:
|
9707
|
+
React.createElement(FormatImage$1, { className: css.css(Object.assign({ width: '100%', objectFit: 'cover', height: '100%', display: 'block', objectPosition: `50% ${translateY ? -translateY + 50 : 50}%` }, style)), src: imgSrc }))));
|
9706
9708
|
};
|
9707
9709
|
var Img$1 = React.memo(Img);
|
9708
9710
|
|
@@ -12905,7 +12907,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
12905
12907
|
return;
|
12906
12908
|
videoRef.muted = muted;
|
12907
12909
|
}, [muted, videoRef]);
|
12908
|
-
const
|
12910
|
+
const handlePlay = React.useCallback(() => {
|
12909
12911
|
if (!videoRef)
|
12910
12912
|
return;
|
12911
12913
|
videoRef === null || videoRef === void 0 ? void 0 : videoRef.play();
|
@@ -13032,15 +13034,14 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
13032
13034
|
const videoSrc = rec === null || rec === void 0 ? void 0 : rec.video.url;
|
13033
13035
|
if (!videoSrc)
|
13034
13036
|
return;
|
13035
|
-
|
13036
|
-
|
13037
|
-
|
13038
|
-
|
13039
|
-
|
13040
|
-
|
13041
|
-
|
13042
|
-
|
13043
|
-
}
|
13037
|
+
const Hls = window === null || window === void 0 ? void 0 : window.Hls;
|
13038
|
+
if (videoSrc.includes('.m3u8') && Hls && Hls.isSupported()) {
|
13039
|
+
const hls = new Hls();
|
13040
|
+
hls.loadSource(videoSrc);
|
13041
|
+
hls.attachMedia(videoRef);
|
13042
|
+
hls.on(Hls.Events.MANIFEST_PARSED, function () {
|
13043
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.play();
|
13044
|
+
});
|
13044
13045
|
}
|
13045
13046
|
else {
|
13046
13047
|
videoRef.src = videoSrc;
|
@@ -13058,14 +13059,16 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
13058
13059
|
videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('loadeddata', handLoadeddata);
|
13059
13060
|
videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('playing', handlePlaying);
|
13060
13061
|
videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('pause', handlePause);
|
13061
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('ended',
|
13062
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('ended', handlePlay);
|
13063
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('canplay', handlePlay);
|
13062
13064
|
return () => {
|
13063
13065
|
dom2 === null || dom2 === void 0 ? void 0 : dom2.appendChild(dom);
|
13064
13066
|
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('loadedmetadata', handleLoadedmetadata);
|
13065
13067
|
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('loadeddata', handLoadeddata);
|
13066
13068
|
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('playing', handlePlaying);
|
13067
13069
|
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('pause', handlePause);
|
13068
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('ended',
|
13070
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('ended', handlePlay);
|
13071
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('canplay', handlePlay);
|
13069
13072
|
};
|
13070
13073
|
}, [isActive, videoId, rec, videoRef]);
|
13071
13074
|
React.useEffect(() => {
|
@@ -13530,7 +13533,7 @@ var Tagbar$1 = React.memo(Tagbar);
|
|
13530
13533
|
* @Author: binruan@chatlabs.com
|
13531
13534
|
* @Date: 2024-01-15 19:03:09
|
13532
13535
|
* @LastEditors: binruan@chatlabs.com
|
13533
|
-
* @LastEditTime: 2024-06-21
|
13536
|
+
* @LastEditTime: 2024-06-21 15:53:06
|
13534
13537
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
13535
13538
|
*
|
13536
13539
|
*/
|