pb-sxp-ui 1.0.38 → 1.0.40
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 +38 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +38 -20
- 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 +38 -20
- 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 +26 -18
- package/es/core/components/SxpPageRender/index.js +6 -1
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +26 -18
- package/lib/core/components/SxpPageRender/index.js +6 -1
- package/package.json +1 -1
package/dist/pb-ui.js
CHANGED
@@ -12031,6 +12031,7 @@ Made in Italy` })));
|
|
12031
12031
|
}
|
12032
12032
|
}, [bffEventReport, data, index, isFirstPlay]);
|
12033
12033
|
const handleCanplay = React.useCallback(() => {
|
12034
|
+
handLoadeddata();
|
12034
12035
|
setIsLoadFinish(true);
|
12035
12036
|
}, []);
|
12036
12037
|
const handleClickVideo = React.useCallback((type) => () => {
|
@@ -12100,21 +12101,28 @@ Made in Italy` })));
|
|
12100
12101
|
return ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || firstFrameSrc;
|
12101
12102
|
}, [firstFrameSrc, rec]);
|
12102
12103
|
const handLoadeddata = React.useCallback(() => {
|
12104
|
+
var _a;
|
12103
12105
|
const videoDomRef = document.getElementById(`${videoId}_html5_api`);
|
12104
|
-
if (!canvasRef || !videoDomRef || !canvasRef.current)
|
12106
|
+
if (((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || !canvasRef || !videoDomRef || !canvasRef.current)
|
12105
12107
|
return;
|
12106
|
-
const
|
12107
|
-
|
12108
|
-
|
12109
|
-
|
12110
|
-
|
12111
|
-
|
12112
|
-
|
12113
|
-
|
12114
|
-
|
12108
|
+
const setFrameImg = () => {
|
12109
|
+
const video = videoDomRef;
|
12110
|
+
const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
|
12111
|
+
const ctx = canvas.getContext('2d');
|
12112
|
+
const targetWidth = window === null || window === void 0 ? void 0 : window.innerWidth;
|
12113
|
+
const targetHeight = window === null || window === void 0 ? void 0 : window.innerHeight;
|
12114
|
+
canvas.height = targetHeight;
|
12115
|
+
canvas.width = targetWidth;
|
12116
|
+
ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
|
12117
|
+
setFirstFrameSrc(canvas.toDataURL());
|
12118
|
+
};
|
12119
|
+
setFrameImg();
|
12120
|
+
setTimeout(() => {
|
12121
|
+
setFrameImg();
|
12122
|
+
}, 500);
|
12115
12123
|
}, []);
|
12116
12124
|
React.useEffect(() => {
|
12117
|
-
var _a, _b, _c, _d, _e
|
12125
|
+
var _a, _b, _c, _d, _e;
|
12118
12126
|
setIsPauseVideo(false);
|
12119
12127
|
const videoSrc = rec.video.url;
|
12120
12128
|
if (videoSrc && typeof TCPlayer === 'function') {
|
@@ -12133,21 +12141,23 @@ Made in Italy` })));
|
|
12133
12141
|
posterImage: false,
|
12134
12142
|
bigPlayButton: true
|
12135
12143
|
});
|
12144
|
+
videoRef.current.play();
|
12145
|
+
videoRef.current.pause();
|
12136
12146
|
}
|
12137
12147
|
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.on('loadedmetadata', handleCanplay);
|
12138
12148
|
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.on('canplay', handleCanplay);
|
12139
12149
|
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.on('playing', handlePlaying);
|
12140
|
-
|
12141
|
-
(
|
12142
|
-
(
|
12150
|
+
// videoRef.current?.on('loadeddata', handLoadeddata);
|
12151
|
+
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.on('pause', handlePause);
|
12152
|
+
(_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.on('ended', handleEnded);
|
12143
12153
|
return () => {
|
12144
|
-
var _a, _b, _c, _d, _e
|
12154
|
+
var _a, _b, _c, _d, _e;
|
12145
12155
|
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.off('loadedmetadata', handleCanplay);
|
12146
12156
|
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.off('canplay', handleCanplay);
|
12147
12157
|
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.off('playing', handlePlaying);
|
12148
|
-
|
12149
|
-
(
|
12150
|
-
(
|
12158
|
+
// videoRef.current?.off('loadeddata', handLoadeddata);
|
12159
|
+
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.off('pause', handlePause);
|
12160
|
+
(_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.off('ended', handleEnded);
|
12151
12161
|
videoRef.current.dispose();
|
12152
12162
|
};
|
12153
12163
|
}, []);
|
@@ -12567,7 +12577,7 @@ Made in Italy` })));
|
|
12567
12577
|
* @Author: binruan@chatlabs.com
|
12568
12578
|
* @Date: 2024-01-15 19:03:09
|
12569
12579
|
* @LastEditors: binruan@chatlabs.com
|
12570
|
-
* @LastEditTime: 2024-04-
|
12580
|
+
* @LastEditTime: 2024-04-25 17:03:41
|
12571
12581
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
12572
12582
|
*
|
12573
12583
|
*/
|
@@ -12928,7 +12938,12 @@ Made in Italy` })));
|
|
12928
12938
|
} })),
|
12929
12939
|
renderLogo,
|
12930
12940
|
isShowFingerTip ? React.createElement(FingerSwipeTip, { imageUrl: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipIcon }) : null,
|
12931
|
-
React.createElement(Swiper, { ref: swiperRef,
|
12941
|
+
React.createElement(Swiper, { ref: swiperRef, onSlideChange: () => {
|
12942
|
+
swiperRef.current.swiper.allowTouchMove = false;
|
12943
|
+
setTimeout(() => {
|
12944
|
+
swiperRef.current.swiper.allowTouchMove = true;
|
12945
|
+
}, 500);
|
12946
|
+
}, onActiveIndexChange: (swiper) => {
|
12932
12947
|
setActiveIndex(swiper.activeIndex);
|
12933
12948
|
if (openHashtag)
|
12934
12949
|
return;
|
@@ -12945,6 +12960,9 @@ Made in Italy` })));
|
|
12945
12960
|
}
|
12946
12961
|
}
|
12947
12962
|
},
|
12963
|
+
// style={{
|
12964
|
+
// pointerEvents: canSwiper ? 'auto' : 'none'
|
12965
|
+
// }}
|
12948
12966
|
// onReachEnd={() => {
|
12949
12967
|
// // 由hashtaglist跳转过来时不执行下面的方法
|
12950
12968
|
// if (waterFallData) return;
|