@cloud-app-dev/vidc 3.0.8 → 3.0.11
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 +3 -2
- package/clear-cache.sh +4 -0
- package/es/CustomRenderSelect/index.css +20 -0
- package/es/CustomRenderSelect/index.d.ts +10 -0
- package/es/CustomRenderSelect/index.js +73 -0
- 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/demo.js +36 -12
- package/es/Player/event/errorEvent.d.ts +2 -2
- package/es/Player/event/errorEvent.js +2 -2
- 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/segment_player.js +1 -0
- package/es/Player/segment_timeline.d.ts +2 -1
- package/es/Player/segment_timeline.js +7 -12
- package/es/Player/single_player.js +2 -1
- package/es/Player/style/iconfont.css +150 -33
- package/es/Player/style/iconfont.ttf +0 -0
- package/es/Player/style/iconfont.woff +0 -0
- package/es/Player/style/iconfont.woff2 +0 -0
- package/es/Player/util.d.ts +1 -1
- package/es/Player/util.js +17 -22
- package/es/ScreenPlayer/Live.d.ts +1 -1
- package/es/ScreenPlayer/Live.js +67 -14
- package/es/ScreenPlayer/LiveTools.d.ts +3 -1
- package/es/ScreenPlayer/LiveTools.js +69 -33
- package/es/ScreenPlayer/PlayerWithExt.d.ts +2 -2
- package/es/ScreenPlayer/PlayerWithExt.js +3 -2
- package/es/ScreenPlayer/Record.d.ts +1 -1
- package/es/ScreenPlayer/Record.js +65 -31
- package/es/ScreenPlayer/RecordTools.d.ts +2 -1
- package/es/ScreenPlayer/RecordTools.js +46 -36
- package/es/ScreenPlayer/ScreenSelect.js +41 -20
- package/es/ScreenPlayer/TimeMode.js +8 -2
- package/es/ScreenPlayer/TimeSlider.js +3 -2
- package/es/ScreenPlayer/demo.js +4 -4
- package/es/ScreenPlayer/demo2.js +1 -1
- package/es/ScreenPlayer/index.css +29 -10
- package/es/ScreenPlayer/interface.d.ts +24 -4
- package/es/ScreenPlayer/utils.d.ts +1 -0
- package/es/ScreenPlayer/utils.js +17 -8
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/package.json +2 -2
- package/release-build.sh +3 -0
|
@@ -69,7 +69,8 @@ export function SegmentPlayerWithExt(_a) {
|
|
|
69
69
|
segments = _a.segments,
|
|
70
70
|
updatePlayer = _a.updatePlayer,
|
|
71
71
|
onClick = _a.onClick,
|
|
72
|
-
|
|
72
|
+
mode = _a.mode,
|
|
73
|
+
props = __rest(_a, ["begin", "style", "className", "segments", "updatePlayer", "onClick", "mode"]);
|
|
73
74
|
|
|
74
75
|
var ref = useRef();
|
|
75
76
|
var update = useCallback(function () {
|
|
@@ -87,7 +88,7 @@ export function SegmentPlayerWithExt(_a) {
|
|
|
87
88
|
onDoubleClick: toggleFullscreen
|
|
88
89
|
}, /*#__PURE__*/React.createElement(ExtModel, {
|
|
89
90
|
segments: segments,
|
|
90
|
-
mode:
|
|
91
|
+
mode: mode
|
|
91
92
|
}, /*#__PURE__*/React.createElement(SegmentPlayer, Object.assign({}, props, {
|
|
92
93
|
segments: segments,
|
|
93
94
|
type: "hls",
|
|
@@ -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 }: 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";
|
|
@@ -36,6 +37,16 @@ import useRecordList from './useRecordList';
|
|
|
36
37
|
import useVideoFit from './useVideoFit';
|
|
37
38
|
import DisableMark from '../DisableMark';
|
|
38
39
|
import "./index.css";
|
|
40
|
+
var defaultState = {
|
|
41
|
+
screenNum: 4,
|
|
42
|
+
selectIndex: 0,
|
|
43
|
+
modes: [],
|
|
44
|
+
currentTimes: [],
|
|
45
|
+
loading: false,
|
|
46
|
+
seekTo: 0,
|
|
47
|
+
mergeSegments: [],
|
|
48
|
+
timeMode: 24
|
|
49
|
+
};
|
|
39
50
|
/**
|
|
40
51
|
* @desc 录像设计的时间全部需要到毫秒
|
|
41
52
|
* @param param0
|
|
@@ -50,18 +61,16 @@ function RecordPlayer(_ref) {
|
|
|
50
61
|
queryRecord = _ref.queryRecord,
|
|
51
62
|
onIndexChange = _ref.onIndexChange,
|
|
52
63
|
onClose = _ref.onClose,
|
|
53
|
-
onCloseAll = _ref.onCloseAll
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
timeMode: 24
|
|
64
|
-
}),
|
|
64
|
+
onCloseAll = _ref.onCloseAll,
|
|
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
|
+
})),
|
|
65
74
|
_useState2 = _slicedToArray(_useState, 2),
|
|
66
75
|
state = _useState2[0],
|
|
67
76
|
setState = _useState2[1];
|
|
@@ -113,11 +122,6 @@ function RecordPlayer(_ref) {
|
|
|
113
122
|
|
|
114
123
|
return (_a = state.currentTimes[state.selectIndex]) !== null && _a !== void 0 ? _a : segmentItem.date;
|
|
115
124
|
}, [segmentItem.date, state.currentTimes, state.selectIndex]);
|
|
116
|
-
/**
|
|
117
|
-
* 专门
|
|
118
|
-
*/
|
|
119
|
-
|
|
120
|
-
useEffect(function () {}, [fit]);
|
|
121
125
|
/**
|
|
122
126
|
* @desc 用户缓存接收list的变化。
|
|
123
127
|
*/
|
|
@@ -202,7 +206,10 @@ function RecordPlayer(_ref) {
|
|
|
202
206
|
}
|
|
203
207
|
|
|
204
208
|
if (newState.hasOwnProperty('mode')) {
|
|
205
|
-
|
|
209
|
+
var newModes = _toConsumableArray(state.modes);
|
|
210
|
+
|
|
211
|
+
newModes[state.selectIndex] = newState.mode;
|
|
212
|
+
obj.modes = newModes;
|
|
206
213
|
}
|
|
207
214
|
|
|
208
215
|
if (newState.hasOwnProperty('timeMode')) {
|
|
@@ -306,20 +313,44 @@ 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
|
-
var _a, _b, _c, _d, _e, _f;
|
|
353
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
323
354
|
|
|
324
355
|
return item.recordType === 1 ? /*#__PURE__*/React.createElement(SegmentPlayerWithExt, Object.assign({}, item, {
|
|
325
356
|
segments: ((_a = recordList[index]) === null || _a === void 0 ? void 0 : _a.segments) || [],
|
|
@@ -338,10 +369,11 @@ function RecordPlayer(_ref) {
|
|
|
338
369
|
style: {
|
|
339
370
|
width: screenType.width,
|
|
340
371
|
height: screenType.height
|
|
341
|
-
}
|
|
372
|
+
},
|
|
373
|
+
mode: (_d = item.mode) !== null && _d !== void 0 ? _d : state.modes[index]
|
|
342
374
|
})) : /*#__PURE__*/React.createElement(FrontendPlayerWithExt, Object.assign({}, item, {
|
|
343
375
|
className: state.selectIndex === index ? 'player-current-index' : '',
|
|
344
|
-
segments: ((
|
|
376
|
+
segments: ((_e = recordList[index]) === null || _e === void 0 ? void 0 : _e.segments) || [],
|
|
345
377
|
updatePlayer: function updatePlayer(player) {
|
|
346
378
|
return _updatePlayer(player, index);
|
|
347
379
|
},
|
|
@@ -352,8 +384,8 @@ function RecordPlayer(_ref) {
|
|
|
352
384
|
});
|
|
353
385
|
});
|
|
354
386
|
},
|
|
355
|
-
mode: state.
|
|
356
|
-
key: "".concat((
|
|
387
|
+
mode: (_f = item.mode) !== null && _f !== void 0 ? _f : state.modes[index],
|
|
388
|
+
key: "".concat((_g = item === null || item === void 0 ? void 0 : item.date) !== null && _g !== void 0 ? _g : '', "-").concat((_h = item.cid) !== null && _h !== void 0 ? _h : '', "-").concat(index),
|
|
357
389
|
style: {
|
|
358
390
|
width: screenType.width,
|
|
359
391
|
height: screenType.height
|
|
@@ -369,13 +401,15 @@ function RecordPlayer(_ref) {
|
|
|
369
401
|
toggleFit: toggleFit,
|
|
370
402
|
getPlayerItem: getPlayerItem,
|
|
371
403
|
screenNum: state.screenNum,
|
|
372
|
-
mode: state.
|
|
404
|
+
mode: state.modes[state.selectIndex],
|
|
373
405
|
containerRef: domRef,
|
|
374
406
|
updateState: updateState,
|
|
375
407
|
onTimeChange: onTimeChange,
|
|
376
408
|
onClose: onClose,
|
|
377
409
|
onCloseAll: onCloseAll,
|
|
378
|
-
timeMode: state.timeMode
|
|
410
|
+
timeMode: state.timeMode,
|
|
411
|
+
download: download,
|
|
412
|
+
snapshot: snapshot
|
|
379
413
|
}), /*#__PURE__*/React.createElement(SegmentTimeLine, {
|
|
380
414
|
begin: timeBegin,
|
|
381
415
|
updateState: updateState,
|
|
@@ -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
|
|
@@ -85,38 +87,56 @@ function RecordTools(_ref) {
|
|
|
85
87
|
title: "\u91CD\u8F7D"
|
|
86
88
|
})), /*#__PURE__*/React.createElement("span", {
|
|
87
89
|
className: "player-tools-item",
|
|
88
|
-
onClick:
|
|
90
|
+
onClick: download
|
|
89
91
|
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
90
|
-
type: "lm-player-
|
|
91
|
-
title: "\
|
|
92
|
+
type: "lm-player-xiazai",
|
|
93
|
+
title: "\u4E0B\u8F7D\u5F53\u524D\u5F55\u50CF"
|
|
92
94
|
})), /*#__PURE__*/React.createElement("span", {
|
|
93
95
|
className: "player-tools-item",
|
|
94
|
-
onClick:
|
|
96
|
+
onClick: function onClick() {
|
|
97
|
+
return updateState({
|
|
98
|
+
mode: mode !== 2 ? 2 : 1
|
|
99
|
+
});
|
|
100
|
+
}
|
|
95
101
|
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
96
|
-
|
|
97
|
-
|
|
102
|
+
style: {
|
|
103
|
+
top: 2,
|
|
104
|
+
position: 'relative',
|
|
105
|
+
left: 1
|
|
106
|
+
},
|
|
107
|
+
type: "lm-player-S_Device_shezhi",
|
|
108
|
+
title: "\u5207\u6362".concat(mode === 1 ? '插件' : '浏览器', "\u6A21\u5F0F")
|
|
98
109
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
99
110
|
className: "player-tools-mid"
|
|
100
|
-
}, /*#__PURE__*/React.createElement("
|
|
111
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
101
112
|
className: "player-tools-item",
|
|
102
|
-
onClick:
|
|
103
|
-
},
|
|
104
|
-
type: "lm-player-
|
|
105
|
-
title: "\
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
113
|
+
onClick: onClose
|
|
114
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
115
|
+
type: "lm-player-tingzhi",
|
|
116
|
+
title: "\u505C\u6B62",
|
|
117
|
+
style: {
|
|
118
|
+
fontSize: 16
|
|
119
|
+
}
|
|
109
120
|
})), /*#__PURE__*/React.createElement(TimeSelect, {
|
|
110
121
|
time: time,
|
|
111
122
|
onChange: onTimeChange
|
|
112
|
-
}), /*#__PURE__*/React.createElement("
|
|
123
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
113
124
|
className: "player-tools-item",
|
|
114
125
|
onClick: playToggle
|
|
115
126
|
}, player && !player.video.paused ? /*#__PURE__*/React.createElement(IconFont, {
|
|
116
127
|
type: "lm-player-Pause_Main",
|
|
117
|
-
title: "\u6682\u505C"
|
|
128
|
+
title: "\u6682\u505C",
|
|
129
|
+
style: {
|
|
130
|
+
fontSize: 22
|
|
131
|
+
}
|
|
118
132
|
}) : /*#__PURE__*/React.createElement(IconFont, {
|
|
119
|
-
|
|
133
|
+
style: {
|
|
134
|
+
fontSize: 17,
|
|
135
|
+
position: 'relative',
|
|
136
|
+
left: 2,
|
|
137
|
+
top: 2
|
|
138
|
+
},
|
|
139
|
+
type: "lm-player-bofang",
|
|
120
140
|
title: "\u64AD\u653E"
|
|
121
141
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
122
142
|
className: "player-tools-right"
|
|
@@ -124,26 +144,16 @@ function RecordTools(_ref) {
|
|
|
124
144
|
className: "player-tools-item",
|
|
125
145
|
onClick: onCloseAll
|
|
126
146
|
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
127
|
-
type: "lm-player-
|
|
147
|
+
type: "lm-player-quanbuguanbi",
|
|
128
148
|
title: "\u5173\u95ED\u6240\u6709"
|
|
129
|
-
})), /*#__PURE__*/React.createElement("span", {
|
|
130
|
-
className: "player-tools-item",
|
|
131
|
-
onClick: function onClick() {
|
|
132
|
-
return updateState({
|
|
133
|
-
mode: mode === 1 ? 2 : 1
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
137
|
-
type: "lm-player-YesorNo_No_Dark",
|
|
138
|
-
title: "\u5207\u6362".concat(mode === 1 ? '插件' : '浏览器', "\u6A21\u5F0F")
|
|
139
149
|
})), /*#__PURE__*/React.createElement("span", {
|
|
140
150
|
className: "player-tools-item",
|
|
141
151
|
onClick: toggleFit
|
|
142
152
|
}, fit === 'fill' ? /*#__PURE__*/React.createElement(IconFont, {
|
|
143
|
-
type: "lm-player-
|
|
153
|
+
type: "lm-player-huamianshiying",
|
|
144
154
|
title: "\u81EA\u9002\u5E94"
|
|
145
155
|
}) : /*#__PURE__*/React.createElement(IconFont, {
|
|
146
|
-
type: "lm-player-
|
|
156
|
+
type: "lm-player-huamianshiying",
|
|
147
157
|
title: "\u586B\u5145"
|
|
148
158
|
})), /*#__PURE__*/React.createElement(ScreenSelect, {
|
|
149
159
|
screenNum: screenNum,
|
|
@@ -152,10 +162,10 @@ function RecordTools(_ref) {
|
|
|
152
162
|
className: "player-tools-item",
|
|
153
163
|
onClick: toggleFullscreen
|
|
154
164
|
}, isFullscreen ? /*#__PURE__*/React.createElement(IconFont, {
|
|
155
|
-
type: "lm-player-
|
|
165
|
+
type: "lm-player-quanping",
|
|
156
166
|
title: "\u5168\u5C4F"
|
|
157
167
|
}) : /*#__PURE__*/React.createElement(IconFont, {
|
|
158
|
-
type: "lm-player-
|
|
168
|
+
type: "lm-player-quanping",
|
|
159
169
|
title: "\u5168\u5C4F"
|
|
160
170
|
})), /*#__PURE__*/React.createElement(TimeMode, {
|
|
161
171
|
timeMode: timeMode,
|
|
@@ -1,28 +1,49 @@
|
|
|
1
|
-
import "antd/lib/
|
|
2
|
-
import
|
|
3
|
-
import React from 'react';
|
|
1
|
+
import "antd/lib/select/style";
|
|
2
|
+
import _Select from "antd/lib/select";
|
|
3
|
+
import React, { useMemo } from 'react';
|
|
4
|
+
import CustomRenderSelect from '../CustomRenderSelect';
|
|
4
5
|
import { ScreenType } from './utils';
|
|
6
|
+
import IconFont from '../Player/iconfont';
|
|
5
7
|
|
|
6
8
|
function ScreenSelect(_ref) {
|
|
7
9
|
var screenNum = _ref.screenNum,
|
|
8
10
|
updateState = _ref.updateState;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
return
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
11
|
+
var icon = useMemo(function () {
|
|
12
|
+
return ScreenType.find(function (v) {
|
|
13
|
+
return v.name === screenNum;
|
|
14
|
+
}).icon;
|
|
15
|
+
}, []);
|
|
16
|
+
return /*#__PURE__*/React.createElement(CustomRenderSelect, {
|
|
17
|
+
value: screenNum,
|
|
18
|
+
dropdownClassName: "custom-select-dropdown ",
|
|
19
|
+
customRender: function customRender() {
|
|
20
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
21
|
+
className: "select-current-screen-item"
|
|
22
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
23
|
+
type: icon
|
|
24
|
+
}));
|
|
25
|
+
},
|
|
26
|
+
onChange: function onChange(v) {
|
|
27
|
+
return updateState({
|
|
28
|
+
screenNum: v
|
|
29
|
+
});
|
|
30
|
+
},
|
|
31
|
+
placement: "topLeft"
|
|
32
|
+
}, ScreenType.map(function (item) {
|
|
33
|
+
return /*#__PURE__*/React.createElement(_Select.Option, {
|
|
34
|
+
key: "".concat(item.name),
|
|
35
|
+
value: item.name
|
|
36
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
37
|
+
style: {
|
|
38
|
+
paddingRight: 4,
|
|
39
|
+
color: 'var(--icon)',
|
|
40
|
+
position: 'relative',
|
|
41
|
+
top: 1
|
|
42
|
+
}
|
|
43
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
44
|
+
type: item.icon
|
|
45
|
+
})), item.name, "\u5206\u5C4F");
|
|
46
|
+
}));
|
|
26
47
|
}
|
|
27
48
|
|
|
28
49
|
export default ScreenSelect;
|
|
@@ -10,13 +10,19 @@ function TimeMode(_ref) {
|
|
|
10
10
|
value: timeMode,
|
|
11
11
|
onChange: onChange,
|
|
12
12
|
className: "time-mode-select",
|
|
13
|
-
dropdownClassName: "
|
|
13
|
+
dropdownClassName: "custom-select-dropdown",
|
|
14
14
|
placement: "topLeft"
|
|
15
15
|
}, TimeModeLibs.map(function (item) {
|
|
16
16
|
return /*#__PURE__*/React.createElement(_Select.Option, {
|
|
17
17
|
value: item.name,
|
|
18
18
|
key: item.name
|
|
19
|
-
},
|
|
19
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
20
|
+
style: {
|
|
21
|
+
display: 'inline-block',
|
|
22
|
+
width: 20,
|
|
23
|
+
textAlign: 'center'
|
|
24
|
+
}
|
|
25
|
+
}, item.name), "\u5C0F\u65F6");
|
|
20
26
|
}));
|
|
21
27
|
}
|
|
22
28
|
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import _nextTick from "@cloud-app-dev/utils/es/nextTick";
|
|
2
|
+
|
|
1
3
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
2
4
|
|
|
3
5
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
@@ -5,7 +7,6 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
|
|
|
5
7
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
6
8
|
|
|
7
9
|
import moment from 'moment';
|
|
8
|
-
import { nextTick } from 'process';
|
|
9
10
|
var hours = [1, 6, 12, 24];
|
|
10
11
|
var currentColor = '#FF000A';
|
|
11
12
|
var normalLineColor = '#ffffff';
|
|
@@ -202,7 +203,7 @@ var TimeSlider = /*#__PURE__*/function () {
|
|
|
202
203
|
_this.hours_per_ruler = _this.zoom;
|
|
203
204
|
}
|
|
204
205
|
|
|
205
|
-
|
|
206
|
+
_nextTick(function () {
|
|
206
207
|
return _this.options.onHoursPerChange && _this.options.onHoursPerChange(_this.hours_per_ruler);
|
|
207
208
|
});
|
|
208
209
|
|
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_1693469173_b34efba891f35a66b227642f66272534',
|
|
7
7
|
type: 'flv'
|
|
8
8
|
}, {
|
|
9
|
-
url: 'https://6a75ef90-
|
|
9
|
+
url: 'https://6a75ef90-3-server.antelopecloud.cn/flv_live?app=live&token=542446023_3356491776_1693469173_b34efba891f35a66b227642f66272534',
|
|
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://
|
|
15
|
+
url: 'https://6a75ef88-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,13 +19,14 @@
|
|
|
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;
|
|
25
28
|
}
|
|
26
29
|
.split-screen-player-wrapper .player-record-time {
|
|
27
|
-
width: 100%;
|
|
28
|
-
height: 100%;
|
|
29
30
|
text-align: center;
|
|
30
31
|
background-color: var(--gray11);
|
|
31
32
|
line-height: 42px;
|
|
@@ -69,7 +70,8 @@
|
|
|
69
70
|
color: var(--gray1);
|
|
70
71
|
text-align: center;
|
|
71
72
|
cursor: pointer;
|
|
72
|
-
margin-right:
|
|
73
|
+
margin-right: 10px;
|
|
74
|
+
display: inline-block;
|
|
73
75
|
}
|
|
74
76
|
.split-screen-player-wrapper .player-tools .player-tools-item .lm-player-iconfont {
|
|
75
77
|
font-size: 20px;
|
|
@@ -78,6 +80,23 @@
|
|
|
78
80
|
background-color: var(--gray11);
|
|
79
81
|
border-radius: var(--radius1);
|
|
80
82
|
}
|
|
83
|
+
.split-screen-player-wrapper .player-tools .select-current-screen-item {
|
|
84
|
+
font-size: 18px;
|
|
85
|
+
width: 32px;
|
|
86
|
+
height: 32px;
|
|
87
|
+
color: var(--gray1);
|
|
88
|
+
text-align: center;
|
|
89
|
+
cursor: pointer;
|
|
90
|
+
margin-right: 6px;
|
|
91
|
+
display: inline-block;
|
|
92
|
+
}
|
|
93
|
+
.split-screen-player-wrapper .player-tools .select-current-screen-item .lm-player-iconfont {
|
|
94
|
+
font-size: 20px;
|
|
95
|
+
}
|
|
96
|
+
.split-screen-player-wrapper .player-tools .select-current-screen-item:hover {
|
|
97
|
+
background-color: var(--gray11);
|
|
98
|
+
border-radius: var(--radius1);
|
|
99
|
+
}
|
|
81
100
|
.split-screen-player-wrapper.split-screen-player-wrapper-record .record-time-line {
|
|
82
101
|
width: 100%;
|
|
83
102
|
height: 46px;
|
|
@@ -105,20 +124,20 @@
|
|
|
105
124
|
justify-content: space-around;
|
|
106
125
|
align-items: center;
|
|
107
126
|
}
|
|
108
|
-
.time-mode-select {
|
|
127
|
+
.cloudapp-select.time-mode-select {
|
|
109
128
|
font-size: var(--fs-small);
|
|
110
129
|
color: var(--gray1);
|
|
111
130
|
}
|
|
112
|
-
.time-mode-select .cloudapp-select-selector {
|
|
113
|
-
background-color: transparent
|
|
114
|
-
border-radius: var(--radius1)
|
|
131
|
+
.cloudapp-select.time-mode-select .cloudapp-select-selector {
|
|
132
|
+
background-color: transparent;
|
|
133
|
+
border-radius: var(--radius1);
|
|
115
134
|
}
|
|
116
|
-
.time-mode-select .anticon {
|
|
135
|
+
.cloudapp-select.time-mode-select .anticon {
|
|
117
136
|
color: var(--gray1);
|
|
118
137
|
}
|
|
119
|
-
.
|
|
138
|
+
.custom-select-dropdown {
|
|
120
139
|
font-size: var(--fs-small);
|
|
121
140
|
}
|
|
122
|
-
.
|
|
141
|
+
.custom-select-dropdown .cloudapp-select-item {
|
|
123
142
|
font-size: var(--fs-small);
|
|
124
143
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { PlayModeType } from '../PlayerExt';
|
|
2
3
|
import { ISegmentType } from '../Player/player';
|
|
3
4
|
|
|
4
5
|
export type RecordItem = {
|
|
@@ -8,6 +9,7 @@ export type RecordItem = {
|
|
|
8
9
|
segments?: ISegmentType[];
|
|
9
10
|
url?: string;
|
|
10
11
|
recordType?: 1 | 2; //1云录像 2前端录像
|
|
12
|
+
mode?: PlayModeType;
|
|
11
13
|
};
|
|
12
14
|
|
|
13
15
|
export interface IRecordPlayerProps {
|
|
@@ -22,7 +24,7 @@ export interface IRecordPlayerProps {
|
|
|
22
24
|
/**
|
|
23
25
|
* 窗口索引变化,后续基于索引传入播放必要数据
|
|
24
26
|
*/
|
|
25
|
-
onIndexChange
|
|
27
|
+
onIndexChange?: (idx: number) => void;
|
|
26
28
|
|
|
27
29
|
/**
|
|
28
30
|
* 关闭单个窗口
|
|
@@ -37,6 +39,14 @@ export interface IRecordPlayerProps {
|
|
|
37
39
|
* 录像下载回调
|
|
38
40
|
*/
|
|
39
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;
|
|
40
50
|
}
|
|
41
51
|
|
|
42
52
|
export interface IRecordPlayerState {
|
|
@@ -53,7 +63,7 @@ export interface IRecordPlayerState {
|
|
|
53
63
|
/**
|
|
54
64
|
* 插件OR浏览器
|
|
55
65
|
*/
|
|
56
|
-
|
|
66
|
+
modes: PlayModeType[];
|
|
57
67
|
|
|
58
68
|
/**
|
|
59
69
|
* 时间轴开始时间
|
|
@@ -84,6 +94,8 @@ export interface IRecordPlayerState {
|
|
|
84
94
|
export type ScreenItemLivePlayerType = {
|
|
85
95
|
url?: string;
|
|
86
96
|
type?: 'flv' | 'hls' | 'native';
|
|
97
|
+
mode?: PlayModeType;
|
|
98
|
+
cid?: string;
|
|
87
99
|
};
|
|
88
100
|
|
|
89
101
|
export interface ILivePlayerProps {
|
|
@@ -102,13 +114,21 @@ export interface ILivePlayerProps {
|
|
|
102
114
|
/**
|
|
103
115
|
* 窗口索引变化,后续基于索引传入播放必要数据
|
|
104
116
|
*/
|
|
105
|
-
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;
|
|
106
126
|
}
|
|
107
127
|
|
|
108
128
|
export interface ILivePlayerState {
|
|
109
129
|
screenNum: number;
|
|
110
130
|
selectIndex: number;
|
|
111
|
-
|
|
131
|
+
modes: PlayModeType[];
|
|
112
132
|
}
|
|
113
133
|
|
|
114
134
|
export const RecordPlayer: React.FC<IRecordPlayerProps>;
|