@cloud-app-dev/vidc 3.0.9 → 3.0.10
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 +2 -1
- package/es/CustomRenderSelect/index.css +20 -0
- package/es/CustomRenderSelect/index.d.ts +10 -0
- package/es/CustomRenderSelect/index.js +67 -0
- package/es/Player/demo.js +36 -12
- 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/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/ScreenPlayer/Live.js +17 -4
- package/es/ScreenPlayer/LiveTools.js +58 -28
- package/es/ScreenPlayer/PlayerWithExt.d.ts +2 -2
- package/es/ScreenPlayer/PlayerWithExt.js +3 -2
- package/es/ScreenPlayer/Record.js +22 -22
- package/es/ScreenPlayer/RecordTools.d.ts +1 -1
- package/es/ScreenPlayer/RecordTools.js +40 -32
- package/es/ScreenPlayer/ScreenSelect.js +41 -20
- package/es/ScreenPlayer/TimeMode.js +8 -2
- package/es/ScreenPlayer/index.css +26 -10
- package/es/ScreenPlayer/interface.d.ts +5 -2
- 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 +1 -1
package/.prettierrc
CHANGED
package/.umirc.ts
CHANGED
|
@@ -87,12 +87,13 @@ export default defineConfig({
|
|
|
87
87
|
--gray11: #4B4B4B;
|
|
88
88
|
--gray12: #383838;
|
|
89
89
|
--background: #348fe2;
|
|
90
|
+
--icon:#62708B;
|
|
90
91
|
--fs: 14px;
|
|
91
92
|
--fs-small: 12px;
|
|
92
93
|
--fs-large: 20px;
|
|
93
94
|
--color: rgba(0,0,0,1);
|
|
94
95
|
--color-dark: #000000;
|
|
95
|
-
--color-light: rgba(
|
|
96
|
+
--color-light: rgba(255,255,255,1);
|
|
96
97
|
--color-disabled: rgba(0,0,0,0.26);
|
|
97
98
|
--shadow1: 2px 0 10px 0 rgba(0,0,0,0.06);
|
|
98
99
|
--shadow2: 2px 0 10px 0 rgba(0,0,0,0.06);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
.custom-render-select {
|
|
2
|
+
display: inline-block;
|
|
3
|
+
position: relative;
|
|
4
|
+
width: max-content;
|
|
5
|
+
overflow: hidden;
|
|
6
|
+
}
|
|
7
|
+
.custom-render-select .custom-render-box {
|
|
8
|
+
display: inline-block;
|
|
9
|
+
position: relative;
|
|
10
|
+
z-index: 22;
|
|
11
|
+
}
|
|
12
|
+
.custom-render-select .cloudapp-select {
|
|
13
|
+
position: absolute;
|
|
14
|
+
width: max-content;
|
|
15
|
+
height: 100%;
|
|
16
|
+
left: 50%;
|
|
17
|
+
top: 50%;
|
|
18
|
+
opacity: 0;
|
|
19
|
+
transform: translate(-50%, -50%);
|
|
20
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SelectProps } from 'antd';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import './index.less';
|
|
4
|
+
interface ICustomRenderSelectProps extends SelectProps {
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
value: any;
|
|
7
|
+
customRender: (value: any) => JSX.Element;
|
|
8
|
+
}
|
|
9
|
+
declare function CustomRenderSelect({ children, value, customRender, dropdownClassName, ...props }: ICustomRenderSelectProps): JSX.Element;
|
|
10
|
+
export default CustomRenderSelect;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import "antd/lib/select/style";
|
|
2
|
+
import _Select from "antd/lib/select";
|
|
3
|
+
import _useClickAway from "ahooks/es/useClickAway";
|
|
4
|
+
import _useToggle3 from "ahooks/es/useToggle";
|
|
5
|
+
import _uuid from "@cloud-app-dev/utils/es/uuid";
|
|
6
|
+
|
|
7
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
+
|
|
9
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
10
|
+
|
|
11
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
12
|
+
|
|
13
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
14
|
+
|
|
15
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
16
|
+
|
|
17
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
18
|
+
|
|
19
|
+
import { __rest } from "tslib";
|
|
20
|
+
import React, { useMemo, useRef } from 'react';
|
|
21
|
+
import "./index.css";
|
|
22
|
+
|
|
23
|
+
function CustomRenderSelect(_a) {
|
|
24
|
+
var children = _a.children,
|
|
25
|
+
value = _a.value,
|
|
26
|
+
customRender = _a.customRender,
|
|
27
|
+
dropdownClassName = _a.dropdownClassName,
|
|
28
|
+
props = __rest(_a, ["children", "value", "customRender", "dropdownClassName"]);
|
|
29
|
+
|
|
30
|
+
var classname = useMemo(function () {
|
|
31
|
+
return "custom-render-select-dropdown-".concat(_uuid());
|
|
32
|
+
}, []);
|
|
33
|
+
var domRef = useRef(null);
|
|
34
|
+
|
|
35
|
+
var _useToggle = _useToggle3(),
|
|
36
|
+
_useToggle2 = _slicedToArray(_useToggle, 2),
|
|
37
|
+
open = _useToggle2[0],
|
|
38
|
+
_useToggle2$ = _useToggle2[1],
|
|
39
|
+
toggle = _useToggle2$.toggle,
|
|
40
|
+
set = _useToggle2$.set;
|
|
41
|
+
|
|
42
|
+
var getDoms = useMemo(function () {
|
|
43
|
+
return [function () {
|
|
44
|
+
return domRef.current.querySelector('.custom-render-box');
|
|
45
|
+
}, function () {
|
|
46
|
+
return document.querySelector(".".concat(classname));
|
|
47
|
+
}];
|
|
48
|
+
}, []);
|
|
49
|
+
|
|
50
|
+
_useClickAway(function () {
|
|
51
|
+
return set(false);
|
|
52
|
+
}, getDoms, ['click']);
|
|
53
|
+
|
|
54
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
55
|
+
className: "custom-render-select",
|
|
56
|
+
ref: domRef
|
|
57
|
+
}, /*#__PURE__*/React.createElement(_Select, Object.assign({}, props, {
|
|
58
|
+
value: value,
|
|
59
|
+
dropdownClassName: "custom-render-select-dropdown ".concat(classname, " ").concat(dropdownClassName),
|
|
60
|
+
open: open
|
|
61
|
+
}), children), /*#__PURE__*/React.createElement("div", {
|
|
62
|
+
className: "custom-render-box",
|
|
63
|
+
onClick: toggle
|
|
64
|
+
}, customRender(value)));
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export default CustomRenderSelect;
|
package/es/Player/demo.js
CHANGED
|
@@ -23,6 +23,7 @@ import React, { useState } from 'react';
|
|
|
23
23
|
import Player from './single_player';
|
|
24
24
|
import SegmentPlayer from './segment_player';
|
|
25
25
|
import FrontendPlayer from './frontend_player';
|
|
26
|
+
import moment from 'moment';
|
|
26
27
|
var options = [{
|
|
27
28
|
value: '',
|
|
28
29
|
label: '自动'
|
|
@@ -123,28 +124,51 @@ function Demo1() {
|
|
|
123
124
|
}));
|
|
124
125
|
}
|
|
125
126
|
|
|
126
|
-
var
|
|
127
|
+
var mm = moment().set({
|
|
128
|
+
hours: 0,
|
|
129
|
+
minutes: 0,
|
|
130
|
+
seconds: 0
|
|
131
|
+
});
|
|
132
|
+
var m = mm.clone();
|
|
127
133
|
|
|
128
134
|
function Demo2() {
|
|
129
135
|
var _useState3 = useState({
|
|
130
136
|
isLive: 1,
|
|
131
137
|
segments: [{
|
|
132
|
-
beginTime:
|
|
133
|
-
endTime:
|
|
138
|
+
beginTime: m.valueOf(),
|
|
139
|
+
endTime: m.set({
|
|
140
|
+
minutes: 1
|
|
141
|
+
}).valueOf(),
|
|
134
142
|
url: 'http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4'
|
|
135
143
|
}, {
|
|
136
|
-
beginTime:
|
|
137
|
-
|
|
144
|
+
beginTime: m.set({
|
|
145
|
+
minutes: 1
|
|
146
|
+
}).valueOf(),
|
|
147
|
+
endTime: m.set({
|
|
148
|
+
minutes: 2
|
|
149
|
+
}).valueOf()
|
|
138
150
|
}, {
|
|
139
|
-
beginTime:
|
|
140
|
-
|
|
151
|
+
beginTime: m.set({
|
|
152
|
+
minutes: 2
|
|
153
|
+
}).valueOf(),
|
|
154
|
+
endTime: m.set({
|
|
155
|
+
minutes: 3
|
|
156
|
+
}).valueOf(),
|
|
141
157
|
url: 'http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4?date=1'
|
|
142
158
|
}, {
|
|
143
|
-
beginTime:
|
|
144
|
-
|
|
159
|
+
beginTime: m.set({
|
|
160
|
+
minutes: 3
|
|
161
|
+
}).valueOf(),
|
|
162
|
+
endTime: m.set({
|
|
163
|
+
minutes: 4
|
|
164
|
+
}).valueOf()
|
|
145
165
|
}, {
|
|
146
|
-
beginTime:
|
|
147
|
-
|
|
166
|
+
beginTime: m.set({
|
|
167
|
+
minutes: 4
|
|
168
|
+
}).valueOf(),
|
|
169
|
+
endTime: m.set({
|
|
170
|
+
minutes: 5
|
|
171
|
+
}).valueOf(),
|
|
148
172
|
url: 'http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4?date=2'
|
|
149
173
|
}],
|
|
150
174
|
tempUrl: ''
|
|
@@ -190,7 +214,7 @@ function Demo2() {
|
|
|
190
214
|
});
|
|
191
215
|
}
|
|
192
216
|
}, "\u64AD\u653E")), /*#__PURE__*/React.createElement(SegmentPlayer, {
|
|
193
|
-
begin:
|
|
217
|
+
begin: mm.valueOf(),
|
|
194
218
|
segments: state.segments,
|
|
195
219
|
isLive: false
|
|
196
220
|
}));
|
|
@@ -11,6 +11,7 @@ interface ITimeLineProps {
|
|
|
11
11
|
duration: number;
|
|
12
12
|
setIndex: (i: number) => void;
|
|
13
13
|
begin: number;
|
|
14
|
+
seekTo: (time: number) => void;
|
|
14
15
|
}
|
|
15
|
-
declare function SegmentTimeLine({ api, event, index, segments, duration, begin, setIndex }: ITimeLineProps): JSX.Element;
|
|
16
|
+
declare function SegmentTimeLine({ api, event, index, segments, duration, begin, setIndex, seekTo }: ITimeLineProps): JSX.Element;
|
|
16
17
|
export default SegmentTimeLine;
|
|
@@ -27,7 +27,8 @@ function SegmentTimeLine(_ref) {
|
|
|
27
27
|
segments = _ref.segments,
|
|
28
28
|
duration = _ref.duration,
|
|
29
29
|
begin = _ref.begin,
|
|
30
|
-
setIndex = _ref.setIndex
|
|
30
|
+
setIndex = _ref.setIndex,
|
|
31
|
+
seekTo = _ref.seekTo;
|
|
31
32
|
var status = useBarStatus(event);
|
|
32
33
|
|
|
33
34
|
var _useTimes = useTimes(api, event),
|
|
@@ -56,17 +57,11 @@ function SegmentTimeLine(_ref) {
|
|
|
56
57
|
var ele = e.currentTarget;
|
|
57
58
|
var rect = ele.getBoundingClientRect();
|
|
58
59
|
var current = e.pageX - rect.left;
|
|
59
|
-
var
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
setTimeout(function () {
|
|
65
|
-
return api.seekTo(currentTime);
|
|
66
|
-
}, 500);
|
|
67
|
-
} else {
|
|
68
|
-
api.seekTo(currentTime);
|
|
69
|
-
}
|
|
60
|
+
var item = segments[i - 1];
|
|
61
|
+
var pTime = item ? item.endTime : begin;
|
|
62
|
+
var duration = segments[i].endTime - segments[i].beginTime;
|
|
63
|
+
var currentTime = current / rect.width * duration;
|
|
64
|
+
seekTo(Math.round(currentTime + pTime));
|
|
70
65
|
}, [segments, api, index, setIndex]);
|
|
71
66
|
return /*#__PURE__*/React.createElement("div", {
|
|
72
67
|
className: "player-timeline-layout player-segment-timeline-layout ".concat(status === 0 ? 'hide-time-line' : '')
|
|
@@ -1,62 +1,179 @@
|
|
|
1
1
|
@font-face {
|
|
2
|
-
font-family:
|
|
3
|
-
src: url('
|
|
2
|
+
font-family: "lm-player-iconfont"; /* Project id 1153292 */
|
|
3
|
+
src: url('iconfont.woff2?t=1661511384224') format('woff2'),
|
|
4
|
+
url('iconfont.woff?t=1661511384224') format('woff'),
|
|
5
|
+
url('iconfont.ttf?t=1661511384224') format('truetype');
|
|
4
6
|
}
|
|
7
|
+
|
|
5
8
|
.lm-player-iconfont {
|
|
6
|
-
font-family:
|
|
9
|
+
font-family: "lm-player-iconfont" !important;
|
|
7
10
|
font-size: 16px;
|
|
8
11
|
font-style: normal;
|
|
9
12
|
-webkit-font-smoothing: antialiased;
|
|
10
13
|
-moz-osx-font-smoothing: grayscale;
|
|
11
14
|
}
|
|
12
|
-
|
|
13
|
-
|
|
15
|
+
|
|
16
|
+
.lm-player-xiazai:before {
|
|
17
|
+
content: "\e6d0";
|
|
14
18
|
}
|
|
15
|
-
|
|
16
|
-
|
|
19
|
+
|
|
20
|
+
.lm-player-bofang:before {
|
|
21
|
+
content: "\e6cf";
|
|
17
22
|
}
|
|
18
|
-
|
|
19
|
-
|
|
23
|
+
|
|
24
|
+
.lm-player-tingzhi:before {
|
|
25
|
+
content: "\e6ce";
|
|
20
26
|
}
|
|
21
|
-
|
|
22
|
-
|
|
27
|
+
|
|
28
|
+
.lm-player-quanbuguanbi:before {
|
|
29
|
+
content: "\e6cc";
|
|
23
30
|
}
|
|
24
|
-
|
|
25
|
-
|
|
31
|
+
|
|
32
|
+
.lm-player-huamianshiying:before {
|
|
33
|
+
content: "\e6cb";
|
|
26
34
|
}
|
|
27
|
-
|
|
28
|
-
|
|
35
|
+
|
|
36
|
+
.lm-player-quanping:before {
|
|
37
|
+
content: "\e6c6";
|
|
29
38
|
}
|
|
30
|
-
|
|
31
|
-
|
|
39
|
+
|
|
40
|
+
.lm-player-a-guanbi_close-one11:before {
|
|
41
|
+
content: "\e623";
|
|
32
42
|
}
|
|
33
|
-
|
|
34
|
-
|
|
43
|
+
|
|
44
|
+
.lm-player-lunxunkaishi:before {
|
|
45
|
+
content: "\e6c3";
|
|
35
46
|
}
|
|
36
|
-
|
|
37
|
-
|
|
47
|
+
|
|
48
|
+
.lm-player-fenping16:before {
|
|
49
|
+
content: "\e6c5";
|
|
38
50
|
}
|
|
39
|
-
|
|
40
|
-
|
|
51
|
+
|
|
52
|
+
.lm-player-xiangji1fill:before {
|
|
53
|
+
content: "\e77e";
|
|
41
54
|
}
|
|
42
|
-
|
|
43
|
-
|
|
55
|
+
|
|
56
|
+
.lm-player-M_Device_jiazaishibai:before {
|
|
57
|
+
content: "\e6de";
|
|
44
58
|
}
|
|
45
|
-
|
|
46
|
-
|
|
59
|
+
|
|
60
|
+
.lm-player-M_Bar_CloudAuto:before {
|
|
61
|
+
content: "\e6c9";
|
|
47
62
|
}
|
|
48
|
-
|
|
49
|
-
|
|
63
|
+
|
|
64
|
+
.lm-player-S_Box_VideoCloud:before {
|
|
65
|
+
content: "\e6ca";
|
|
50
66
|
}
|
|
67
|
+
|
|
68
|
+
.lm-player-S_Bar_LatLongYes:before {
|
|
69
|
+
content: "\e792";
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.lm-player-S_Device_kuaijin:before {
|
|
73
|
+
content: "\e6c7";
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.lm-player-S_Device_shezhi:before {
|
|
77
|
+
content: "\e6c8";
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.lm-player-S_View_Playerpley:before {
|
|
81
|
+
content: "\e827";
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.lm-player-S_View_RotateRight:before {
|
|
85
|
+
content: "\e828";
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.lm-player-S_View_ScreenSizeFull:before {
|
|
89
|
+
content: "\e82d";
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.lm-player-S_View_SoundMiddle:before {
|
|
93
|
+
content: "\e835";
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.lm-player-S_Edit_LoadDown:before {
|
|
97
|
+
content: "\e7b6";
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.lm-player-S_Edit_Reset:before {
|
|
101
|
+
content: "\e7c3";
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.lm-player-S_View_SearchBox:before {
|
|
105
|
+
content: "\e833";
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.lm-player-S_View_PlayerPlay1:before {
|
|
109
|
+
content: "\e6b7";
|
|
110
|
+
}
|
|
111
|
+
|
|
51
112
|
.lm-player-YesorNo_No_Dark:before {
|
|
52
|
-
content:
|
|
113
|
+
content: "\e6dd";
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.lm-player-Refresh_Main:before {
|
|
117
|
+
content: "\e687";
|
|
53
118
|
}
|
|
119
|
+
|
|
54
120
|
.lm-player-SearchBox:before {
|
|
55
|
-
content:
|
|
121
|
+
content: "\e706";
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.lm-player-ZoomIn_Main:before {
|
|
125
|
+
content: "\e663";
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.lm-player-ZoomDefault_Main:before {
|
|
129
|
+
content: "\e664";
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.lm-player-ZoomOut_Main:before {
|
|
133
|
+
content: "\e665";
|
|
56
134
|
}
|
|
135
|
+
|
|
57
136
|
.lm-player-PrevFast:before {
|
|
58
|
-
content:
|
|
137
|
+
content: "\e71f";
|
|
59
138
|
}
|
|
139
|
+
|
|
60
140
|
.lm-player-NextFast_Light:before {
|
|
61
|
-
content:
|
|
141
|
+
content: "\e720";
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.lm-player-volume-close:before {
|
|
145
|
+
content: "\e602";
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.lm-player-volume-normal-fuben:before {
|
|
149
|
+
content: "\e604";
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.lm-player-volume-max:before {
|
|
153
|
+
content: "\e605";
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.lm-player-ExitFull_Main:before {
|
|
157
|
+
content: "\e68e";
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.lm-player-Full_Main:before {
|
|
161
|
+
content: "\e690";
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.lm-player-Loading:before {
|
|
165
|
+
content: "\e65d";
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.lm-player-Pause_Main:before {
|
|
169
|
+
content: "\e652";
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.lm-player-Play_Main:before {
|
|
173
|
+
content: "\e654";
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.lm-player-PlaySource:before {
|
|
177
|
+
content: "\e6cd";
|
|
62
178
|
}
|
|
179
|
+
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/es/ScreenPlayer/Live.js
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
|
+
|
|
3
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
+
|
|
5
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
6
|
+
|
|
7
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
8
|
+
|
|
1
9
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
10
|
|
|
3
11
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -28,7 +36,7 @@ function LivePlayer(_ref) {
|
|
|
28
36
|
var _useState = useState({
|
|
29
37
|
screenNum: 4,
|
|
30
38
|
selectIndex: 0,
|
|
31
|
-
|
|
39
|
+
modes: []
|
|
32
40
|
}),
|
|
33
41
|
_useState2 = _slicedToArray(_useState, 2),
|
|
34
42
|
state = _useState2[0],
|
|
@@ -70,7 +78,10 @@ function LivePlayer(_ref) {
|
|
|
70
78
|
}
|
|
71
79
|
|
|
72
80
|
if (newState.hasOwnProperty('mode')) {
|
|
73
|
-
|
|
81
|
+
var newModes = _toConsumableArray(state.modes);
|
|
82
|
+
|
|
83
|
+
newModes[state.selectIndex] = newState.mode;
|
|
84
|
+
obj.modes = newModes;
|
|
74
85
|
}
|
|
75
86
|
|
|
76
87
|
setState(function (old) {
|
|
@@ -89,8 +100,10 @@ function LivePlayer(_ref) {
|
|
|
89
100
|
}, /*#__PURE__*/React.createElement("div", {
|
|
90
101
|
className: "player-layout"
|
|
91
102
|
}, screenList.map(function (item, index) {
|
|
103
|
+
var _a;
|
|
104
|
+
|
|
92
105
|
return /*#__PURE__*/React.createElement(LivePlayerWithExt, Object.assign({}, item, {
|
|
93
|
-
mode: state.
|
|
106
|
+
mode: (_a = item.mode) !== null && _a !== void 0 ? _a : state.modes[index],
|
|
94
107
|
isLive: true,
|
|
95
108
|
key: "".concat(item.url, "-").concat(index),
|
|
96
109
|
updatePlayer: function updatePlayer(player) {
|
|
@@ -116,7 +129,7 @@ function LivePlayer(_ref) {
|
|
|
116
129
|
toggleFit: toggleFit,
|
|
117
130
|
getPlayerItem: getPlayerItem,
|
|
118
131
|
screenNum: state.screenNum,
|
|
119
|
-
mode: state.
|
|
132
|
+
mode: state.modes[state.selectIndex],
|
|
120
133
|
containerRef: domRef,
|
|
121
134
|
updateState: updateState
|
|
122
135
|
}), children && /*#__PURE__*/React.cloneElement(children, {
|
|
@@ -79,20 +79,57 @@ function LiveTools(_ref) {
|
|
|
79
79
|
title: "\u91CD\u8F7D"
|
|
80
80
|
})), /*#__PURE__*/React.createElement("span", {
|
|
81
81
|
className: "player-tools-item",
|
|
82
|
-
onClick:
|
|
82
|
+
onClick: function onClick() {
|
|
83
|
+
return updateState({
|
|
84
|
+
mode: mode !== 2 ? 2 : 1
|
|
85
|
+
});
|
|
86
|
+
}
|
|
83
87
|
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
84
|
-
|
|
85
|
-
|
|
88
|
+
style: {
|
|
89
|
+
top: 2,
|
|
90
|
+
position: 'relative',
|
|
91
|
+
left: 1
|
|
92
|
+
},
|
|
93
|
+
type: "lm-player-S_Device_shezhi",
|
|
94
|
+
title: "\u5207\u6362".concat(mode === 1 ? '插件' : '浏览器', "\u6A21\u5F0F")
|
|
86
95
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
87
96
|
className: "player-tools-mid"
|
|
88
|
-
}, /*#__PURE__*/React.createElement("
|
|
97
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
98
|
+
className: "player-tools-item",
|
|
99
|
+
onClick: onClose,
|
|
100
|
+
style: {
|
|
101
|
+
marginRight: 6
|
|
102
|
+
}
|
|
103
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
104
|
+
type: "lm-player-tingzhi",
|
|
105
|
+
title: "\u505C\u6B62",
|
|
106
|
+
style: {
|
|
107
|
+
fontSize: 16,
|
|
108
|
+
position: 'relative',
|
|
109
|
+
top: 1
|
|
110
|
+
}
|
|
111
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
89
112
|
className: "player-tools-item",
|
|
90
|
-
onClick: playToggle
|
|
113
|
+
onClick: playToggle,
|
|
114
|
+
style: {
|
|
115
|
+
marginLeft: 6
|
|
116
|
+
}
|
|
91
117
|
}, player && !player.video.paused ? /*#__PURE__*/React.createElement(IconFont, {
|
|
92
118
|
type: "lm-player-Pause_Main",
|
|
93
|
-
title: "\u6682\u505C"
|
|
119
|
+
title: "\u6682\u505C",
|
|
120
|
+
style: {
|
|
121
|
+
fontSize: 22,
|
|
122
|
+
position: 'relative',
|
|
123
|
+
top: -2
|
|
124
|
+
}
|
|
94
125
|
}) : /*#__PURE__*/React.createElement(IconFont, {
|
|
95
|
-
|
|
126
|
+
style: {
|
|
127
|
+
fontSize: 17,
|
|
128
|
+
position: 'relative',
|
|
129
|
+
left: 2,
|
|
130
|
+
top: 2
|
|
131
|
+
},
|
|
132
|
+
type: "lm-player-bofang",
|
|
96
133
|
title: "\u64AD\u653E"
|
|
97
134
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
98
135
|
className: "player-tools-right"
|
|
@@ -100,38 +137,31 @@ function LiveTools(_ref) {
|
|
|
100
137
|
className: "player-tools-item",
|
|
101
138
|
onClick: onCloseAll
|
|
102
139
|
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
103
|
-
type: "lm-player-
|
|
140
|
+
type: "lm-player-quanbuguanbi",
|
|
104
141
|
title: "\u5173\u95ED\u6240\u6709"
|
|
105
|
-
})), /*#__PURE__*/React.createElement(
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
mode: mode === 1 ? 2 : 1
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
113
|
-
type: "lm-player-YesorNo_No_Dark",
|
|
114
|
-
title: "\u5207\u6362".concat(mode === 1 ? '插件' : '浏览器', "\u6A21\u5F0F")
|
|
115
|
-
})), /*#__PURE__*/React.createElement("span", {
|
|
142
|
+
})), /*#__PURE__*/React.createElement(ScreenSelect, {
|
|
143
|
+
screenNum: screenNum,
|
|
144
|
+
updateState: updateState
|
|
145
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
116
146
|
className: "player-tools-item",
|
|
117
147
|
onClick: toggleFit
|
|
118
148
|
}, fit === 'fill' ? /*#__PURE__*/React.createElement(IconFont, {
|
|
119
|
-
type: "lm-player-
|
|
149
|
+
type: "lm-player-huamianshiying",
|
|
120
150
|
title: "\u81EA\u9002\u5E94"
|
|
121
151
|
}) : /*#__PURE__*/React.createElement(IconFont, {
|
|
122
|
-
type: "lm-player-
|
|
152
|
+
type: "lm-player-huamianshiying",
|
|
123
153
|
title: "\u586B\u5145"
|
|
124
|
-
})), /*#__PURE__*/React.createElement(
|
|
125
|
-
screenNum: screenNum,
|
|
126
|
-
updateState: updateState
|
|
127
|
-
}), /*#__PURE__*/React.createElement("span", {
|
|
154
|
+
})), /*#__PURE__*/React.createElement("span", {
|
|
128
155
|
className: "player-tools-item",
|
|
129
|
-
onClick: toggleFullscreen
|
|
156
|
+
onClick: toggleFullscreen,
|
|
157
|
+
style: {
|
|
158
|
+
marginRight: 0
|
|
159
|
+
}
|
|
130
160
|
}, isFullscreen ? /*#__PURE__*/React.createElement(IconFont, {
|
|
131
|
-
type: "lm-player-
|
|
161
|
+
type: "lm-player-quanping",
|
|
132
162
|
title: "\u5168\u5C4F"
|
|
133
163
|
}) : /*#__PURE__*/React.createElement(IconFont, {
|
|
134
|
-
type: "lm-player-
|
|
164
|
+
type: "lm-player-quanping",
|
|
135
165
|
title: "\u5168\u5C4F"
|
|
136
166
|
}))));
|
|
137
167
|
}
|
|
@@ -9,11 +9,11 @@ interface ILivePlayerWithExtProps extends ISinglePlayerProps {
|
|
|
9
9
|
pluginDownloadUrl?: string;
|
|
10
10
|
}
|
|
11
11
|
export declare function LivePlayerWithExt({ mode, isLive, url, type, style, className, updatePlayer, onClick, pluginDownloadUrl, ...props }: ILivePlayerWithExtProps): JSX.Element;
|
|
12
|
-
interface ISegmentPlayerWithExtProps extends Omit<ILivePlayerWithExtProps, 'url'
|
|
12
|
+
interface ISegmentPlayerWithExtProps extends Omit<ILivePlayerWithExtProps, 'url'> {
|
|
13
13
|
segments?: ISegmentType[];
|
|
14
14
|
begin?: number;
|
|
15
15
|
}
|
|
16
|
-
export declare function SegmentPlayerWithExt({ begin, style, className, segments, updatePlayer, onClick, ...props }: ISegmentPlayerWithExtProps): JSX.Element;
|
|
16
|
+
export declare function SegmentPlayerWithExt({ begin, style, className, segments, updatePlayer, onClick, mode, ...props }: ISegmentPlayerWithExtProps): JSX.Element;
|
|
17
17
|
interface IFrontendPlayerWithExtProps extends Omit<ILivePlayerWithExtProps, 'url'> {
|
|
18
18
|
segments?: ISegmentType[];
|
|
19
19
|
begin?: number;
|
|
@@ -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",
|
|
@@ -36,6 +36,16 @@ import useRecordList from './useRecordList';
|
|
|
36
36
|
import useVideoFit from './useVideoFit';
|
|
37
37
|
import DisableMark from '../DisableMark';
|
|
38
38
|
import "./index.css";
|
|
39
|
+
var defaultState = {
|
|
40
|
+
screenNum: 4,
|
|
41
|
+
selectIndex: 0,
|
|
42
|
+
modes: [],
|
|
43
|
+
currentTimes: [],
|
|
44
|
+
loading: false,
|
|
45
|
+
seekTo: 0,
|
|
46
|
+
mergeSegments: [],
|
|
47
|
+
timeMode: 24
|
|
48
|
+
};
|
|
39
49
|
/**
|
|
40
50
|
* @desc 录像设计的时间全部需要到毫秒
|
|
41
51
|
* @param param0
|
|
@@ -53,16 +63,7 @@ function RecordPlayer(_ref) {
|
|
|
53
63
|
onCloseAll = _ref.onCloseAll,
|
|
54
64
|
download = _ref.download;
|
|
55
65
|
|
|
56
|
-
var _useState = useState({
|
|
57
|
-
screenNum: 4,
|
|
58
|
-
selectIndex: 0,
|
|
59
|
-
mode: 1,
|
|
60
|
-
currentTimes: [],
|
|
61
|
-
loading: false,
|
|
62
|
-
seekTo: 0,
|
|
63
|
-
mergeSegments: [],
|
|
64
|
-
timeMode: 24
|
|
65
|
-
}),
|
|
66
|
+
var _useState = useState(Object.assign({}, defaultState)),
|
|
66
67
|
_useState2 = _slicedToArray(_useState, 2),
|
|
67
68
|
state = _useState2[0],
|
|
68
69
|
setState = _useState2[1];
|
|
@@ -114,11 +115,6 @@ function RecordPlayer(_ref) {
|
|
|
114
115
|
|
|
115
116
|
return (_a = state.currentTimes[state.selectIndex]) !== null && _a !== void 0 ? _a : segmentItem.date;
|
|
116
117
|
}, [segmentItem.date, state.currentTimes, state.selectIndex]);
|
|
117
|
-
/**
|
|
118
|
-
* 专门
|
|
119
|
-
*/
|
|
120
|
-
|
|
121
|
-
useEffect(function () {}, [fit]);
|
|
122
118
|
/**
|
|
123
119
|
* @desc 用户缓存接收list的变化。
|
|
124
120
|
*/
|
|
@@ -203,7 +199,10 @@ function RecordPlayer(_ref) {
|
|
|
203
199
|
}
|
|
204
200
|
|
|
205
201
|
if (newState.hasOwnProperty('mode')) {
|
|
206
|
-
|
|
202
|
+
var newModes = _toConsumableArray(state.modes);
|
|
203
|
+
|
|
204
|
+
newModes[state.selectIndex] = newState.mode;
|
|
205
|
+
obj.modes = newModes;
|
|
207
206
|
}
|
|
208
207
|
|
|
209
208
|
if (newState.hasOwnProperty('timeMode')) {
|
|
@@ -320,7 +319,7 @@ function RecordPlayer(_ref) {
|
|
|
320
319
|
}, /*#__PURE__*/React.createElement("div", {
|
|
321
320
|
className: "player-layout"
|
|
322
321
|
}, screenList.map(function (item, index) {
|
|
323
|
-
var _a, _b, _c, _d, _e, _f;
|
|
322
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
324
323
|
|
|
325
324
|
return item.recordType === 1 ? /*#__PURE__*/React.createElement(SegmentPlayerWithExt, Object.assign({}, item, {
|
|
326
325
|
segments: ((_a = recordList[index]) === null || _a === void 0 ? void 0 : _a.segments) || [],
|
|
@@ -339,10 +338,11 @@ function RecordPlayer(_ref) {
|
|
|
339
338
|
style: {
|
|
340
339
|
width: screenType.width,
|
|
341
340
|
height: screenType.height
|
|
342
|
-
}
|
|
341
|
+
},
|
|
342
|
+
mode: (_d = item.mode) !== null && _d !== void 0 ? _d : state.modes[index]
|
|
343
343
|
})) : /*#__PURE__*/React.createElement(FrontendPlayerWithExt, Object.assign({}, item, {
|
|
344
344
|
className: state.selectIndex === index ? 'player-current-index' : '',
|
|
345
|
-
segments: ((
|
|
345
|
+
segments: ((_e = recordList[index]) === null || _e === void 0 ? void 0 : _e.segments) || [],
|
|
346
346
|
updatePlayer: function updatePlayer(player) {
|
|
347
347
|
return _updatePlayer(player, index);
|
|
348
348
|
},
|
|
@@ -353,8 +353,8 @@ function RecordPlayer(_ref) {
|
|
|
353
353
|
});
|
|
354
354
|
});
|
|
355
355
|
},
|
|
356
|
-
mode: state.
|
|
357
|
-
key: "".concat((
|
|
356
|
+
mode: (_f = item.mode) !== null && _f !== void 0 ? _f : state.modes[index],
|
|
357
|
+
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),
|
|
358
358
|
style: {
|
|
359
359
|
width: screenType.width,
|
|
360
360
|
height: screenType.height
|
|
@@ -370,7 +370,7 @@ function RecordPlayer(_ref) {
|
|
|
370
370
|
toggleFit: toggleFit,
|
|
371
371
|
getPlayerItem: getPlayerItem,
|
|
372
372
|
screenNum: state.screenNum,
|
|
373
|
-
mode: state.
|
|
373
|
+
mode: state.modes[state.selectIndex],
|
|
374
374
|
containerRef: domRef,
|
|
375
375
|
updateState: updateState,
|
|
376
376
|
onTimeChange: onTimeChange,
|
|
@@ -20,5 +20,5 @@ interface IToolsProps {
|
|
|
20
20
|
timeMode: number;
|
|
21
21
|
download?: () => void;
|
|
22
22
|
}
|
|
23
|
-
declare function RecordTools({ containerRef, updateState, download, screenNum, timeMode, getPlayerItem, mode, toggleFit, fit, time, onTimeChange, onClose, onCloseAll }: IToolsProps): JSX.Element;
|
|
23
|
+
declare function RecordTools({ containerRef, updateState, download, screenNum, timeMode, getPlayerItem, mode, toggleFit, fit, time, onTimeChange, onClose, onCloseAll, }: IToolsProps): JSX.Element;
|
|
24
24
|
export default RecordTools;
|
|
@@ -85,38 +85,56 @@ function RecordTools(_ref) {
|
|
|
85
85
|
title: "\u91CD\u8F7D"
|
|
86
86
|
})), /*#__PURE__*/React.createElement("span", {
|
|
87
87
|
className: "player-tools-item",
|
|
88
|
-
onClick:
|
|
88
|
+
onClick: download
|
|
89
89
|
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
90
|
-
type: "lm-player-
|
|
91
|
-
title: "\
|
|
90
|
+
type: "lm-player-xiazai",
|
|
91
|
+
title: "\u4E0B\u8F7D\u5F53\u524D\u5F55\u50CF"
|
|
92
92
|
})), /*#__PURE__*/React.createElement("span", {
|
|
93
93
|
className: "player-tools-item",
|
|
94
|
-
onClick:
|
|
94
|
+
onClick: function onClick() {
|
|
95
|
+
return updateState({
|
|
96
|
+
mode: mode !== 2 ? 2 : 1
|
|
97
|
+
});
|
|
98
|
+
}
|
|
95
99
|
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
96
|
-
|
|
97
|
-
|
|
100
|
+
style: {
|
|
101
|
+
top: 2,
|
|
102
|
+
position: 'relative',
|
|
103
|
+
left: 1
|
|
104
|
+
},
|
|
105
|
+
type: "lm-player-S_Device_shezhi",
|
|
106
|
+
title: "\u5207\u6362".concat(mode === 1 ? '插件' : '浏览器', "\u6A21\u5F0F")
|
|
98
107
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
99
108
|
className: "player-tools-mid"
|
|
100
|
-
}, /*#__PURE__*/React.createElement("
|
|
109
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
101
110
|
className: "player-tools-item",
|
|
102
|
-
onClick:
|
|
103
|
-
},
|
|
104
|
-
type: "lm-player-
|
|
105
|
-
title: "\
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
111
|
+
onClick: onClose
|
|
112
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
113
|
+
type: "lm-player-tingzhi",
|
|
114
|
+
title: "\u505C\u6B62",
|
|
115
|
+
style: {
|
|
116
|
+
fontSize: 16
|
|
117
|
+
}
|
|
109
118
|
})), /*#__PURE__*/React.createElement(TimeSelect, {
|
|
110
119
|
time: time,
|
|
111
120
|
onChange: onTimeChange
|
|
112
|
-
}), /*#__PURE__*/React.createElement("
|
|
121
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
113
122
|
className: "player-tools-item",
|
|
114
123
|
onClick: playToggle
|
|
115
124
|
}, player && !player.video.paused ? /*#__PURE__*/React.createElement(IconFont, {
|
|
116
125
|
type: "lm-player-Pause_Main",
|
|
117
|
-
title: "\u6682\u505C"
|
|
126
|
+
title: "\u6682\u505C",
|
|
127
|
+
style: {
|
|
128
|
+
fontSize: 22
|
|
129
|
+
}
|
|
118
130
|
}) : /*#__PURE__*/React.createElement(IconFont, {
|
|
119
|
-
|
|
131
|
+
style: {
|
|
132
|
+
fontSize: 17,
|
|
133
|
+
position: 'relative',
|
|
134
|
+
left: 2,
|
|
135
|
+
top: 2
|
|
136
|
+
},
|
|
137
|
+
type: "lm-player-bofang",
|
|
120
138
|
title: "\u64AD\u653E"
|
|
121
139
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
122
140
|
className: "player-tools-right"
|
|
@@ -124,26 +142,16 @@ function RecordTools(_ref) {
|
|
|
124
142
|
className: "player-tools-item",
|
|
125
143
|
onClick: onCloseAll
|
|
126
144
|
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
127
|
-
type: "lm-player-
|
|
145
|
+
type: "lm-player-quanbuguanbi",
|
|
128
146
|
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
147
|
})), /*#__PURE__*/React.createElement("span", {
|
|
140
148
|
className: "player-tools-item",
|
|
141
149
|
onClick: toggleFit
|
|
142
150
|
}, fit === 'fill' ? /*#__PURE__*/React.createElement(IconFont, {
|
|
143
|
-
type: "lm-player-
|
|
151
|
+
type: "lm-player-huamianshiying",
|
|
144
152
|
title: "\u81EA\u9002\u5E94"
|
|
145
153
|
}) : /*#__PURE__*/React.createElement(IconFont, {
|
|
146
|
-
type: "lm-player-
|
|
154
|
+
type: "lm-player-huamianshiying",
|
|
147
155
|
title: "\u586B\u5145"
|
|
148
156
|
})), /*#__PURE__*/React.createElement(ScreenSelect, {
|
|
149
157
|
screenNum: screenNum,
|
|
@@ -152,10 +160,10 @@ function RecordTools(_ref) {
|
|
|
152
160
|
className: "player-tools-item",
|
|
153
161
|
onClick: toggleFullscreen
|
|
154
162
|
}, isFullscreen ? /*#__PURE__*/React.createElement(IconFont, {
|
|
155
|
-
type: "lm-player-
|
|
163
|
+
type: "lm-player-quanping",
|
|
156
164
|
title: "\u5168\u5C4F"
|
|
157
165
|
}) : /*#__PURE__*/React.createElement(IconFont, {
|
|
158
|
-
type: "lm-player-
|
|
166
|
+
type: "lm-player-quanping",
|
|
159
167
|
title: "\u5168\u5C4F"
|
|
160
168
|
})), /*#__PURE__*/React.createElement(TimeMode, {
|
|
161
169
|
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
|
|
|
@@ -24,8 +24,6 @@
|
|
|
24
24
|
position: relative;
|
|
25
25
|
}
|
|
26
26
|
.split-screen-player-wrapper .player-record-time {
|
|
27
|
-
width: 100%;
|
|
28
|
-
height: 100%;
|
|
29
27
|
text-align: center;
|
|
30
28
|
background-color: var(--gray11);
|
|
31
29
|
line-height: 42px;
|
|
@@ -69,7 +67,8 @@
|
|
|
69
67
|
color: var(--gray1);
|
|
70
68
|
text-align: center;
|
|
71
69
|
cursor: pointer;
|
|
72
|
-
margin-right:
|
|
70
|
+
margin-right: 10px;
|
|
71
|
+
display: inline-block;
|
|
73
72
|
}
|
|
74
73
|
.split-screen-player-wrapper .player-tools .player-tools-item .lm-player-iconfont {
|
|
75
74
|
font-size: 20px;
|
|
@@ -78,6 +77,23 @@
|
|
|
78
77
|
background-color: var(--gray11);
|
|
79
78
|
border-radius: var(--radius1);
|
|
80
79
|
}
|
|
80
|
+
.split-screen-player-wrapper .player-tools .select-current-screen-item {
|
|
81
|
+
font-size: 18px;
|
|
82
|
+
width: 32px;
|
|
83
|
+
height: 32px;
|
|
84
|
+
color: var(--gray1);
|
|
85
|
+
text-align: center;
|
|
86
|
+
cursor: pointer;
|
|
87
|
+
margin-right: 6px;
|
|
88
|
+
display: inline-block;
|
|
89
|
+
}
|
|
90
|
+
.split-screen-player-wrapper .player-tools .select-current-screen-item .lm-player-iconfont {
|
|
91
|
+
font-size: 20px;
|
|
92
|
+
}
|
|
93
|
+
.split-screen-player-wrapper .player-tools .select-current-screen-item:hover {
|
|
94
|
+
background-color: var(--gray11);
|
|
95
|
+
border-radius: var(--radius1);
|
|
96
|
+
}
|
|
81
97
|
.split-screen-player-wrapper.split-screen-player-wrapper-record .record-time-line {
|
|
82
98
|
width: 100%;
|
|
83
99
|
height: 46px;
|
|
@@ -105,20 +121,20 @@
|
|
|
105
121
|
justify-content: space-around;
|
|
106
122
|
align-items: center;
|
|
107
123
|
}
|
|
108
|
-
.time-mode-select {
|
|
124
|
+
.cloudapp-select.time-mode-select {
|
|
109
125
|
font-size: var(--fs-small);
|
|
110
126
|
color: var(--gray1);
|
|
111
127
|
}
|
|
112
|
-
.time-mode-select .cloudapp-select-selector {
|
|
113
|
-
background-color: transparent
|
|
114
|
-
border-radius: var(--radius1)
|
|
128
|
+
.cloudapp-select.time-mode-select .cloudapp-select-selector {
|
|
129
|
+
background-color: transparent;
|
|
130
|
+
border-radius: var(--radius1);
|
|
115
131
|
}
|
|
116
|
-
.time-mode-select .anticon {
|
|
132
|
+
.cloudapp-select.time-mode-select .anticon {
|
|
117
133
|
color: var(--gray1);
|
|
118
134
|
}
|
|
119
|
-
.
|
|
135
|
+
.custom-select-dropdown {
|
|
120
136
|
font-size: var(--fs-small);
|
|
121
137
|
}
|
|
122
|
-
.
|
|
138
|
+
.custom-select-dropdown .cloudapp-select-item {
|
|
123
139
|
font-size: var(--fs-small);
|
|
124
140
|
}
|
|
@@ -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 {
|
|
@@ -53,7 +55,7 @@ export interface IRecordPlayerState {
|
|
|
53
55
|
/**
|
|
54
56
|
* 插件OR浏览器
|
|
55
57
|
*/
|
|
56
|
-
|
|
58
|
+
modes: PlayModeType[];
|
|
57
59
|
|
|
58
60
|
/**
|
|
59
61
|
* 时间轴开始时间
|
|
@@ -84,6 +86,7 @@ export interface IRecordPlayerState {
|
|
|
84
86
|
export type ScreenItemLivePlayerType = {
|
|
85
87
|
url?: string;
|
|
86
88
|
type?: 'flv' | 'hls' | 'native';
|
|
89
|
+
mode?: PlayModeType;
|
|
87
90
|
};
|
|
88
91
|
|
|
89
92
|
export interface ILivePlayerProps {
|
|
@@ -108,7 +111,7 @@ export interface ILivePlayerProps {
|
|
|
108
111
|
export interface ILivePlayerState {
|
|
109
112
|
screenNum: number;
|
|
110
113
|
selectIndex: number;
|
|
111
|
-
|
|
114
|
+
modes: PlayModeType[];
|
|
112
115
|
}
|
|
113
116
|
|
|
114
117
|
export const RecordPlayer: React.FC<IRecordPlayerProps>;
|
package/es/ScreenPlayer/utils.js
CHANGED
|
@@ -1,28 +1,37 @@
|
|
|
1
1
|
export var ScreenType = [{
|
|
2
2
|
name: 1,
|
|
3
3
|
width: '100%',
|
|
4
|
-
height: '100%'
|
|
4
|
+
height: '100%',
|
|
5
|
+
icon: 'lm-player-fenping16'
|
|
5
6
|
}, {
|
|
6
7
|
name: 4,
|
|
7
8
|
width: '50%',
|
|
8
|
-
height: '50%'
|
|
9
|
+
height: '50%',
|
|
10
|
+
icon: 'lm-player-fenping16'
|
|
11
|
+
}, {
|
|
12
|
+
name: 6,
|
|
13
|
+
width: '33.33333333%',
|
|
14
|
+
height: '33.33333333%',
|
|
15
|
+
icon: 'lm-player-fenping16'
|
|
9
16
|
}, {
|
|
10
17
|
name: 9,
|
|
11
18
|
width: '33.33333333%',
|
|
12
|
-
height: '33.33333333%'
|
|
19
|
+
height: '33.33333333%',
|
|
20
|
+
icon: 'lm-player-fenping16'
|
|
13
21
|
}, {
|
|
14
22
|
name: 16,
|
|
15
23
|
width: '25%',
|
|
16
|
-
height: '25%'
|
|
24
|
+
height: '25%',
|
|
25
|
+
icon: 'lm-player-fenping16'
|
|
17
26
|
}];
|
|
18
27
|
export var TimeModeLibs = [{
|
|
19
|
-
name:
|
|
20
|
-
}, {
|
|
21
|
-
name: 12
|
|
28
|
+
name: 1
|
|
22
29
|
}, {
|
|
23
30
|
name: 6
|
|
24
31
|
}, {
|
|
25
|
-
name:
|
|
32
|
+
name: 12
|
|
33
|
+
}, {
|
|
34
|
+
name: 24
|
|
26
35
|
}];
|
|
27
36
|
export function mergeFill(len, mergeArr, fillItem) {
|
|
28
37
|
return new Array(len).fill(fillItem).map(function (v, i) {
|
package/es/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export { default as Box } from './Box';
|
|
|
6
6
|
export { default as CheckGroupFixed } from './CheckGroupFixed';
|
|
7
7
|
export { default as Config } from './Config';
|
|
8
8
|
export { default as ConfigContext } from './ConfigContext';
|
|
9
|
+
export { default as CustomRenderSelect } from './CustomRenderSelect';
|
|
9
10
|
export { default as DisableMark } from './DisableMark';
|
|
10
11
|
export { default as DomMove } from './DomMove';
|
|
11
12
|
export { default as Drag } from './Drag';
|
package/es/index.js
CHANGED
|
@@ -6,6 +6,7 @@ export { default as Box } from './Box';
|
|
|
6
6
|
export { default as CheckGroupFixed } from './CheckGroupFixed';
|
|
7
7
|
export { default as Config } from './Config';
|
|
8
8
|
export { default as ConfigContext } from './ConfigContext';
|
|
9
|
+
export { default as CustomRenderSelect } from './CustomRenderSelect';
|
|
9
10
|
export { default as DisableMark } from './DisableMark';
|
|
10
11
|
export { default as DomMove } from './DomMove';
|
|
11
12
|
export { default as Drag } from './Drag';
|