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
@@ -12,8 +12,10 @@ interface IVideoWidgetProps {
|
|
12
12
|
videoPostConfig?: postConfigType;
|
13
13
|
swiperRef?: any;
|
14
14
|
videoPlayIcon?: string;
|
15
|
-
|
15
|
+
onUpdateTimeLine?: (index: number, v: number) => void;
|
16
16
|
loopPlay: any;
|
17
|
+
onPlay?: (index: number, v: number) => void;
|
18
|
+
onPause?: () => void;
|
17
19
|
}
|
18
20
|
export interface IVideoWidgetRef {
|
19
21
|
play: () => void;
|
@@ -4,7 +4,7 @@ import { useIconLink } from '../SxpPageRender/useIconLink';
|
|
4
4
|
import { mountVideoPlayerAtNode } from '../SxpPageRender/VideoWidget/VideoPlayer';
|
5
5
|
import FormatImage from '../SxpPageRender/FormatImage';
|
6
6
|
import { useSxpDataSource } from '../../../core/hooks';
|
7
|
-
const VideoWidget = forwardRef(({ rec, index, height, data, muted, activeIndex, videoPostConfig, width, swiperRef, videoPlayIcon,
|
7
|
+
const VideoWidget = forwardRef(({ rec, index, height, data, muted, activeIndex, videoPostConfig, width, swiperRef, videoPlayIcon, onUpdateTimeLine, loopPlay, onPlay, onPause }, ref) => {
|
8
8
|
const { isActive } = useSwiperSlide();
|
9
9
|
const [isPauseVideo, setIsPauseVideo] = useState(false);
|
10
10
|
const videoRef = useRef(null);
|
@@ -108,15 +108,6 @@ const VideoWidget = forwardRef(({ rec, index, height, data, muted, activeIndex,
|
|
108
108
|
break;
|
109
109
|
}
|
110
110
|
}, [isLoadFinish]);
|
111
|
-
const onPause = useCallback(() => {
|
112
|
-
var _a, _b, _c, _d, _e, _f;
|
113
|
-
const item = data[index];
|
114
|
-
const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
115
|
-
const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
116
|
-
if ((_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.duration) {
|
117
|
-
const playDuration = (((_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.currentTime) - videoStartTime.current).toFixed(2);
|
118
|
-
}
|
119
|
-
}, [data, index, bffEventReport]);
|
120
111
|
const blur = useMemo(() => {
|
121
112
|
return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2';
|
122
113
|
}, [videoPostConfig]);
|
@@ -144,7 +135,7 @@ const VideoWidget = forwardRef(({ rec, index, height, data, muted, activeIndex,
|
|
144
135
|
if (!videoRef.current)
|
145
136
|
return;
|
146
137
|
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);
|
147
|
-
|
138
|
+
onUpdateTimeLine === null || onUpdateTimeLine === void 0 ? void 0 : onUpdateTimeLine(index, localTime);
|
148
139
|
setTimeout(() => {
|
149
140
|
var _a, _b;
|
150
141
|
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)) {
|
@@ -167,9 +158,15 @@ const VideoWidget = forwardRef(({ rec, index, height, data, muted, activeIndex,
|
|
167
158
|
};
|
168
159
|
const handlePause = () => {
|
169
160
|
setIsPauseVideo(true);
|
161
|
+
onPause === null || onPause === void 0 ? void 0 : onPause();
|
162
|
+
};
|
163
|
+
const handlePlay = () => {
|
164
|
+
var _a;
|
165
|
+
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);
|
166
|
+
onPlay === null || onPlay === void 0 ? void 0 : onPlay(index, localTime);
|
170
167
|
};
|
171
168
|
useEffect(() => {
|
172
|
-
var _a, _b, _c;
|
169
|
+
var _a, _b, _c, _d;
|
173
170
|
if (!isActive)
|
174
171
|
return;
|
175
172
|
const videoSrc = rec === null || rec === void 0 ? void 0 : rec.mediaUrl;
|
@@ -199,15 +196,17 @@ const VideoWidget = forwardRef(({ rec, index, height, data, muted, activeIndex,
|
|
199
196
|
}
|
200
197
|
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener('loadedmetadata', handleLoadedMetadata);
|
201
198
|
(_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.addEventListener('pause', handlePause);
|
202
|
-
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.addEventListener('
|
199
|
+
(_c = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _c === void 0 ? void 0 : _c.addEventListener('play', handlePlay);
|
200
|
+
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.addEventListener('timeupdate', handleTimeUpload);
|
203
201
|
return () => {
|
204
|
-
var _a, _b, _c, _d;
|
202
|
+
var _a, _b, _c, _d, _e;
|
205
203
|
if (hlsRef === null || hlsRef === void 0 ? void 0 : hlsRef.current)
|
206
204
|
(_a = hlsRef === null || hlsRef === void 0 ? void 0 : hlsRef.current) === null || _a === void 0 ? void 0 : _a.destroy();
|
207
205
|
setIsLoadFinish(false);
|
208
206
|
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('loadedmetadata', handleLoadedMetadata);
|
209
207
|
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('pause', handlePause);
|
210
|
-
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.removeEventListener('
|
208
|
+
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.removeEventListener('play', handlePlay);
|
209
|
+
(_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.removeEventListener('timeupdate', handleTimeUpload);
|
211
210
|
};
|
212
211
|
}, [isActive]);
|
213
212
|
const renderPoster = useMemo(() => {
|
@@ -26,6 +26,8 @@ export type DiyStoryPreviewType = ISxpPageRenderProps & {
|
|
26
26
|
loopPlay?: boolean;
|
27
27
|
pointerEvents?: any;
|
28
28
|
onUpdateTimeLine: (index: number, curTime: number) => void;
|
29
|
+
onPlay: (index: number, curTime: number) => void;
|
30
|
+
onPause: () => void;
|
29
31
|
disabledListener?: boolean;
|
30
32
|
};
|
31
33
|
export interface IDiyStoryPreviewRef {
|
@@ -33,7 +35,6 @@ export interface IDiyStoryPreviewRef {
|
|
33
35
|
pause: () => void;
|
34
36
|
slideTo: (n: number) => void;
|
35
37
|
isPlaying: () => boolean;
|
36
|
-
setLoopPlay: (v: boolean) => void;
|
37
38
|
}
|
38
39
|
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<ISxpPageRenderProps & {
|
39
40
|
appDomain?: string | undefined;
|
@@ -43,6 +44,8 @@ declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponen
|
|
43
44
|
loopPlay?: boolean | undefined;
|
44
45
|
pointerEvents?: any;
|
45
46
|
onUpdateTimeLine: (index: number, curTime: number) => void;
|
47
|
+
onPlay: (index: number, curTime: number) => void;
|
48
|
+
onPause: () => void;
|
46
49
|
disabledListener?: boolean | undefined;
|
47
50
|
} & React.RefAttributes<IDiyStoryPreviewRef>>>;
|
48
51
|
export default _default;
|
@@ -194,7 +194,7 @@ Object.values(_materials_).forEach((v) => {
|
|
194
194
|
});
|
195
195
|
const defaultUnLikeIconPath = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
|
196
196
|
const defaultLikeIconPath = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
|
197
|
-
const DiyStoryPreview = forwardRef(({ data = [], globalConfig, tipText, nudge, tempMap, descStyle, hashTagStyle, containerHeight = 664, containerWidth = 375, appDomain, tagList = [], scenes, onActiveChange, activeIndex, loopPlay = false, pointerEvents = 'none', onUpdateTimeLine, disabledListener }, ref) => {
|
197
|
+
const DiyStoryPreview = 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) => {
|
198
198
|
const videoWidgetRef = useRef(null);
|
199
199
|
const swiperRef = useRef(null);
|
200
200
|
const [curIndex, setCurIndex] = useState(0);
|
@@ -227,10 +227,6 @@ const DiyStoryPreview = forwardRef(({ data = [], globalConfig, tipText, nudge, t
|
|
227
227
|
isPlaying() {
|
228
228
|
var _a, _b;
|
229
229
|
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;
|
230
|
-
},
|
231
|
-
setLoopPlay(v) {
|
232
|
-
var _a;
|
233
|
-
(_a = videoWidgetRef === null || videoWidgetRef === void 0 ? void 0 : videoWidgetRef.current) === null || _a === void 0 ? void 0 : _a.setLoopPlay(v);
|
234
230
|
}
|
235
231
|
};
|
236
232
|
});
|
@@ -247,7 +243,7 @@ const DiyStoryPreview = forwardRef(({ data = [], globalConfig, tipText, nudge, t
|
|
247
243
|
const renderContent = (rec, index) => {
|
248
244
|
const isVideo = isVideoUrl(rec === null || rec === void 0 ? void 0 : rec.mediaUrl);
|
249
245
|
if (isVideo) {
|
250
|
-
return (React.createElement(VideoWidget, 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,
|
246
|
+
return (React.createElement(VideoWidget, 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 })));
|
251
247
|
}
|
252
248
|
else {
|
253
249
|
return (React.createElement(PictureGroup, { 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 }));
|
@@ -12,8 +12,10 @@ interface IVideoWidgetProps {
|
|
12
12
|
videoPostConfig?: postConfigType;
|
13
13
|
swiperRef?: any;
|
14
14
|
videoPlayIcon?: string;
|
15
|
-
|
15
|
+
onUpdateTimeLine?: (index: number, v: number) => void;
|
16
16
|
loopPlay: any;
|
17
|
+
onPlay?: (index: number, v: number) => void;
|
18
|
+
onPause?: () => void;
|
17
19
|
}
|
18
20
|
export interface IVideoWidgetRef {
|
19
21
|
play: () => void;
|
@@ -7,7 +7,7 @@ const useIconLink_1 = require("../SxpPageRender/useIconLink");
|
|
7
7
|
const VideoPlayer_1 = require("../SxpPageRender/VideoWidget/VideoPlayer");
|
8
8
|
const FormatImage_1 = tslib_1.__importDefault(require("../SxpPageRender/FormatImage"));
|
9
9
|
const hooks_1 = require("../../../core/hooks");
|
10
|
-
const VideoWidget = (0, react_1.forwardRef)(({ rec, index, height, data, muted, activeIndex, videoPostConfig, width, swiperRef, videoPlayIcon,
|
10
|
+
const VideoWidget = (0, react_1.forwardRef)(({ rec, index, height, data, muted, activeIndex, videoPostConfig, width, swiperRef, videoPlayIcon, onUpdateTimeLine, loopPlay, onPlay, onPause }, ref) => {
|
11
11
|
const { isActive } = (0, react_2.useSwiperSlide)();
|
12
12
|
const [isPauseVideo, setIsPauseVideo] = (0, react_1.useState)(false);
|
13
13
|
const videoRef = (0, react_1.useRef)(null);
|
@@ -111,15 +111,6 @@ const VideoWidget = (0, react_1.forwardRef)(({ rec, index, height, data, muted,
|
|
111
111
|
break;
|
112
112
|
}
|
113
113
|
}, [isLoadFinish]);
|
114
|
-
const onPause = (0, react_1.useCallback)(() => {
|
115
|
-
var _a, _b, _c, _d, _e, _f;
|
116
|
-
const item = data[index];
|
117
|
-
const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
118
|
-
const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
119
|
-
if ((_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.duration) {
|
120
|
-
const playDuration = (((_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.currentTime) - videoStartTime.current).toFixed(2);
|
121
|
-
}
|
122
|
-
}, [data, index, bffEventReport]);
|
123
114
|
const blur = (0, react_1.useMemo)(() => {
|
124
115
|
return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2';
|
125
116
|
}, [videoPostConfig]);
|
@@ -147,7 +138,7 @@ const VideoWidget = (0, react_1.forwardRef)(({ rec, index, height, data, muted,
|
|
147
138
|
if (!videoRef.current)
|
148
139
|
return;
|
149
140
|
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);
|
150
|
-
|
141
|
+
onUpdateTimeLine === null || onUpdateTimeLine === void 0 ? void 0 : onUpdateTimeLine(index, localTime);
|
151
142
|
setTimeout(() => {
|
152
143
|
var _a, _b;
|
153
144
|
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)) {
|
@@ -170,9 +161,15 @@ const VideoWidget = (0, react_1.forwardRef)(({ rec, index, height, data, muted,
|
|
170
161
|
};
|
171
162
|
const handlePause = () => {
|
172
163
|
setIsPauseVideo(true);
|
164
|
+
onPause === null || onPause === void 0 ? void 0 : onPause();
|
165
|
+
};
|
166
|
+
const handlePlay = () => {
|
167
|
+
var _a;
|
168
|
+
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);
|
169
|
+
onPlay === null || onPlay === void 0 ? void 0 : onPlay(index, localTime);
|
173
170
|
};
|
174
171
|
(0, react_1.useEffect)(() => {
|
175
|
-
var _a, _b, _c;
|
172
|
+
var _a, _b, _c, _d;
|
176
173
|
if (!isActive)
|
177
174
|
return;
|
178
175
|
const videoSrc = rec === null || rec === void 0 ? void 0 : rec.mediaUrl;
|
@@ -202,15 +199,17 @@ const VideoWidget = (0, react_1.forwardRef)(({ rec, index, height, data, muted,
|
|
202
199
|
}
|
203
200
|
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener('loadedmetadata', handleLoadedMetadata);
|
204
201
|
(_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.addEventListener('pause', handlePause);
|
205
|
-
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.addEventListener('
|
202
|
+
(_c = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _c === void 0 ? void 0 : _c.addEventListener('play', handlePlay);
|
203
|
+
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.addEventListener('timeupdate', handleTimeUpload);
|
206
204
|
return () => {
|
207
|
-
var _a, _b, _c, _d;
|
205
|
+
var _a, _b, _c, _d, _e;
|
208
206
|
if (hlsRef === null || hlsRef === void 0 ? void 0 : hlsRef.current)
|
209
207
|
(_a = hlsRef === null || hlsRef === void 0 ? void 0 : hlsRef.current) === null || _a === void 0 ? void 0 : _a.destroy();
|
210
208
|
setIsLoadFinish(false);
|
211
209
|
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('loadedmetadata', handleLoadedMetadata);
|
212
210
|
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('pause', handlePause);
|
213
|
-
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.removeEventListener('
|
211
|
+
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.removeEventListener('play', handlePlay);
|
212
|
+
(_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.removeEventListener('timeupdate', handleTimeUpload);
|
214
213
|
};
|
215
214
|
}, [isActive]);
|
216
215
|
const renderPoster = (0, react_1.useMemo)(() => {
|
@@ -26,6 +26,8 @@ export type DiyStoryPreviewType = ISxpPageRenderProps & {
|
|
26
26
|
loopPlay?: boolean;
|
27
27
|
pointerEvents?: any;
|
28
28
|
onUpdateTimeLine: (index: number, curTime: number) => void;
|
29
|
+
onPlay: (index: number, curTime: number) => void;
|
30
|
+
onPause: () => void;
|
29
31
|
disabledListener?: boolean;
|
30
32
|
};
|
31
33
|
export interface IDiyStoryPreviewRef {
|
@@ -33,7 +35,6 @@ export interface IDiyStoryPreviewRef {
|
|
33
35
|
pause: () => void;
|
34
36
|
slideTo: (n: number) => void;
|
35
37
|
isPlaying: () => boolean;
|
36
|
-
setLoopPlay: (v: boolean) => void;
|
37
38
|
}
|
38
39
|
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<ISxpPageRenderProps & {
|
39
40
|
appDomain?: string | undefined;
|
@@ -43,6 +44,8 @@ declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponen
|
|
43
44
|
loopPlay?: boolean | undefined;
|
44
45
|
pointerEvents?: any;
|
45
46
|
onUpdateTimeLine: (index: number, curTime: number) => void;
|
47
|
+
onPlay: (index: number, curTime: number) => void;
|
48
|
+
onPause: () => void;
|
46
49
|
disabledListener?: boolean | undefined;
|
47
50
|
} & React.RefAttributes<IDiyStoryPreviewRef>>>;
|
48
51
|
export default _default;
|
@@ -197,7 +197,7 @@ Object.values(_materials_).forEach((v) => {
|
|
197
197
|
});
|
198
198
|
const defaultUnLikeIconPath = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
|
199
199
|
const defaultLikeIconPath = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
|
200
|
-
const DiyStoryPreview = (0, react_1.forwardRef)(({ data = [], globalConfig, tipText, nudge, tempMap, descStyle, hashTagStyle, containerHeight = 664, containerWidth = 375, appDomain, tagList = [], scenes, onActiveChange, activeIndex, loopPlay = false, pointerEvents = 'none', onUpdateTimeLine, disabledListener }, ref) => {
|
200
|
+
const DiyStoryPreview = (0, react_1.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) => {
|
201
201
|
const videoWidgetRef = (0, react_1.useRef)(null);
|
202
202
|
const swiperRef = (0, react_1.useRef)(null);
|
203
203
|
const [curIndex, setCurIndex] = (0, react_1.useState)(0);
|
@@ -230,10 +230,6 @@ const DiyStoryPreview = (0, react_1.forwardRef)(({ data = [], globalConfig, tipT
|
|
230
230
|
isPlaying() {
|
231
231
|
var _a, _b;
|
232
232
|
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;
|
233
|
-
},
|
234
|
-
setLoopPlay(v) {
|
235
|
-
var _a;
|
236
|
-
(_a = videoWidgetRef === null || videoWidgetRef === void 0 ? void 0 : videoWidgetRef.current) === null || _a === void 0 ? void 0 : _a.setLoopPlay(v);
|
237
233
|
}
|
238
234
|
};
|
239
235
|
});
|
@@ -250,7 +246,7 @@ const DiyStoryPreview = (0, react_1.forwardRef)(({ data = [], globalConfig, tipT
|
|
250
246
|
const renderContent = (rec, index) => {
|
251
247
|
const isVideo = isVideoUrl(rec === null || rec === void 0 ? void 0 : rec.mediaUrl);
|
252
248
|
if (isVideo) {
|
253
|
-
return (react_1.default.createElement(VideoWidget_1.default, 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,
|
249
|
+
return (react_1.default.createElement(VideoWidget_1.default, 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 })));
|
254
250
|
}
|
255
251
|
else {
|
256
252
|
return (react_1.default.createElement(PictureGroup_1.default, { 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 }));
|