pb-sxp-ui 1.15.13-alpha.5 → 1.15.15-alpha.1
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 +17 -22
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +17 -22
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +6 -6
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +6 -6
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +17 -22
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +6 -6
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/DiyStoryPreview/VideoWidget.d.ts +3 -1
- package/es/core/components/DiyStoryPreview/VideoWidget.js +14 -15
- package/es/core/components/DiyStoryPreview/index.d.ts +4 -1
- package/es/core/components/DiyStoryPreview/index.js +2 -6
- package/lib/core/components/DiyStoryPreview/VideoWidget.d.ts +3 -1
- package/lib/core/components/DiyStoryPreview/VideoWidget.js +14 -15
- package/lib/core/components/DiyStoryPreview/index.d.ts +4 -1
- package/lib/core/components/DiyStoryPreview/index.js +2 -6
- package/package.json +1 -1
package/dist/pb-ui.js
CHANGED
@@ -19475,7 +19475,7 @@ Made in Italy` })));
|
|
19475
19475
|
};
|
19476
19476
|
var PictureGroup$1 = React.memo(PictureGroup);
|
19477
19477
|
|
19478
|
-
const VideoWidget = React.forwardRef(({ rec, index, height, data, muted, activeIndex, videoPostConfig, width, swiperRef, videoPlayIcon,
|
19478
|
+
const VideoWidget = React.forwardRef(({ rec, index, height, data, muted, activeIndex, videoPostConfig, width, swiperRef, videoPlayIcon, onUpdateTimeLine, loopPlay, onPlay, onPause }, ref) => {
|
19479
19479
|
const { isActive } = useSwiperSlide();
|
19480
19480
|
const [isPauseVideo, setIsPauseVideo] = React.useState(false);
|
19481
19481
|
const videoRef = React.useRef(null);
|
@@ -19578,15 +19578,6 @@ Made in Italy` })));
|
|
19578
19578
|
break;
|
19579
19579
|
}
|
19580
19580
|
}, [isLoadFinish]);
|
19581
|
-
React.useCallback(() => {
|
19582
|
-
var _a, _b, _c, _d, _e, _f;
|
19583
|
-
data[index];
|
19584
|
-
((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
19585
|
-
((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
19586
|
-
if ((_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.duration) {
|
19587
|
-
(((_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.currentTime) - videoStartTime.current).toFixed(2);
|
19588
|
-
}
|
19589
|
-
}, [data, index, bffEventReport]);
|
19590
19581
|
const blur = React.useMemo(() => {
|
19591
19582
|
return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2';
|
19592
19583
|
}, [videoPostConfig]);
|
@@ -19614,7 +19605,7 @@ Made in Italy` })));
|
|
19614
19605
|
if (!videoRef.current)
|
19615
19606
|
return;
|
19616
19607
|
const localTime = ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.currentTime) - (rec === null || rec === void 0 ? void 0 : rec.startTime);
|
19617
|
-
|
19608
|
+
onUpdateTimeLine === null || onUpdateTimeLine === void 0 ? void 0 : onUpdateTimeLine(index, localTime);
|
19618
19609
|
setTimeout(() => {
|
19619
19610
|
var _a, _b;
|
19620
19611
|
if (((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.currentTime) >= ((_b = rec === null || rec === void 0 ? void 0 : rec.endTime) !== null && _b !== void 0 ? _b : 0)) {
|
@@ -19637,9 +19628,15 @@ Made in Italy` })));
|
|
19637
19628
|
};
|
19638
19629
|
const handlePause = () => {
|
19639
19630
|
setIsPauseVideo(true);
|
19631
|
+
onPause === null || onPause === void 0 ? void 0 : onPause();
|
19632
|
+
};
|
19633
|
+
const handlePlay = () => {
|
19634
|
+
var _a;
|
19635
|
+
const localTime = ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.currentTime) - (rec === null || rec === void 0 ? void 0 : rec.startTime);
|
19636
|
+
onPlay === null || onPlay === void 0 ? void 0 : onPlay(index, localTime);
|
19640
19637
|
};
|
19641
19638
|
React.useEffect(() => {
|
19642
|
-
var _a, _b, _c;
|
19639
|
+
var _a, _b, _c, _d;
|
19643
19640
|
if (!isActive)
|
19644
19641
|
return;
|
19645
19642
|
const videoSrc = rec === null || rec === void 0 ? void 0 : rec.mediaUrl;
|
@@ -19671,9 +19668,10 @@ Made in Italy` })));
|
|
19671
19668
|
// videoRef.current?.addEventListener('playing', handlePlaying);
|
19672
19669
|
// videoRef.current?.addEventListener('loadeddata', handLoadeddata);
|
19673
19670
|
(_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.addEventListener('pause', handlePause);
|
19674
|
-
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.addEventListener('
|
19671
|
+
(_c = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _c === void 0 ? void 0 : _c.addEventListener('play', handlePlay);
|
19672
|
+
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.addEventListener('timeupdate', handleTimeUpload);
|
19675
19673
|
return () => {
|
19676
|
-
var _a, _b, _c, _d;
|
19674
|
+
var _a, _b, _c, _d, _e;
|
19677
19675
|
if (hlsRef === null || hlsRef === void 0 ? void 0 : hlsRef.current)
|
19678
19676
|
(_a = hlsRef === null || hlsRef === void 0 ? void 0 : hlsRef.current) === null || _a === void 0 ? void 0 : _a.destroy();
|
19679
19677
|
setIsLoadFinish(false);
|
@@ -19681,7 +19679,8 @@ Made in Italy` })));
|
|
19681
19679
|
// videoRef.current?.removeEventListener('playing', handlePlaying);
|
19682
19680
|
// videoRef.current?.removeEventListener('loadeddata', handLoadeddata);
|
19683
19681
|
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('pause', handlePause);
|
19684
|
-
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.removeEventListener('
|
19682
|
+
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.removeEventListener('play', handlePlay);
|
19683
|
+
(_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.removeEventListener('timeupdate', handleTimeUpload);
|
19685
19684
|
};
|
19686
19685
|
}, [isActive]);
|
19687
19686
|
const renderPoster = React.useMemo(() => {
|
@@ -19737,7 +19736,7 @@ Made in Italy` })));
|
|
19737
19736
|
* @Author: binruan@chatlabs.com
|
19738
19737
|
* @Date: 2025-03-25 13:54:27
|
19739
19738
|
* @LastEditors: binruan@chatlabs.com
|
19740
|
-
* @LastEditTime: 2025-
|
19739
|
+
* @LastEditTime: 2025-04-01 17:54:08
|
19741
19740
|
* @FilePath: \pb-sxp-ui\src\core\components\DiyStoryPreview\index.tsx
|
19742
19741
|
*
|
19743
19742
|
*/
|
@@ -19925,7 +19924,7 @@ Made in Italy` })));
|
|
19925
19924
|
});
|
19926
19925
|
const defaultUnLikeIconPath = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
|
19927
19926
|
const defaultLikeIconPath = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
|
19928
|
-
const DiyStoryPreview = React.forwardRef(({ data = [], globalConfig, tipText, nudge, tempMap, descStyle, hashTagStyle, containerHeight = 664, containerWidth = 375, appDomain, tagList = [], scenes, onActiveChange, activeIndex, loopPlay = false, pointerEvents = 'none', onUpdateTimeLine, disabledListener }, ref) => {
|
19927
|
+
const DiyStoryPreview = React.forwardRef(({ data = [], globalConfig, tipText, nudge, tempMap, descStyle, hashTagStyle, containerHeight = 664, containerWidth = 375, appDomain, tagList = [], scenes, onActiveChange, activeIndex, loopPlay = false, pointerEvents = 'none', onUpdateTimeLine, disabledListener, onPlay, onPause }, ref) => {
|
19929
19928
|
const videoWidgetRef = React.useRef(null);
|
19930
19929
|
const swiperRef = React.useRef(null);
|
19931
19930
|
const [curIndex, setCurIndex] = React.useState(0);
|
@@ -19958,10 +19957,6 @@ Made in Italy` })));
|
|
19958
19957
|
isPlaying() {
|
19959
19958
|
var _a, _b;
|
19960
19959
|
return (_b = (_a = videoWidgetRef === null || videoWidgetRef === void 0 ? void 0 : videoWidgetRef.current) === null || _a === void 0 ? void 0 : _a.isPlaying()) !== null && _b !== void 0 ? _b : false;
|
19961
|
-
},
|
19962
|
-
setLoopPlay(v) {
|
19963
|
-
var _a;
|
19964
|
-
(_a = videoWidgetRef === null || videoWidgetRef === void 0 ? void 0 : videoWidgetRef.current) === null || _a === void 0 ? void 0 : _a.setLoopPlay(v);
|
19965
19960
|
}
|
19966
19961
|
};
|
19967
19962
|
});
|
@@ -19979,7 +19974,7 @@ Made in Italy` })));
|
|
19979
19974
|
const renderContent = (rec, index) => {
|
19980
19975
|
const isVideo = isVideoUrl(rec === null || rec === void 0 ? void 0 : rec.mediaUrl);
|
19981
19976
|
if (isVideo) {
|
19982
|
-
return (React.createElement(VideoWidget$1, Object.assign({ key: index }, (curIndex === index && { ref: videoWidgetRef }), { rec: rec, index: index, muted: true, width: containerWidth, data: scenes !== null && scenes !== void 0 ? scenes : [], height: containerHeight, activeIndex: index, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost, videoPlayIcon: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPlayIcon, swiperRef: swiperRef, loopPlay: loopPlay,
|
19977
|
+
return (React.createElement(VideoWidget$1, Object.assign({ key: index }, (curIndex === index && { ref: videoWidgetRef }), { rec: rec, index: index, muted: true, width: containerWidth, data: scenes !== null && scenes !== void 0 ? scenes : [], height: containerHeight, activeIndex: index, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost, videoPlayIcon: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPlayIcon, swiperRef: swiperRef, loopPlay: loopPlay, onUpdateTimeLine: onUpdateTimeLine, onPlay: onPlay, onPause: onPause })));
|
19983
19978
|
}
|
19984
19979
|
else {
|
19985
19980
|
return (React.createElement(PictureGroup$1, { key: rec.itemId, imgUrls: [rec === null || rec === void 0 ? void 0 : rec.mediaUrl], width: containerWidth, height: containerHeight, rec: rec, index: index, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost, data: scenes !== null && scenes !== void 0 ? scenes : [], swiperRef: swiperRef }));
|