@cloud-app-dev/vidc 3.0.10 → 3.0.13
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/.prettierrc +1 -1
- package/.umirc.ts +1 -1
- package/clear-cache.sh +4 -0
- package/es/CustomRenderSelect/index.d.ts +1 -1
- package/es/CustomRenderSelect/index.js +8 -2
- package/es/List/DynamicGridList/index.js +4 -3
- package/es/List/DynamicList/utils.d.ts +1 -1
- package/es/List/DynamicList/utils.js +1 -1
- package/es/List/GridList/Demo.js +1 -1
- package/es/Player/api/index.d.ts +4 -4
- package/es/Player/contraller_bar/contraller_event.js +1 -1
- package/es/Player/event/errorEvent.d.ts +2 -2
- package/es/Player/event/errorEvent.js +2 -2
- package/es/Player/frontend_player.js +1 -0
- package/es/Player/live_heart.d.ts +4 -2
- package/es/Player/live_heart.js +24 -12
- package/es/Player/message.js +4 -4
- package/es/Player/player.d.ts +4 -4
- package/es/Player/single_player.js +2 -1
- package/es/Player/util.d.ts +1 -1
- package/es/Player/util.js +17 -22
- package/es/ScreenPlayer/Live.d.ts +6 -1
- package/es/ScreenPlayer/Live.js +54 -12
- package/es/ScreenPlayer/LiveTools.d.ts +3 -1
- package/es/ScreenPlayer/LiveTools.js +16 -10
- package/es/ScreenPlayer/PlayerWithExt.js +2 -2
- package/es/ScreenPlayer/Record.d.ts +1 -1
- package/es/ScreenPlayer/Record.js +43 -11
- package/es/ScreenPlayer/RecordTools.d.ts +2 -1
- package/es/ScreenPlayer/RecordTools.js +6 -4
- package/es/ScreenPlayer/SegmentTimeLine.d.ts +2 -2
- package/es/ScreenPlayer/SegmentTimeLine.js +17 -36
- package/es/ScreenPlayer/TimeSlider.d.ts +2 -2
- package/es/ScreenPlayer/TimeSlider.js +15 -15
- package/es/ScreenPlayer/demo.js +4 -4
- package/es/ScreenPlayer/demo2.js +1 -1
- package/es/ScreenPlayer/index.css +3 -0
- package/es/ScreenPlayer/interface.d.ts +19 -2
- package/es/ScreenPlayer/useTimeSlider.d.ts +22 -0
- package/es/ScreenPlayer/useTimeSlider.js +519 -0
- package/es/ScreenPlayer/utils.js +1 -1
- package/package.json +2 -2
|
@@ -142,7 +142,7 @@ export function FrontendPlayerWithExt(_ref) {
|
|
|
142
142
|
return;
|
|
143
143
|
}
|
|
144
144
|
|
|
145
|
-
var endTime = moment(
|
|
145
|
+
var endTime = moment().unix();
|
|
146
146
|
var beginTime = moment(time).unix();
|
|
147
147
|
var videoUrl = new URL(state.url);
|
|
148
148
|
videoUrl.searchParams.set('begin', "".concat(beginTime));
|
|
@@ -152,7 +152,7 @@ export function FrontendPlayerWithExt(_ref) {
|
|
|
152
152
|
url: videoUrl.toString()
|
|
153
153
|
});
|
|
154
154
|
});
|
|
155
|
-
}, [
|
|
155
|
+
}, [state.url]);
|
|
156
156
|
var ref = useRef();
|
|
157
157
|
var update = useCallback(function () {
|
|
158
158
|
return updatePlayer(ref);
|
|
@@ -6,5 +6,5 @@ import './index.less';
|
|
|
6
6
|
* @param param0
|
|
7
7
|
* @returns
|
|
8
8
|
*/
|
|
9
|
-
declare function RecordPlayer({ list, children, queryRecord, onIndexChange, onClose, onCloseAll, download }: IRecordPlayerProps): JSX.Element;
|
|
9
|
+
declare function RecordPlayer({ list, children, queryRecord, onIndexChange, onClose, onCloseAll, download, snapshot, defaultScreen, screenChange, defaultSelectIndex, }: IRecordPlayerProps): JSX.Element;
|
|
10
10
|
export default RecordPlayer;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
2
|
|
|
3
|
+
import _useUpdateEffect from "ahooks/es/useUpdateEffect";
|
|
3
4
|
import "antd/lib/message/style";
|
|
4
5
|
import _message from "antd/lib/message";
|
|
5
6
|
import _usePrevious from "ahooks/es/usePrevious";
|
|
@@ -61,9 +62,15 @@ function RecordPlayer(_ref) {
|
|
|
61
62
|
onIndexChange = _ref.onIndexChange,
|
|
62
63
|
onClose = _ref.onClose,
|
|
63
64
|
onCloseAll = _ref.onCloseAll,
|
|
64
|
-
download = _ref.download
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
download = _ref.download,
|
|
66
|
+
snapshot = _ref.snapshot,
|
|
67
|
+
defaultScreen = _ref.defaultScreen,
|
|
68
|
+
screenChange = _ref.screenChange,
|
|
69
|
+
defaultSelectIndex = _ref.defaultSelectIndex;
|
|
70
|
+
|
|
71
|
+
var _useState = useState(Object.assign(Object.assign({}, defaultState), {
|
|
72
|
+
screenNum: defaultScreen !== null && defaultScreen !== void 0 ? defaultScreen : defaultState.screenNum
|
|
73
|
+
})),
|
|
67
74
|
_useState2 = _slicedToArray(_useState, 2),
|
|
68
75
|
state = _useState2[0],
|
|
69
76
|
setState = _useState2[1];
|
|
@@ -306,18 +313,42 @@ function RecordPlayer(_ref) {
|
|
|
306
313
|
setState(function (old) {
|
|
307
314
|
return Object.assign({}, old);
|
|
308
315
|
});
|
|
309
|
-
};
|
|
310
|
-
|
|
316
|
+
};
|
|
317
|
+
/**
|
|
318
|
+
* 同步外部的selectIndex变化
|
|
319
|
+
*/
|
|
311
320
|
|
|
312
321
|
|
|
313
322
|
useEffect(function () {
|
|
314
|
-
|
|
323
|
+
if (typeof defaultSelectIndex !== 'number') {
|
|
324
|
+
return;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
setState(function (old) {
|
|
328
|
+
if (old.selectIndex !== defaultSelectIndex) {
|
|
329
|
+
return Object.assign(Object.assign({}, old), {
|
|
330
|
+
selectIndex: defaultSelectIndex
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
return old;
|
|
335
|
+
});
|
|
336
|
+
}, [defaultSelectIndex]); // index变化同步到父组件
|
|
337
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
338
|
+
|
|
339
|
+
_useUpdateEffect(function () {
|
|
340
|
+
return onIndexChange && onIndexChange(state.selectIndex);
|
|
315
341
|
}, [state.selectIndex]);
|
|
342
|
+
|
|
343
|
+
_useUpdateEffect(function () {
|
|
344
|
+
return screenChange && screenChange(state.screenNum);
|
|
345
|
+
}, [state.screenNum]);
|
|
346
|
+
|
|
316
347
|
return /*#__PURE__*/React.createElement("div", {
|
|
317
|
-
className: "split-screen-player-wrapper split-screen-player-wrapper-record"
|
|
318
|
-
ref: domRef
|
|
348
|
+
className: "split-screen-player-wrapper split-screen-player-wrapper-record"
|
|
319
349
|
}, /*#__PURE__*/React.createElement("div", {
|
|
320
|
-
className: "player-layout"
|
|
350
|
+
className: "player-layout",
|
|
351
|
+
ref: domRef
|
|
321
352
|
}, screenList.map(function (item, index) {
|
|
322
353
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
323
354
|
|
|
@@ -377,11 +408,12 @@ function RecordPlayer(_ref) {
|
|
|
377
408
|
onClose: onClose,
|
|
378
409
|
onCloseAll: onCloseAll,
|
|
379
410
|
timeMode: state.timeMode,
|
|
380
|
-
download: download
|
|
411
|
+
download: download,
|
|
412
|
+
snapshot: snapshot
|
|
381
413
|
}), /*#__PURE__*/React.createElement(SegmentTimeLine, {
|
|
382
414
|
begin: timeBegin,
|
|
383
415
|
updateState: updateState,
|
|
384
|
-
|
|
416
|
+
segments: segmentItem.segments,
|
|
385
417
|
key: state.selectIndex,
|
|
386
418
|
onTimeChange: onTimeChange,
|
|
387
419
|
timeMode: state.timeMode
|
|
@@ -19,6 +19,7 @@ interface IToolsProps {
|
|
|
19
19
|
onCloseAll?: () => void;
|
|
20
20
|
timeMode: number;
|
|
21
21
|
download?: () => void;
|
|
22
|
+
snapshot?: (base64: string) => void;
|
|
22
23
|
}
|
|
23
|
-
declare function RecordTools({ containerRef, updateState, download, screenNum, timeMode, getPlayerItem, mode, toggleFit, fit, time, onTimeChange, onClose, onCloseAll, }: IToolsProps): JSX.Element;
|
|
24
|
+
declare function RecordTools({ containerRef, updateState, download, screenNum, timeMode, getPlayerItem, mode, toggleFit, fit, time, onTimeChange, onClose, onCloseAll, snapshot, }: IToolsProps): JSX.Element;
|
|
24
25
|
export default RecordTools;
|
|
@@ -32,7 +32,8 @@ function RecordTools(_ref) {
|
|
|
32
32
|
time = _ref.time,
|
|
33
33
|
onTimeChange = _ref.onTimeChange,
|
|
34
34
|
onClose = _ref.onClose,
|
|
35
|
-
onCloseAll = _ref.onCloseAll
|
|
35
|
+
onCloseAll = _ref.onCloseAll,
|
|
36
|
+
snapshot = _ref.snapshot;
|
|
36
37
|
|
|
37
38
|
var _useFullscreen = _useFullscreen3(containerRef),
|
|
38
39
|
_useFullscreen2 = _slicedToArray(_useFullscreen, 2),
|
|
@@ -56,9 +57,10 @@ function RecordTools(_ref) {
|
|
|
56
57
|
player ? player.reload ? player.reload() : player.api.reload() : undefined;
|
|
57
58
|
};
|
|
58
59
|
|
|
59
|
-
var
|
|
60
|
+
var snapshotaction = function snapshotaction() {
|
|
60
61
|
var player = getPlayerItem();
|
|
61
|
-
|
|
62
|
+
var base64 = player ? player.api.snapshot() : undefined;
|
|
63
|
+
snapshot && snapshot(base64);
|
|
62
64
|
};
|
|
63
65
|
|
|
64
66
|
var player = getPlayerItem();
|
|
@@ -76,7 +78,7 @@ function RecordTools(_ref) {
|
|
|
76
78
|
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
77
79
|
type: "lm-player-xiangji1fill",
|
|
78
80
|
title: "\u622A\u56FE",
|
|
79
|
-
onClick:
|
|
81
|
+
onClick: snapshotaction
|
|
80
82
|
})), /*#__PURE__*/React.createElement("span", {
|
|
81
83
|
className: "player-tools-item",
|
|
82
84
|
onClick: reload
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
import { ISegmentType } from '../Player/player';
|
|
3
3
|
interface ISegmentTimeLineProps {
|
|
4
4
|
begin?: number;
|
|
5
|
-
|
|
5
|
+
segments?: ISegmentType[];
|
|
6
6
|
onTimeChange?: (time: number) => void;
|
|
7
7
|
timeMode: number;
|
|
8
8
|
updateState: (state: {
|
|
9
9
|
timeMode: number;
|
|
10
10
|
}) => void;
|
|
11
11
|
}
|
|
12
|
-
declare function SegmentTimeLine({ begin,
|
|
12
|
+
declare function SegmentTimeLine({ begin, segments, onTimeChange, timeMode, updateState }: ISegmentTimeLineProps): JSX.Element;
|
|
13
13
|
export default SegmentTimeLine;
|
|
@@ -1,59 +1,40 @@
|
|
|
1
|
-
import _useUnmount from "ahooks/es/useUnmount";
|
|
2
|
-
import _useUpdateEffect from "ahooks/es/useUpdateEffect";
|
|
3
1
|
import _useThrottleFn2 from "ahooks/es/useThrottleFn";
|
|
4
|
-
import _useSize from "ahooks/es/useSize";
|
|
5
2
|
import moment from 'moment';
|
|
6
|
-
import React, {
|
|
7
|
-
import
|
|
3
|
+
import React, { useMemo, useRef } from 'react';
|
|
4
|
+
import useTimeSlider from './useTimeSlider';
|
|
8
5
|
|
|
9
6
|
function SegmentTimeLine(_ref) {
|
|
10
7
|
var begin = _ref.begin,
|
|
11
|
-
|
|
8
|
+
segments = _ref.segments,
|
|
12
9
|
onTimeChange = _ref.onTimeChange,
|
|
13
10
|
timeMode = _ref.timeMode,
|
|
14
11
|
updateState = _ref.updateState;
|
|
15
12
|
var ref = useRef();
|
|
16
|
-
var timeSliderRef = useRef();
|
|
17
|
-
|
|
18
|
-
var size = _useSize(ref);
|
|
19
13
|
|
|
20
14
|
var _useThrottleFn = _useThrottleFn2(onTimeChange, {
|
|
21
15
|
wait: 300
|
|
22
16
|
}),
|
|
23
17
|
run = _useThrottleFn.run;
|
|
24
18
|
|
|
25
|
-
|
|
26
|
-
|
|
19
|
+
var time = useMemo(function () {
|
|
20
|
+
return begin !== null && begin !== void 0 ? begin : moment().set({
|
|
27
21
|
hours: 0,
|
|
28
22
|
minutes: 0,
|
|
29
23
|
seconds: 0
|
|
30
24
|
}).valueOf();
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}, [begin, timeCell, size === null || size === void 0 ? void 0 : size.width, run]);
|
|
44
|
-
/**
|
|
45
|
-
* hour变化更新时间轴而不是重绘
|
|
46
|
-
*/
|
|
47
|
-
|
|
48
|
-
_useUpdateEffect(function () {
|
|
49
|
-
return timeSliderRef.current.drawHourChange(timeMode);
|
|
50
|
-
}, [timeMode]);
|
|
51
|
-
|
|
52
|
-
_useUnmount(function () {
|
|
53
|
-
timeSliderRef.current.destory();
|
|
54
|
-
timeSliderRef.current = null;
|
|
25
|
+
}, [begin]);
|
|
26
|
+
useTimeSlider(ref, {
|
|
27
|
+
begin: time - timeMode / 2 * 3600 * 1000,
|
|
28
|
+
currentTime: time,
|
|
29
|
+
onTimeChange: run,
|
|
30
|
+
segments: segments,
|
|
31
|
+
hoursPer: timeMode,
|
|
32
|
+
onHoursPerChange: function onHoursPerChange(hour) {
|
|
33
|
+
return updateState({
|
|
34
|
+
timeMode: hour
|
|
35
|
+
});
|
|
36
|
+
}
|
|
55
37
|
});
|
|
56
|
-
|
|
57
38
|
return /*#__PURE__*/React.createElement("div", {
|
|
58
39
|
className: "record-time-line"
|
|
59
40
|
}, /*#__PURE__*/React.createElement("canvas", {
|
|
@@ -91,11 +91,11 @@ export default class TimeSlider {
|
|
|
91
91
|
*/
|
|
92
92
|
mousemoveFunc2: (e: MouseEvent) => void;
|
|
93
93
|
/**
|
|
94
|
-
*
|
|
94
|
+
* 点击 mouseup事件
|
|
95
95
|
*/
|
|
96
96
|
mouseupFunc: (e: MouseEvent) => void;
|
|
97
97
|
/**
|
|
98
|
-
*
|
|
98
|
+
* 拖动停止 mouseup事件
|
|
99
99
|
*/
|
|
100
100
|
mouseupFunc2: () => void;
|
|
101
101
|
/**
|
|
@@ -48,8 +48,9 @@ var TimeSlider = /*#__PURE__*/function () {
|
|
|
48
48
|
_this.g_isMousedown = true;
|
|
49
49
|
_this.g_mousedownCursor = _this.get_cursor_x_position(e); //记住mousedown的位置
|
|
50
50
|
|
|
51
|
-
document.addEventListener('mousemove', _this.mousemoveFunc);
|
|
52
|
-
|
|
51
|
+
document.addEventListener('mousemove', _this.mousemoveFunc); //拖动
|
|
52
|
+
|
|
53
|
+
document.addEventListener('mouseup', _this.mouseupFunc2); //停止拖动
|
|
53
54
|
};
|
|
54
55
|
/**
|
|
55
56
|
* 鼠标移出隐藏时间 mouseout事件
|
|
@@ -112,16 +113,12 @@ var TimeSlider = /*#__PURE__*/function () {
|
|
|
112
113
|
}
|
|
113
114
|
};
|
|
114
115
|
/**
|
|
115
|
-
*
|
|
116
|
+
* 点击 mouseup事件
|
|
116
117
|
*/
|
|
117
118
|
|
|
118
119
|
|
|
119
120
|
this.mouseupFunc = function (e) {
|
|
120
|
-
if (_this.g_isMousemove) {
|
|
121
|
-
//拖动 事件
|
|
122
|
-
_this.g_isMousemove = false;
|
|
123
|
-
_this.g_isMousedown = false; // this.returnTime = this.start_timestamp + (this.hours_per_ruler * 3600 * 1000) / 2;
|
|
124
|
-
} else {
|
|
121
|
+
if (!_this.g_isMousemove) {
|
|
125
122
|
// click 事件
|
|
126
123
|
_this.g_isMousedown = false;
|
|
127
124
|
|
|
@@ -144,11 +141,9 @@ var TimeSlider = /*#__PURE__*/function () {
|
|
|
144
141
|
|
|
145
142
|
_this.options.onTimeChange && _this.options.onTimeChange(current_timestamp, outTimeline);
|
|
146
143
|
}
|
|
147
|
-
|
|
148
|
-
document.removeEventListener('mousemove', _this.mousemoveFunc);
|
|
149
144
|
};
|
|
150
145
|
/**
|
|
151
|
-
*
|
|
146
|
+
* 拖动停止 mouseup事件
|
|
152
147
|
*/
|
|
153
148
|
|
|
154
149
|
|
|
@@ -466,10 +461,14 @@ var TimeSlider = /*#__PURE__*/function () {
|
|
|
466
461
|
}, {
|
|
467
462
|
key: "add_events",
|
|
468
463
|
value: function add_events() {
|
|
469
|
-
this.canvas.addEventListener('mousewheel', this.mousewheelFunc);
|
|
470
|
-
|
|
471
|
-
this.canvas.addEventListener('
|
|
472
|
-
|
|
464
|
+
this.canvas.addEventListener('mousewheel', this.mousewheelFunc); // 调整刻度范围
|
|
465
|
+
|
|
466
|
+
this.canvas.addEventListener('mousedown', this.mousedownFunc); // 触发 拖动或者点击标记
|
|
467
|
+
|
|
468
|
+
this.canvas.addEventListener('mousemove', this.mousemoveFunc2); //hover 提示当前刻度时间
|
|
469
|
+
|
|
470
|
+
this.canvas.addEventListener('mouseup', this.mouseupFunc); // 点击触发
|
|
471
|
+
|
|
473
472
|
this.canvas.addEventListener('mouseout', this.mouseoutFunc);
|
|
474
473
|
}
|
|
475
474
|
}, {
|
|
@@ -484,6 +483,7 @@ var TimeSlider = /*#__PURE__*/function () {
|
|
|
484
483
|
}, {
|
|
485
484
|
key: "destory",
|
|
486
485
|
value: function destory() {
|
|
486
|
+
this.clearCanvas();
|
|
487
487
|
this.remove_events();
|
|
488
488
|
this.canvas = null;
|
|
489
489
|
this.options = null;
|
package/es/ScreenPlayer/demo.js
CHANGED
|
@@ -3,16 +3,16 @@ import _ConfigProvider from "antd/lib/config-provider";
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import LivePlayer from './Live';
|
|
5
5
|
var list = [{
|
|
6
|
-
url: 'https://6a75ef90-
|
|
6
|
+
url: 'https://6a75ef90-3-server.antelopecloud.cn/flv_live?app=live&token=542446023_3356491776_1693558509_61374ba6efe326a4cb8b6bae86917a25',
|
|
7
7
|
type: 'flv'
|
|
8
8
|
}, {
|
|
9
|
-
url: 'https://
|
|
9
|
+
url: 'https://6a75ef89-1-server.antelopecloud.cn/flv_live?app=live&token=542446501_3356491776_1693535295_37062417b87df4be7dd5c02b01d87248',
|
|
10
10
|
type: 'flv'
|
|
11
11
|
}, {
|
|
12
|
-
url: 'https://6a75ef90-
|
|
12
|
+
url: 'https://6a75ef90-1-server.antelopecloud.cn/flv_live?app=live&token=542453821_3356491776_1693535323_3a90f54c141b9a246d5679678ebafe90',
|
|
13
13
|
type: 'flv'
|
|
14
14
|
}, {
|
|
15
|
-
url: 'https://6a75ef90-
|
|
15
|
+
url: 'https://6a75ef90-6-server.antelopecloud.cn/flv_live?app=live&token=542449206_3356491776_1693535342_803846974f04eb02e8115d10432d062f',
|
|
16
16
|
type: 'flv'
|
|
17
17
|
}];
|
|
18
18
|
export default function App() {
|
package/es/ScreenPlayer/demo2.js
CHANGED
|
@@ -28,7 +28,7 @@ import RecordPlayer from './Record';
|
|
|
28
28
|
import moment from 'moment';
|
|
29
29
|
import Service from '../Service';
|
|
30
30
|
import { completionSegments } from './utils';
|
|
31
|
-
var token = "eyJhbGciOiJIUzI1NiJ9.
|
|
31
|
+
var token = "eyJhbGciOiJIUzI1NiJ9.eyJvcmdhbml6YXRpb25JZCI6IjEwMDEwMTAwMDQ0NSIsImV4dCI6MTY2MjI1ODMwNzUxNSwidWlkIjoiMTAxMDAwMDAwNjk5IiwidmFsaWRTdGF0ZSI6MTA0NDA2LCJyb2xlSWQiOlsxMDAwMDAxMTA1MTgsMTAwMDAwMTEwNzI4XSwidmFsaWRUaW1lIjoxNzA0MzgzOTk5MDAwLCJvcHRDZW50ZXJJZCI6IjEwMDEwMDAwMDIzMyIsInVzZXJUeXBlIjoxMDA3MDQsImlhdCI6MTY2MTk5OTEwNzUxNX0.uk_G3vqBCFqxQM2jbV6CSN-z9YNVt_cx5nWXkSuCOIA";
|
|
32
32
|
var cids = ['538509097', '539172446'];
|
|
33
33
|
|
|
34
34
|
var query = function query(_ref) {
|
|
@@ -19,6 +19,9 @@
|
|
|
19
19
|
.split-screen-player-wrapper .player-layout .player-with-ext-layout.player-current-index .lm-player-ext-layout {
|
|
20
20
|
border: 1px solid var(--primary);
|
|
21
21
|
}
|
|
22
|
+
.split-screen-player-wrapper.split-screen-player-live-wrapper .player-layout {
|
|
23
|
+
height: calc(100% - 42px);
|
|
24
|
+
}
|
|
22
25
|
.split-screen-player-wrapper .player-tools-group {
|
|
23
26
|
height: 88px;
|
|
24
27
|
position: relative;
|
|
@@ -24,7 +24,7 @@ export interface IRecordPlayerProps {
|
|
|
24
24
|
/**
|
|
25
25
|
* 窗口索引变化,后续基于索引传入播放必要数据
|
|
26
26
|
*/
|
|
27
|
-
onIndexChange
|
|
27
|
+
onIndexChange?: (idx: number) => void;
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
30
|
* 关闭单个窗口
|
|
@@ -39,6 +39,14 @@ export interface IRecordPlayerProps {
|
|
|
39
39
|
* 录像下载回调
|
|
40
40
|
*/
|
|
41
41
|
download?: () => void;
|
|
42
|
+
|
|
43
|
+
snapshot?: (base64: string) => void;
|
|
44
|
+
|
|
45
|
+
screenChange?: (num: number) => void;
|
|
46
|
+
|
|
47
|
+
defaultScreen?: 1 | 4 | 6 | 9 | 16;
|
|
48
|
+
|
|
49
|
+
defaultSelectIndex?: number;
|
|
42
50
|
}
|
|
43
51
|
|
|
44
52
|
export interface IRecordPlayerState {
|
|
@@ -87,6 +95,7 @@ export type ScreenItemLivePlayerType = {
|
|
|
87
95
|
url?: string;
|
|
88
96
|
type?: 'flv' | 'hls' | 'native';
|
|
89
97
|
mode?: PlayModeType;
|
|
98
|
+
cid?: string;
|
|
90
99
|
};
|
|
91
100
|
|
|
92
101
|
export interface ILivePlayerProps {
|
|
@@ -105,7 +114,15 @@ export interface ILivePlayerProps {
|
|
|
105
114
|
/**
|
|
106
115
|
* 窗口索引变化,后续基于索引传入播放必要数据
|
|
107
116
|
*/
|
|
108
|
-
onIndexChange
|
|
117
|
+
onIndexChange?: (idx: number) => void;
|
|
118
|
+
|
|
119
|
+
snapshot?: (base64: string) => void;
|
|
120
|
+
|
|
121
|
+
screenChange?: (num: number) => void;
|
|
122
|
+
|
|
123
|
+
defaultScreen?: 1 | 4 | 6 | 9 | 16;
|
|
124
|
+
|
|
125
|
+
defaultSelectIndex?: number;
|
|
109
126
|
}
|
|
110
127
|
|
|
111
128
|
export interface ILivePlayerState {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { ISegmentType } from '../Player/player';
|
|
3
|
+
export interface ITimeSliderOptions {
|
|
4
|
+
hoursPer?: number;
|
|
5
|
+
begin?: number;
|
|
6
|
+
segments?: TimeCellItem[];
|
|
7
|
+
currentTime?: number;
|
|
8
|
+
onTimeChange?: (time: number, outTimeline?: boolean) => void;
|
|
9
|
+
onHoursPerChange?: (hour: number) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare type ITimeSliderState = {
|
|
12
|
+
hoursPer: number;
|
|
13
|
+
begin: number;
|
|
14
|
+
currentTime: number;
|
|
15
|
+
hover: {
|
|
16
|
+
x: number;
|
|
17
|
+
time: number;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export declare type TimeCellItem = ISegmentType;
|
|
21
|
+
declare function useTimeSlider(canvasRef: React.MutableRefObject<HTMLCanvasElement>, { hoursPer, begin, currentTime, segments, onTimeChange, onHoursPerChange }: ITimeSliderOptions): void;
|
|
22
|
+
export default useTimeSlider;
|