@cloud-app-dev/vidc 3.0.7 → 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.d.ts +1 -1
- package/es/ScreenPlayer/Record.js +27 -25
- package/es/ScreenPlayer/RecordTools.d.ts +2 -1
- package/es/ScreenPlayer/RecordTools.js +42 -32
- package/es/ScreenPlayer/ScreenSelect.js +41 -20
- package/es/ScreenPlayer/SegmentTimeLine.d.ts +1 -1
- package/es/ScreenPlayer/SegmentTimeLine.js +26 -7
- package/es/ScreenPlayer/TimeMode.js +8 -2
- package/es/ScreenPlayer/TimeSlider.d.ts +2 -0
- package/es/ScreenPlayer/TimeSlider.js +29 -6
- package/es/ScreenPlayer/index.css +26 -10
- package/es/ScreenPlayer/interface.d.ts +8 -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 +1 -1
- package/release-build.sh +3 -0
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;
|