@cloud-app-dev/vidc 4.0.7 → 4.0.9
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/.dumirc.ts +0 -10
- package/.fatherrc.ts +1 -4
- package/es/AppContext/Sync.js +10 -24
- package/es/AppContext/index.js +19 -19
- package/es/AppContext/static.js +0 -6
- package/es/Auth/index.js +2 -5
- package/es/AutoExit/index.js +2 -2
- package/es/CheckGroupFixed/demo.js +0 -2
- package/es/CheckGroupFixed/index.js +25 -42
- package/es/CustomRenderSelect/index.js +2 -2
- package/es/DisableMark/index.js +2 -2
- package/es/DomMove/index.js +31 -42
- package/es/DomMove/utils.js +3 -8
- package/es/Drag/DragAndDropItem.js +28 -45
- package/es/Drag/DropItem.js +11 -21
- package/es/DynamicGridList/Demo.js +1 -13
- package/es/DynamicList/demo.js +1 -10
- package/es/DynamicList/index.js +27 -41
- package/es/ErrorFallback/index.js +1 -3
- package/es/EventTools/index.d.ts +3 -0
- package/es/EventTools/index.js +12 -0
- package/es/GridList/Demo.js +5 -18
- package/es/GridList/utils.js +0 -1
- package/es/HightLevel/index.js +1 -5
- package/es/IconFont/index.js +9 -18
- package/es/InstanceHistory/index.js +0 -2
- package/es/ListWithSizeAnimate/index.js +15 -31
- package/es/LoaderScript/index.js +10 -21
- package/es/LoaderScript/utils.js +2 -2
- package/es/Map/BasicMap/AMapInstance.js +6 -16
- package/es/Map/BasicMap/LeafletInstance.js +16 -26
- package/es/Map/ClusterLayer/hook.js +16 -38
- package/es/Map/ClusterLayer/index.js +2 -6
- package/es/Map/Context/index.js +6 -30
- package/es/Map/FindPio/index.js +0 -2
- package/es/Map/LevelCenter/DragMarker/index.js +6 -9
- package/es/Map/LevelCenter/demo.js +12 -21
- package/es/Map/LevelCenter/index.js +8 -14
- package/es/Map/LoaderMap/index.js +14 -17
- package/es/Map/MapDrawSelect/demo.js +14 -25
- package/es/Map/MapDrawSelect/index.js +14 -20
- package/es/Map/MouseTool/index.js +17 -27
- package/es/Map/MouseTool/useMouseTools.js +12 -35
- package/es/Map/ResetTools/index.js +4 -8
- package/es/Map/SinglePoint/index.js +6 -13
- package/es/Map/hook/useMapEvent.js +3 -7
- package/es/Map/hook/useMapType.js +1 -2
- package/es/Map/useMarker/index.js +17 -30
- package/es/Map/withMap/index.js +4 -6
- package/es/Picture/component/DefaultRects/RectInfo.js +13 -27
- package/es/Picture/component/DefaultRects/index.js +7 -10
- package/es/Picture/component/DrawRect/index.js +10 -13
- package/es/Picture/component/RectMenu/index.js +10 -15
- package/es/Picture/component/RectMenu/utils.js +3 -6
- package/es/Picture/component/WheelScale/index.js +3 -5
- package/es/Picture/loadCaptureRectImage.js +42 -61
- package/es/Picture/useDraw.js +23 -39
- package/es/Player/api/index.js +2 -2
- package/es/Player/context.js +5 -9
- package/es/Player/contraller_bar/bar.js +9 -16
- package/es/Player/contraller_bar/contraller_event.js +7 -25
- package/es/Player/contraller_bar/index.js +7 -9
- package/es/Player/contraller_bar/left_bar.js +17 -29
- package/es/Player/contraller_bar/time.js +5 -14
- package/es/Player/contraller_bar/useBarStatus.js +12 -24
- package/es/Player/contraller_bar/volume.js +9 -29
- package/es/Player/event/eventName.js +1 -1
- package/es/Player/event/index.js +28 -63
- package/es/Player/frontend_player.js +16 -27
- package/es/Player/iconfont.js +6 -12
- package/es/Player/live_heart.js +2 -18
- package/es/Player/message.js +15 -35
- package/es/Player/segment_player.js +48 -86
- package/es/Player/single_player.js +1 -1
- package/es/Player/timeline.js +19 -41
- package/es/PlayerExt/demo.js +15 -25
- package/es/PlayerExt/index.js +29 -51
- package/es/ROI/demo.js +0 -2
- package/es/ScreenPlayer/RatePick.js +8 -10
- package/es/ScreenPlayer/Record.js +11 -32
- package/es/ScreenPlayer/TimeMode.js +1 -3
- package/es/ScreenPlayer/useTimeSlider.js +3 -3
- package/es/ScreenPlayer/useVideoFit.js +8 -21
- package/es/SocketEmitter/eventEmitter.d.ts +27 -0
- package/es/SocketEmitter/eventEmitter.js +87 -0
- package/es/SocketEmitter/index.d.ts +24 -0
- package/es/SocketEmitter/index.js +125 -0
- package/es/SocketEmitter/interface.d.ts +4 -0
- package/es/ThemeAntd/demo.js +0 -2
- package/es/VList/utils.js +2 -3
- package/es/bigNumberTransformCN/index.d.ts +5 -0
- package/es/bigNumberTransformCN/index.js +60 -0
- package/es/cache/index.d.ts +34 -0
- package/es/cache/index.js +94 -0
- package/es/copy/index.d.ts +1 -0
- package/es/copy/index.js +9 -0
- package/es/getThemeStyle/index.d.ts +2 -0
- package/es/getThemeStyle/index.js +5 -0
- package/es/index.d.ts +11 -0
- package/es/index.js +12 -1
- package/es/logger/index.d.ts +7 -0
- package/es/logger/index.js +30 -0
- package/es/nextTick/index.d.ts +1 -0
- package/es/nextTick/index.js +7 -0
- package/es/submidstr/index.d.ts +5 -0
- package/es/submidstr/index.js +14 -0
- package/es/treeHelper/index.d.ts +11 -0
- package/es/treeHelper/index.js +173 -0
- package/es/useEventEmitterHandle/index.js +5 -9
- package/es/useFullscreen/demo.js +8 -18
- package/es/useFullscreen/index.js +7 -28
- package/es/useHistory/index.js +0 -2
- package/es/useRafInterval/index.js +3 -27
- package/es/useSimpleState/index.js +11 -22
- package/es/useVirtualList/index.js +21 -57
- package/es/utils.js +2 -2
- package/es/uuid/index.d.ts +4 -0
- package/es/uuid/index.js +15 -0
- package/package.json +4 -5
package/es/PlayerExt/index.js
CHANGED
|
@@ -1,46 +1,39 @@
|
|
|
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); }
|
|
1
2
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2
|
-
|
|
3
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
-
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
7
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
-
|
|
9
8
|
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
9
|
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
|
|
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
|
-
|
|
10
|
+
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; }
|
|
11
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
17
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
18
|
-
|
|
19
13
|
import React, { useEffect, useMemo, useState } from 'react';
|
|
20
14
|
import IconFont from "../Player/iconfont";
|
|
21
15
|
import "./index.less";
|
|
22
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
23
17
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
-
|
|
25
18
|
/**
|
|
26
19
|
* 客户端插件模式,随机端口
|
|
27
20
|
*/
|
|
28
21
|
export var LOCAL_PORT = ['15080', '15081', '15082', '15083', '15084', '15085', '15086', '15087', '15088', '15089'];
|
|
22
|
+
|
|
29
23
|
/**
|
|
30
24
|
* 随机获取端口号
|
|
31
25
|
* @returns
|
|
32
26
|
*/
|
|
33
|
-
|
|
34
27
|
export function getLocalPort() {
|
|
35
28
|
return LOCAL_PORT[Math.floor(Math.random() * LOCAL_PORT.length)];
|
|
36
29
|
}
|
|
30
|
+
|
|
37
31
|
/**
|
|
38
32
|
* @desc 转码插件模式下的url
|
|
39
33
|
* @param url
|
|
40
34
|
* @param params
|
|
41
35
|
* @returns
|
|
42
36
|
*/
|
|
43
|
-
|
|
44
37
|
export function getLocalPlayPath(url) {
|
|
45
38
|
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
46
39
|
var URL_TEMPLATE = "http://127.0.0.1:<port>/video/v1/transcoding?uri=<pull_uri>";
|
|
@@ -50,26 +43,22 @@ export function getLocalPlayPath(url) {
|
|
|
50
43
|
}
|
|
51
44
|
export function usePlugin(mode, key) {
|
|
52
45
|
var _useState = useState({
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
46
|
+
installed: false
|
|
47
|
+
}),
|
|
48
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
49
|
+
state = _useState2[0],
|
|
50
|
+
setState = _useState2[1];
|
|
59
51
|
useEffect(function () {
|
|
60
52
|
if (mode !== 2) {
|
|
61
53
|
return undefined;
|
|
62
54
|
}
|
|
63
|
-
|
|
64
55
|
var port = getLocalPort();
|
|
65
56
|
var url = "http://127.0.0.1:".concat(port, "/video/v1/state");
|
|
66
|
-
|
|
67
57
|
var thenFn = function thenFn(res) {
|
|
68
58
|
return res.status === 200 ? setState({
|
|
69
59
|
installed: true
|
|
70
60
|
}) : undefined;
|
|
71
61
|
};
|
|
72
|
-
|
|
73
62
|
fetch(url).then(thenFn).catch(function (e) {
|
|
74
63
|
return console.error('插件未安装', e);
|
|
75
64
|
});
|
|
@@ -80,10 +69,9 @@ export function usePlugin(mode, key) {
|
|
|
80
69
|
}, [state.installed, mode])
|
|
81
70
|
};
|
|
82
71
|
}
|
|
83
|
-
|
|
84
72
|
function NeedInstallPlugin(_ref) {
|
|
85
73
|
var pluginDownloadUrl = _ref.pluginDownloadUrl,
|
|
86
|
-
|
|
74
|
+
retry = _ref.retry;
|
|
87
75
|
return /*#__PURE__*/_jsx("div", {
|
|
88
76
|
className: "lm-player-ext-layout",
|
|
89
77
|
children: /*#__PURE__*/_jsxs("div", {
|
|
@@ -124,7 +112,6 @@ function NeedInstallPlugin(_ref) {
|
|
|
124
112
|
})
|
|
125
113
|
});
|
|
126
114
|
}
|
|
127
|
-
|
|
128
115
|
function Loading() {
|
|
129
116
|
return /*#__PURE__*/_jsx("div", {
|
|
130
117
|
className: "lm-player-ext-layout",
|
|
@@ -146,7 +133,6 @@ function Loading() {
|
|
|
146
133
|
})
|
|
147
134
|
});
|
|
148
135
|
}
|
|
149
|
-
|
|
150
136
|
function Empty() {
|
|
151
137
|
return /*#__PURE__*/_jsx("div", {
|
|
152
138
|
className: "lm-player-ext-layout",
|
|
@@ -158,37 +144,33 @@ function Empty() {
|
|
|
158
144
|
})
|
|
159
145
|
});
|
|
160
146
|
}
|
|
161
|
-
|
|
162
147
|
export function ExtModel(_ref2) {
|
|
163
148
|
var url = _ref2.url,
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
149
|
+
children = _ref2.children,
|
|
150
|
+
mode = _ref2.mode,
|
|
151
|
+
pluginDownloadUrl = _ref2.pluginDownloadUrl,
|
|
152
|
+
pluginParams = _ref2.pluginParams,
|
|
153
|
+
loading = _ref2.loading,
|
|
154
|
+
segments = _ref2.segments;
|
|
171
155
|
var _useState3 = useState({
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
156
|
+
forceKey: Date.now()
|
|
157
|
+
}),
|
|
158
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
159
|
+
state = _useState4[0],
|
|
160
|
+
setState = _useState4[1];
|
|
178
161
|
var hasUrl = useMemo(function () {
|
|
179
162
|
return !!url || Array.isArray(segments) && segments.findIndex(function (v) {
|
|
180
163
|
return v.url;
|
|
181
164
|
}) > -1;
|
|
182
165
|
}, [segments, url]);
|
|
183
|
-
|
|
184
166
|
var _usePlugin = usePlugin(mode, state.forceKey),
|
|
185
|
-
|
|
186
|
-
|
|
167
|
+
needInstall = _usePlugin.needInstall;
|
|
187
168
|
|
|
169
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
188
170
|
var playUrl = useMemo(function () {
|
|
189
171
|
return mode === 2 && url ? getLocalPlayPath(url, pluginParams) : url;
|
|
190
|
-
}, [url, mode]);
|
|
191
|
-
|
|
172
|
+
}, [url, mode]);
|
|
173
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
192
174
|
var playSegments = useMemo(function () {
|
|
193
175
|
return mode === 2 && segments ? segments.map(function (v) {
|
|
194
176
|
return _objectSpread(_objectSpread({}, v), {}, {
|
|
@@ -196,7 +178,6 @@ export function ExtModel(_ref2) {
|
|
|
196
178
|
});
|
|
197
179
|
}) : segments;
|
|
198
180
|
}, [segments, mode]);
|
|
199
|
-
|
|
200
181
|
if (needInstall) {
|
|
201
182
|
return /*#__PURE__*/_jsx(NeedInstallPlugin, {
|
|
202
183
|
pluginDownloadUrl: pluginDownloadUrl,
|
|
@@ -209,15 +190,12 @@ export function ExtModel(_ref2) {
|
|
|
209
190
|
}
|
|
210
191
|
});
|
|
211
192
|
}
|
|
212
|
-
|
|
213
193
|
if (loading) {
|
|
214
194
|
return /*#__PURE__*/_jsx(Loading, {});
|
|
215
195
|
}
|
|
216
|
-
|
|
217
196
|
if (!hasUrl) {
|
|
218
197
|
return /*#__PURE__*/_jsx(Empty, {});
|
|
219
198
|
}
|
|
220
|
-
|
|
221
199
|
return /*#__PURE__*/_jsx("div", {
|
|
222
200
|
className: "lm-player-ext-layout",
|
|
223
201
|
children: /*#__PURE__*/React.cloneElement(children, mode === 2 ? {
|
package/es/ROI/demo.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import ROI from "./index";
|
|
3
3
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
-
|
|
5
4
|
var App = function App() {
|
|
6
5
|
return /*#__PURE__*/_jsx("div", {
|
|
7
6
|
style: {
|
|
@@ -16,5 +15,4 @@ var App = function App() {
|
|
|
16
15
|
})
|
|
17
16
|
});
|
|
18
17
|
};
|
|
19
|
-
|
|
20
18
|
export default App;
|
|
@@ -3,10 +3,9 @@ import React from 'react';
|
|
|
3
3
|
import CustomRenderSelect from "../CustomRenderSelect";
|
|
4
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
5
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
-
|
|
7
6
|
function RatePick(_ref) {
|
|
8
7
|
var onChange = _ref.onChange,
|
|
9
|
-
|
|
8
|
+
value = _ref.value;
|
|
10
9
|
return /*#__PURE__*/_jsxs(CustomRenderSelect, {
|
|
11
10
|
value: value,
|
|
12
11
|
popupClassName: "rate-select-dropdown ",
|
|
@@ -20,27 +19,26 @@ function RatePick(_ref) {
|
|
|
20
19
|
placement: "topLeft",
|
|
21
20
|
children: [/*#__PURE__*/_jsx(Select.Option, {
|
|
22
21
|
value: 8,
|
|
23
|
-
children: "
|
|
22
|
+
children: "8.0\u500D"
|
|
24
23
|
}), /*#__PURE__*/_jsx(Select.Option, {
|
|
25
24
|
value: 6,
|
|
26
|
-
children: "
|
|
25
|
+
children: "6.0\u500D"
|
|
27
26
|
}), /*#__PURE__*/_jsx(Select.Option, {
|
|
28
27
|
value: 4,
|
|
29
|
-
children: "
|
|
28
|
+
children: "4.0\u500D"
|
|
30
29
|
}), /*#__PURE__*/_jsx(Select.Option, {
|
|
31
30
|
value: 2,
|
|
32
|
-
children: "
|
|
31
|
+
children: "2.0\u500D"
|
|
33
32
|
}), /*#__PURE__*/_jsx(Select.Option, {
|
|
34
33
|
value: 1.5,
|
|
35
|
-
children: "
|
|
34
|
+
children: "1.5\u500D"
|
|
36
35
|
}), /*#__PURE__*/_jsx(Select.Option, {
|
|
37
36
|
value: 1,
|
|
38
|
-
children: "
|
|
37
|
+
children: "1.0\u500D"
|
|
39
38
|
}), /*#__PURE__*/_jsx(Select.Option, {
|
|
40
39
|
value: 0.5,
|
|
41
|
-
children: "
|
|
40
|
+
children: "0.5\u500D"
|
|
42
41
|
})]
|
|
43
42
|
});
|
|
44
43
|
}
|
|
45
|
-
|
|
46
44
|
export default RatePick;
|
|
@@ -58,7 +58,6 @@ function RecordPlayer(_ref) {
|
|
|
58
58
|
fps = _ref.fps,
|
|
59
59
|
seekLoading = _ref.seekLoading,
|
|
60
60
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
61
|
-
console.log(list);
|
|
62
61
|
var _useState = useState(_objectSpread(_objectSpread({}, cloneDeep(defaultState)), {}, {
|
|
63
62
|
screenNum: (_props$defaultScreen = props.defaultScreen) !== null && _props$defaultScreen !== void 0 ? _props$defaultScreen : defaultState.screenNum
|
|
64
63
|
})),
|
|
@@ -103,7 +102,7 @@ function RecordPlayer(_ref) {
|
|
|
103
102
|
}, [state.selectIndex, screenList]);
|
|
104
103
|
var timeBegin = useMemo(function () {
|
|
105
104
|
var _state$begins, _segmentItem$date;
|
|
106
|
-
return (_state$begins = state.begins["".concat(getKey(segmentItem))]) !== null && _state$begins !== void 0 ? _state$begins : ((_segmentItem$date = segmentItem === null || segmentItem === void 0 ? void 0 : segmentItem.date) !== null && _segmentItem$date !== void 0 ? _segmentItem$date : 0) - state.timeMode / 2 * 3600 * 1000;
|
|
105
|
+
return ((_state$begins = state.begins["".concat(getKey(segmentItem))]) !== null && _state$begins !== void 0 ? _state$begins : segmentItem === null || segmentItem === void 0 ? void 0 : segmentItem.date) ? ((_segmentItem$date = segmentItem === null || segmentItem === void 0 ? void 0 : segmentItem.date) !== null && _segmentItem$date !== void 0 ? _segmentItem$date : 0) - state.timeMode / 2 * 3600 * 1000 : undefined;
|
|
107
106
|
}, [segmentItem, state.begins, state.timeMode]);
|
|
108
107
|
var currentTime = useMemo(function () {
|
|
109
108
|
var _state$currentTimes;
|
|
@@ -363,7 +362,7 @@ function RecordPlayer(_ref) {
|
|
|
363
362
|
children: screenList.map(function (item, index) {
|
|
364
363
|
var _state$modes$getKey;
|
|
365
364
|
var className = state.selectIndex === index ? "item".concat(screenType === null || screenType === void 0 ? void 0 : screenType.name, "-").concat(index + 1, " player-current-index") : "item".concat(screenType === null || screenType === void 0 ? void 0 : screenType.name, "-").concat(index + 1);
|
|
366
|
-
var key = item.date && item.cid
|
|
365
|
+
var key = item.date && item.cid ? getKey(item) : "".concat(index);
|
|
367
366
|
var mode = (_state$modes$getKey = state.modes[getKey(item)]) !== null && _state$modes$getKey !== void 0 ? _state$modes$getKey : item.mode;
|
|
368
367
|
var itemClick = function itemClick() {
|
|
369
368
|
return setState(function (old) {
|
|
@@ -374,44 +373,26 @@ function RecordPlayer(_ref) {
|
|
|
374
373
|
};
|
|
375
374
|
return item.recordType === 1 ? /*#__PURE__*/_createElement(SegmentPlayerWithExt, _objectSpread(_objectSpread({}, item), {}, {
|
|
376
375
|
segments: (item === null || item === void 0 ? void 0 : item.segments) || [],
|
|
377
|
-
key: key
|
|
378
|
-
|
|
379
|
-
,
|
|
380
|
-
className: className
|
|
381
|
-
// className={state.selectIndex === index ? 'player-current-index' : ''}
|
|
382
|
-
,
|
|
376
|
+
key: key,
|
|
377
|
+
className: className,
|
|
383
378
|
updatePlayer: function updatePlayer(player) {
|
|
384
379
|
return _updatePlayer(player, index);
|
|
385
380
|
},
|
|
386
|
-
onClick: itemClick
|
|
387
|
-
|
|
388
|
-
// style={{ width: screenType?.width, height: screenType?.height }}
|
|
389
|
-
,
|
|
390
|
-
mode: mode
|
|
391
|
-
// mode={state.modes[`${item?.date}-${item.cid}`] ?? item.mode}
|
|
392
|
-
,
|
|
381
|
+
onClick: itemClick,
|
|
382
|
+
mode: mode,
|
|
393
383
|
fps: fps,
|
|
394
384
|
fpsDelay: fpsDelay,
|
|
395
385
|
httpLoading: item.loading,
|
|
396
386
|
screenIndex: index
|
|
397
387
|
})) : /*#__PURE__*/_createElement(FrontendPlayerWithExt, _objectSpread(_objectSpread({}, item), {}, {
|
|
398
|
-
className: className
|
|
399
|
-
// className={state.selectIndex === index ? 'player-current-index' : ''}
|
|
400
|
-
,
|
|
388
|
+
className: className,
|
|
401
389
|
segments: (item === null || item === void 0 ? void 0 : item.segments) || [],
|
|
402
390
|
updatePlayer: function updatePlayer(player) {
|
|
403
391
|
return _updatePlayer(player, index);
|
|
404
392
|
},
|
|
405
|
-
onClick: itemClick
|
|
406
|
-
|
|
407
|
-
,
|
|
408
|
-
mode: mode
|
|
409
|
-
// mode={state.modes[`${item?.date}-${item.cid}`] ?? item.mode}
|
|
410
|
-
,
|
|
411
|
-
key: key
|
|
412
|
-
// key={item.date && item.cid ? `${item?.date}-${item.cid}` : `${index}`}
|
|
413
|
-
// style={{ width: screenType?.width, height: screenType?.height }}
|
|
414
|
-
,
|
|
393
|
+
onClick: itemClick,
|
|
394
|
+
mode: mode,
|
|
395
|
+
key: key,
|
|
415
396
|
httpLoading: item.loading,
|
|
416
397
|
getLocalRecordUrl: props.getLocalRecordUrl,
|
|
417
398
|
pluginDownloadUrl: props.pluginDownloadUrl,
|
|
@@ -428,9 +409,7 @@ function RecordPlayer(_ref) {
|
|
|
428
409
|
fit: fit,
|
|
429
410
|
toggleFit: toggleFit,
|
|
430
411
|
getPlayerItem: getPlayerItem,
|
|
431
|
-
screenNum: screenNum
|
|
432
|
-
// mode={segmentItem?.cid ? state.modes[`${segmentItem.cid}-${segmentItem.date}`] : (segmentItem?.mode as PlayModeType)}
|
|
433
|
-
,
|
|
412
|
+
screenNum: screenNum,
|
|
434
413
|
mode: state.modes[getKey(segmentItem)] || segmentItem.mode,
|
|
435
414
|
containerRef: domRef,
|
|
436
415
|
updateState: updateState,
|
|
@@ -3,10 +3,9 @@ import React from 'react';
|
|
|
3
3
|
import { TimeModeLibs } from "./utils";
|
|
4
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
5
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
-
|
|
7
6
|
function TimeMode(_ref) {
|
|
8
7
|
var timeMode = _ref.timeMode,
|
|
9
|
-
|
|
8
|
+
onChange = _ref.onChange;
|
|
10
9
|
return /*#__PURE__*/_jsx(Select, {
|
|
11
10
|
value: timeMode,
|
|
12
11
|
onChange: onChange,
|
|
@@ -28,5 +27,4 @@ function TimeMode(_ref) {
|
|
|
28
27
|
})
|
|
29
28
|
});
|
|
30
29
|
}
|
|
31
|
-
|
|
32
30
|
export default TimeMode;
|
|
@@ -1,5 +1,4 @@
|
|
|
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
|
-
import _nextTick from "@cloud-app-dev/utils/es/nextTick";
|
|
3
2
|
import _useEventListener from "ahooks/es/useEventListener";
|
|
4
3
|
import _useUpdateEffect from "ahooks/es/useUpdateEffect";
|
|
5
4
|
import _useSize from "ahooks/es/useSize";
|
|
@@ -16,6 +15,7 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
|
|
|
16
15
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
17
16
|
import moment from 'dayjs';
|
|
18
17
|
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
18
|
+
import nextTick from "../nextTick";
|
|
19
19
|
var hours = [1, 6, 12, 24];
|
|
20
20
|
var currentColor = '#FF000A';
|
|
21
21
|
var normalLineColor = '#ffffff';
|
|
@@ -316,7 +316,7 @@ function useTimeSlider(canvasRef, _ref2) {
|
|
|
316
316
|
hoursPer: new_hoursPer
|
|
317
317
|
});
|
|
318
318
|
});
|
|
319
|
-
|
|
319
|
+
nextTick(function () {
|
|
320
320
|
return onHoursPerChange === null || onHoursPerChange === void 0 ? void 0 : onHoursPerChange(new_hoursPer);
|
|
321
321
|
});
|
|
322
322
|
}, {
|
|
@@ -407,7 +407,7 @@ function useTimeSlider(canvasRef, _ref2) {
|
|
|
407
407
|
current: new_current
|
|
408
408
|
});
|
|
409
409
|
});
|
|
410
|
-
|
|
410
|
+
nextTick(function () {
|
|
411
411
|
return onTimeChange === null || onTimeChange === void 0 ? void 0 : onTimeChange({
|
|
412
412
|
currentTime: new_current
|
|
413
413
|
}, _outTimeline);
|
|
@@ -1,43 +1,30 @@
|
|
|
1
1
|
import _useToggle3 from "ahooks/es/useToggle";
|
|
2
|
-
|
|
3
2
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
4
|
-
|
|
5
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."); }
|
|
6
|
-
|
|
7
4
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
8
|
-
|
|
9
5
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
10
|
-
|
|
11
6
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
12
|
-
|
|
13
7
|
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."); }
|
|
14
|
-
|
|
15
8
|
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); }
|
|
16
|
-
|
|
17
|
-
function
|
|
18
|
-
|
|
19
|
-
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; }
|
|
20
|
-
|
|
9
|
+
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; }
|
|
10
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
21
11
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
22
|
-
|
|
23
12
|
import { useEffect, useMemo } from 'react';
|
|
24
13
|
export default function useVideoFit(containerRef) {
|
|
25
14
|
var deps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
toggle = _useToggle2[1].toggle;
|
|
31
|
-
|
|
15
|
+
var _useToggle = _useToggle3('fill', 'contain'),
|
|
16
|
+
_useToggle2 = _slicedToArray(_useToggle, 2),
|
|
17
|
+
fit = _useToggle2[0],
|
|
18
|
+
toggle = _useToggle2[1].toggle;
|
|
32
19
|
useEffect(function () {
|
|
33
20
|
if (!containerRef.current) {
|
|
34
21
|
return;
|
|
35
22
|
}
|
|
36
|
-
|
|
37
23
|
var videos = containerRef.current.querySelectorAll('video');
|
|
38
24
|
Array.from(videos).forEach(function (item) {
|
|
39
25
|
item.style.objectFit = fit;
|
|
40
|
-
});
|
|
26
|
+
});
|
|
27
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
41
28
|
}, [].concat(_toConsumableArray(deps), [fit]));
|
|
42
29
|
return useMemo(function () {
|
|
43
30
|
return {
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 自定义事件
|
|
3
|
+
* author hjj
|
|
4
|
+
*/
|
|
5
|
+
declare type EventItemType = {
|
|
6
|
+
[key: string]: {
|
|
7
|
+
listener: (data?: any) => void;
|
|
8
|
+
timer: number;
|
|
9
|
+
}[];
|
|
10
|
+
};
|
|
11
|
+
declare class EventEmitter {
|
|
12
|
+
events: EventItemType;
|
|
13
|
+
constructor();
|
|
14
|
+
getEvents(): EventItemType;
|
|
15
|
+
once(eventName: string, listener: (...args: any) => void): void;
|
|
16
|
+
on(eventName: string, listener: (...args: any) => void, timer?: number): void;
|
|
17
|
+
emit(eventName: string, ...args: any): void;
|
|
18
|
+
remove(eventName: string): void;
|
|
19
|
+
off(eventName: string, listener: (...args: any) => void): void;
|
|
20
|
+
clear(): void;
|
|
21
|
+
trigger(eventName: string, args: any): void;
|
|
22
|
+
getListeners(eventName: string): {
|
|
23
|
+
listener: (data?: any) => void;
|
|
24
|
+
timer: number;
|
|
25
|
+
}[];
|
|
26
|
+
}
|
|
27
|
+
export default EventEmitter;
|
|
@@ -0,0 +1,87 @@
|
|
|
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
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3
|
+
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, _toPropertyKey(descriptor.key), descriptor); } }
|
|
4
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
8
|
+
/**
|
|
9
|
+
* 自定义事件
|
|
10
|
+
* author hjj
|
|
11
|
+
*/
|
|
12
|
+
var EventEmitter = /*#__PURE__*/function () {
|
|
13
|
+
function EventEmitter() {
|
|
14
|
+
_classCallCheck(this, EventEmitter);
|
|
15
|
+
_defineProperty(this, "events", void 0);
|
|
16
|
+
this.events = {};
|
|
17
|
+
}
|
|
18
|
+
_createClass(EventEmitter, [{
|
|
19
|
+
key: "getEvents",
|
|
20
|
+
value: function getEvents() {
|
|
21
|
+
return this.events;
|
|
22
|
+
}
|
|
23
|
+
}, {
|
|
24
|
+
key: "once",
|
|
25
|
+
value: function once(eventName, listener) {
|
|
26
|
+
return this.on(eventName, listener, 0);
|
|
27
|
+
}
|
|
28
|
+
}, {
|
|
29
|
+
key: "on",
|
|
30
|
+
value: function on(eventName, listener) {
|
|
31
|
+
var timer = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : -1;
|
|
32
|
+
var listeners = this.getListeners(eventName);
|
|
33
|
+
listeners.push({
|
|
34
|
+
listener: listener,
|
|
35
|
+
timer: timer
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}, {
|
|
39
|
+
key: "emit",
|
|
40
|
+
value: function emit(eventName) {
|
|
41
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
42
|
+
args[_key - 1] = arguments[_key];
|
|
43
|
+
}
|
|
44
|
+
return this.trigger(eventName, args);
|
|
45
|
+
}
|
|
46
|
+
}, {
|
|
47
|
+
key: "remove",
|
|
48
|
+
value: function remove(eventName) {
|
|
49
|
+
this.events[eventName] && delete this.events[eventName];
|
|
50
|
+
}
|
|
51
|
+
}, {
|
|
52
|
+
key: "off",
|
|
53
|
+
value: function off(eventName, listener) {
|
|
54
|
+
var listeners = this.getListeners(eventName);
|
|
55
|
+
var index = listeners.findIndex(function (item) {
|
|
56
|
+
return item.listener === listener;
|
|
57
|
+
});
|
|
58
|
+
index !== -1 && listeners.splice(index, 1);
|
|
59
|
+
}
|
|
60
|
+
}, {
|
|
61
|
+
key: "clear",
|
|
62
|
+
value: function clear() {
|
|
63
|
+
this.events = {};
|
|
64
|
+
}
|
|
65
|
+
}, {
|
|
66
|
+
key: "trigger",
|
|
67
|
+
value: function trigger(eventName, args) {
|
|
68
|
+
var listeners = this.getListeners(eventName);
|
|
69
|
+
for (var i = 0; i < listeners.length; i++) {
|
|
70
|
+
var listener = listeners[i];
|
|
71
|
+
if (listener) {
|
|
72
|
+
listener.listener.apply(this, args || []);
|
|
73
|
+
listener.timer === 0 && listeners.splice(i, 1);
|
|
74
|
+
listeners.length === 0 && delete this.events[eventName];
|
|
75
|
+
listener.timer !== -1 && listener.timer--;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}, {
|
|
80
|
+
key: "getListeners",
|
|
81
|
+
value: function getListeners(eventName) {
|
|
82
|
+
return this.events[eventName] || (this.events[eventName] = []);
|
|
83
|
+
}
|
|
84
|
+
}]);
|
|
85
|
+
return EventEmitter;
|
|
86
|
+
}();
|
|
87
|
+
export default EventEmitter;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import EventEmitter from './eventEmitter';
|
|
2
|
+
declare class SocketEmitter extends EventEmitter {
|
|
3
|
+
sokect: any;
|
|
4
|
+
sokectEvents: string[];
|
|
5
|
+
subActions: {
|
|
6
|
+
[key: string]: (data?: any) => void;
|
|
7
|
+
};
|
|
8
|
+
constructor();
|
|
9
|
+
connect(url: string, options: any): void;
|
|
10
|
+
disconnect(): void;
|
|
11
|
+
/**
|
|
12
|
+
* 抽象socket监听方法
|
|
13
|
+
* @param {*} param0
|
|
14
|
+
*/
|
|
15
|
+
subscribe(eventName: string, listener: (...args: any) => void): void;
|
|
16
|
+
subAction(eventName: string): (data: any) => void;
|
|
17
|
+
/**
|
|
18
|
+
* 抽象socket监听方法
|
|
19
|
+
* @param {*} param0
|
|
20
|
+
*/
|
|
21
|
+
unsubscribe(eventName: string, listener: (...args: any) => void): void;
|
|
22
|
+
}
|
|
23
|
+
declare const LMEvent: SocketEmitter;
|
|
24
|
+
export default LMEvent;
|