pb-sxp-ui 1.0.91 → 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 +18 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +18 -15
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +1 -1
- 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 +18 -15
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +1 -1
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/SxpPageRender/VideoWidget/index.js +12 -12
- package/es/materials/sxp/template/components/Img.js +5 -2
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +12 -12
- package/lib/materials/sxp/template/components/Img.js +4 -1
- package/package.json +1 -1
package/dist/pb-ui.js
CHANGED
@@ -9676,7 +9676,7 @@ Made in Italy` })));
|
|
9676
9676
|
* @Author: binruan@chatlabs.com
|
9677
9677
|
* @Date: 2024-01-16 14:50:13
|
9678
9678
|
* @LastEditors: binruan@chatlabs.com
|
9679
|
-
* @LastEditTime: 2024-06-21
|
9679
|
+
* @LastEditTime: 2024-06-21 16:34:48
|
9680
9680
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\components\Img.tsx
|
9681
9681
|
*
|
9682
9682
|
*/
|
@@ -9692,9 +9692,12 @@ Made in Italy` })));
|
|
9692
9692
|
}, rec, item, index);
|
9693
9693
|
}
|
9694
9694
|
}, [isOnScreen, src, ref, rec, ctaEvent, item, index]);
|
9695
|
+
const imgSrc = React.useMemo(() => {
|
9696
|
+
return (src === null || src === void 0 ? void 0 : src.includes('.avif')) ? src : `${src}?imrquality/rquality/40`;
|
9697
|
+
}, [src]);
|
9695
9698
|
return (React.createElement("div", { className: css.css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, imgStyle)) },
|
9696
9699
|
React.createElement("div", { ref: ref, hidden: !src, className: css.css({ width: '100%', height: '100%' }) },
|
9697
|
-
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:
|
9700
|
+
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 }))));
|
9698
9701
|
};
|
9699
9702
|
var Img$1 = React.memo(Img);
|
9700
9703
|
|
@@ -12897,7 +12900,7 @@ Made in Italy` })));
|
|
12897
12900
|
return;
|
12898
12901
|
videoRef.muted = muted;
|
12899
12902
|
}, [muted, videoRef]);
|
12900
|
-
const
|
12903
|
+
const handlePlay = React.useCallback(() => {
|
12901
12904
|
if (!videoRef)
|
12902
12905
|
return;
|
12903
12906
|
videoRef === null || videoRef === void 0 ? void 0 : videoRef.play();
|
@@ -13025,15 +13028,13 @@ Made in Italy` })));
|
|
13025
13028
|
if (!videoSrc)
|
13026
13029
|
return;
|
13027
13030
|
const Hls = window === null || window === void 0 ? void 0 : window.Hls;
|
13028
|
-
if (videoSrc.includes('.m3u8')) {
|
13029
|
-
|
13030
|
-
|
13031
|
-
|
13032
|
-
|
13033
|
-
|
13034
|
-
|
13035
|
-
videoRef.src = videoSrc;
|
13036
|
-
}
|
13031
|
+
if (videoSrc.includes('.m3u8') && Hls && Hls.isSupported()) {
|
13032
|
+
const hls = new Hls();
|
13033
|
+
hls.loadSource(videoSrc);
|
13034
|
+
hls.attachMedia(videoRef);
|
13035
|
+
hls.on(Hls.Events.MANIFEST_PARSED, function () {
|
13036
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.play();
|
13037
|
+
});
|
13037
13038
|
}
|
13038
13039
|
else {
|
13039
13040
|
videoRef.src = videoSrc;
|
@@ -13051,14 +13052,16 @@ Made in Italy` })));
|
|
13051
13052
|
videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('loadeddata', handLoadeddata);
|
13052
13053
|
videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('playing', handlePlaying);
|
13053
13054
|
videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('pause', handlePause);
|
13054
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('ended',
|
13055
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('ended', handlePlay);
|
13056
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('canplay', handlePlay);
|
13055
13057
|
return () => {
|
13056
13058
|
dom2 === null || dom2 === void 0 ? void 0 : dom2.appendChild(dom);
|
13057
13059
|
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('loadedmetadata', handleLoadedmetadata);
|
13058
13060
|
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('loadeddata', handLoadeddata);
|
13059
13061
|
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('playing', handlePlaying);
|
13060
13062
|
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('pause', handlePause);
|
13061
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('ended',
|
13063
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('ended', handlePlay);
|
13064
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('canplay', handlePlay);
|
13062
13065
|
};
|
13063
13066
|
}, [isActive, videoId, rec, videoRef]);
|
13064
13067
|
React.useEffect(() => {
|
@@ -13523,7 +13526,7 @@ Made in Italy` })));
|
|
13523
13526
|
* @Author: binruan@chatlabs.com
|
13524
13527
|
* @Date: 2024-01-15 19:03:09
|
13525
13528
|
* @LastEditors: binruan@chatlabs.com
|
13526
|
-
* @LastEditTime: 2024-06-21
|
13529
|
+
* @LastEditTime: 2024-06-21 15:53:06
|
13527
13530
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
13528
13531
|
*
|
13529
13532
|
*/
|