pb-sxp-ui 1.15.15-alpha.1 → 1.15.15-alpha.2
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 +21 -64
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +21 -64
- 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 +21 -64
- 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.js +12 -56
- package/es/core/components/DiyStoryPreview/index.js +4 -4
- package/lib/core/components/DiyStoryPreview/VideoWidget.js +12 -56
- package/lib/core/components/DiyStoryPreview/index.js +4 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -19465,11 +19465,11 @@ const VideoWidget = forwardRef(({ rec, index, height, data, muted, activeIndex,
|
|
19465
19465
|
const [isPauseVideo, setIsPauseVideo] = useState(false);
|
19466
19466
|
const videoRef = useRef(null);
|
19467
19467
|
const { bffEventReport, sxpParameter, waterFallData, openHashtag } = useSxpDataSource();
|
19468
|
-
|
19468
|
+
useRef(0);
|
19469
19469
|
const [isLoadFinish, setIsLoadFinish] = useState(false);
|
19470
|
-
|
19471
|
-
|
19472
|
-
|
19470
|
+
useState(true);
|
19471
|
+
useRef(null);
|
19472
|
+
useState('');
|
19473
19473
|
const videoId = `pb-cache-video-${index}`;
|
19474
19474
|
const hlsRef = useRef(null);
|
19475
19475
|
const loopPlayRef = useRef(loopPlay);
|
@@ -19494,8 +19494,6 @@ const VideoWidget = forwardRef(({ rec, index, height, data, muted, activeIndex,
|
|
19494
19494
|
setIsPauseVideo(true);
|
19495
19495
|
},
|
19496
19496
|
setLoopPlay(v) {
|
19497
|
-
if (!videoRef.current)
|
19498
|
-
return;
|
19499
19497
|
loopPlayRef.current = v;
|
19500
19498
|
},
|
19501
19499
|
isPlaying() {
|
@@ -19509,22 +19507,7 @@ const VideoWidget = forwardRef(({ rec, index, height, data, muted, activeIndex,
|
|
19509
19507
|
return;
|
19510
19508
|
videoRef.current.muted = muted;
|
19511
19509
|
}, [muted]);
|
19512
|
-
useCallback(() => {
|
19513
|
-
var _a;
|
19514
|
-
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
19515
|
-
}, []);
|
19516
19510
|
const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
19517
|
-
useCallback(() => {
|
19518
|
-
var _a, _b, _c, _d, _e, _f;
|
19519
|
-
setIsPauseVideo(false);
|
19520
|
-
const item = data[index];
|
19521
|
-
if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
|
19522
|
-
videoStartTime.current = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.currentTime) || 0;
|
19523
|
-
((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.duration) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
19524
|
-
((_f = (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.currentTime) !== null && _f !== void 0 ? _f : 0).toFixed(2);
|
19525
|
-
setIsFirstPlay(false);
|
19526
|
-
}
|
19527
|
-
}, [bffEventReport, data, index, isFirstPlay]);
|
19528
19511
|
const handleLoadedMetadata = useCallback(() => {
|
19529
19512
|
var _a;
|
19530
19513
|
videoRef.current.currentTime = rec === null || rec === void 0 ? void 0 : rec.startTime;
|
@@ -19566,50 +19549,24 @@ const VideoWidget = forwardRef(({ rec, index, height, data, muted, activeIndex,
|
|
19566
19549
|
const blur = useMemo(() => {
|
19567
19550
|
return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2';
|
19568
19551
|
}, [videoPostConfig]);
|
19569
|
-
|
19570
|
-
var _a;
|
19571
|
-
return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2'
|
19572
|
-
? `translateY(-${50 + ((_a = videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.offsetTop) !== null && _a !== void 0 ? _a : 0)}%) translate3d(0px, 0px, 0px)`
|
19573
|
-
: 'translateY(-50%)';
|
19574
|
-
}, [videoPostConfig]);
|
19575
|
-
useCallback(() => {
|
19576
|
-
if (!canvasRef || !videoRef || !videoRef.current || !canvasRef.current)
|
19577
|
-
return;
|
19578
|
-
const video = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current;
|
19579
|
-
const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
|
19580
|
-
const ctx = canvas.getContext('2d');
|
19581
|
-
const targetWidth = window === null || window === void 0 ? void 0 : window.innerWidth;
|
19582
|
-
const targetHeight = window === null || window === void 0 ? void 0 : window.innerHeight;
|
19583
|
-
canvas.height = targetHeight;
|
19584
|
-
canvas.width = targetWidth;
|
19585
|
-
ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
|
19586
|
-
setFirstFrameSrc(canvas.toDataURL());
|
19587
|
-
}, []);
|
19588
|
-
const handleTimeUpload = useCallback(() => {
|
19589
|
-
var _a;
|
19552
|
+
const handleTimeUpload = () => {
|
19590
19553
|
if (!videoRef.current)
|
19591
19554
|
return;
|
19592
|
-
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);
|
19593
|
-
onUpdateTimeLine === null || onUpdateTimeLine === void 0 ? void 0 : onUpdateTimeLine(index, localTime);
|
19594
19555
|
setTimeout(() => {
|
19595
|
-
var _a, _b;
|
19556
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
19596
19557
|
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)) {
|
19597
|
-
|
19558
|
+
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
|
19559
|
+
if (!loopPlayRef.current)
|
19560
|
+
return;
|
19561
|
+
if (index === (data === null || data === void 0 ? void 0 : data.length) - 1) {
|
19562
|
+
(_e = (_d = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _d === void 0 ? void 0 : _d.swiper) === null || _e === void 0 ? void 0 : _e.slideTo(0);
|
19563
|
+
}
|
19564
|
+
else {
|
19565
|
+
const i = (_g = (_f = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _f === void 0 ? void 0 : _f.swiper) === null || _g === void 0 ? void 0 : _g.activeIndex;
|
19566
|
+
(_j = (_h = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _h === void 0 ? void 0 : _h.swiper) === null || _j === void 0 ? void 0 : _j.slideTo(i + 1);
|
19567
|
+
}
|
19598
19568
|
}
|
19599
19569
|
});
|
19600
|
-
}, []);
|
19601
|
-
const slideSwiper = () => {
|
19602
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
19603
|
-
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.pause();
|
19604
|
-
if (!loopPlayRef.current)
|
19605
|
-
return;
|
19606
|
-
if (index === (data === null || data === void 0 ? void 0 : data.length) - 1) {
|
19607
|
-
(_c = (_b = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _b === void 0 ? void 0 : _b.swiper) === null || _c === void 0 ? void 0 : _c.slideTo(0);
|
19608
|
-
}
|
19609
|
-
else {
|
19610
|
-
const i = (_e = (_d = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _d === void 0 ? void 0 : _d.swiper) === null || _e === void 0 ? void 0 : _e.activeIndex;
|
19611
|
-
(_g = (_f = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _f === void 0 ? void 0 : _f.swiper) === null || _g === void 0 ? void 0 : _g.slideTo(i + 1);
|
19612
|
-
}
|
19613
19570
|
};
|
19614
19571
|
const handlePause = () => {
|
19615
19572
|
setIsPauseVideo(true);
|
@@ -19721,7 +19678,7 @@ var VideoWidget$1 = memo(VideoWidget);
|
|
19721
19678
|
* @Author: binruan@chatlabs.com
|
19722
19679
|
* @Date: 2025-03-25 13:54:27
|
19723
19680
|
* @LastEditors: binruan@chatlabs.com
|
19724
|
-
* @LastEditTime: 2025-04-
|
19681
|
+
* @LastEditTime: 2025-04-02 13:53:15
|
19725
19682
|
* @FilePath: \pb-sxp-ui\src\core\components\DiyStoryPreview\index.tsx
|
19726
19683
|
*
|
19727
19684
|
*/
|
@@ -20024,7 +19981,7 @@ const DiyStoryPreview = forwardRef(({ data = [], globalConfig, tipText, nudge, t
|
|
20024
19981
|
const renderLikeButton = (rec, index) => {
|
20025
19982
|
var _a, _b, _c, _d;
|
20026
19983
|
if (!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLike))
|
20027
|
-
return;
|
19984
|
+
return null;
|
20028
19985
|
let top = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconY) !== null && _a !== void 0 ? _a : 400;
|
20029
19986
|
if (top < 40) {
|
20030
19987
|
top += 40;
|
@@ -20054,12 +20011,12 @@ const DiyStoryPreview = forwardRef(({ data = [], globalConfig, tipText, nudge, t
|
|
20054
20011
|
const renderToggleButton = (visible) => {
|
20055
20012
|
var _a, _b, _c, _d;
|
20056
20013
|
if (!visible)
|
20057
|
-
return;
|
20014
|
+
return null;
|
20058
20015
|
let top = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconY) !== null && _a !== void 0 ? _a : 23;
|
20059
20016
|
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconYPosit) === 'top') {
|
20060
20017
|
top += 45;
|
20061
20018
|
}
|
20062
|
-
return (
|
20019
|
+
return (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowMute) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowMute) === true ? (React.createElement(ToggleButton$1, { style: {
|
20063
20020
|
position: 'absolute',
|
20064
20021
|
visibility: 'visible',
|
20065
20022
|
zIndex: 999,
|
@@ -20073,7 +20030,7 @@ const DiyStoryPreview = forwardRef(({ data = [], globalConfig, tipText, nudge, t
|
|
20073
20030
|
border: 'none',
|
20074
20031
|
boxSizing: 'content-box',
|
20075
20032
|
padding: 0
|
20076
|
-
}, defaultValue: true, activeIcon: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unMuteIcon) ? globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unMuteIcon : mutedIcon, unactiveIcon: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIcon) ? globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIcon : unmutedIcon }))
|
20033
|
+
}, defaultValue: true, activeIcon: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unMuteIcon) ? globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unMuteIcon : mutedIcon, unactiveIcon: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIcon) ? globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIcon : unmutedIcon })) : null;
|
20077
20034
|
};
|
20078
20035
|
const renderView = (item, index) => {
|
20079
20036
|
var _a, _b, _c, _d;
|