@cloud-app-dev/vidc 4.0.0 → 4.0.2
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/es/AppContext/index.js +20 -61
- package/es/AutoExit/index.js +5 -9
- package/es/Config/index.js +0 -5
- package/es/Config/utils.js +7 -27
- package/es/ConfigContext/index.d.ts +1 -1
- package/es/ConfigContext/index.js +1 -3
- package/es/CustomRenderSelect/index.js +19 -39
- package/es/DynamicGridList/index.js +16 -28
- package/es/FullScreen/index.js +10 -22
- package/es/GridList/hook.js +36 -67
- package/es/GridList/index.d.ts +1 -1
- package/es/GridList/index.js +1 -1
- package/es/ImageView/index.js +16 -31
- package/es/LabelValue/index.d.ts +0 -8
- package/es/LabelValue/index.js +11 -16
- package/es/List/index.js +5 -7
- package/es/ListWithSizeAnimate/demo.js +3 -15
- package/es/LoaderScript/utils.js +100 -153
- package/es/Map/InfoWindow/MakerLikeWindow.js +35 -29
- package/es/Map/InfoWindow/demo.js +17 -29
- package/es/Picture/component/Tools/index.js +5 -7
- package/es/Picture/demo.js +15 -19
- package/es/Picture/index.js +70 -104
- package/es/Picture/utils.js +14 -28
- package/es/Player/api/index.d.ts +4 -4
- package/es/Player/api/index.js +47 -92
- package/es/Player/contraller_bar/right_bar.js +12 -23
- package/es/Player/demo.js +47 -62
- package/es/Player/event/errorEvent.d.ts +1 -1
- package/es/Player/event/errorEvent.js +16 -41
- package/es/Player/fps_play.js +15 -33
- package/es/Player/frontend_timeline.js +28 -48
- package/es/Player/player.d.ts +3 -2
- package/es/Player/segment_timeline.js +45 -69
- package/es/Player/single_player.js +111 -117
- package/es/Player/util.d.ts +1 -1
- package/es/Player/util.js +9 -28
- package/es/Progress/index.js +5 -16
- package/es/ROI/index.d.ts +0 -6
- package/es/ROI/index.js +17 -26
- package/es/RefDrawer/Footer.js +3 -5
- package/es/RefDrawer/demo.js +0 -3
- package/es/RefDrawer/index.js +17 -27
- package/es/RefModal/demo.js +0 -3
- package/es/RefModal/index.js +27 -27
- package/es/ScreenPlayer/Live.d.ts +1 -1
- package/es/ScreenPlayer/Live.js +36 -70
- package/es/ScreenPlayer/LiveTools.js +20 -39
- package/es/ScreenPlayer/PlayerWithExt.js +48 -85
- package/es/ScreenPlayer/RecordTools.d.ts +1 -1
- package/es/ScreenPlayer/RecordTools.js +27 -53
- package/es/ScreenPlayer/SegmentTimeLine.js +8 -13
- package/es/ScreenPlayer/TimeSelect.js +9 -24
- package/es/ScreenPlayer/demo.js +3 -2
- package/es/ScreenPlayer/demo2.js +76 -108
- package/es/ScreenPlayer/useTimeSlider.js +63 -141
- package/es/Service/http.js +14 -34
- package/es/TableLayout/index.js +6 -10
- package/es/ThemeAntd/index.js +0 -1
- package/es/Timeout/index.js +16 -31
- package/es/VList/index.d.ts +1 -9
- package/es/VList/index.js +18 -30
- package/es/index.d.ts +0 -1
- package/es/index.js +0 -1
- package/es/typings.d.ts +1 -0
- package/es/useDrawROI/index.js +61 -115
- package/es/useInfiniteScroll/index.js +24 -45
- package/es/utils.js +18 -42
- package/package.json +5 -6
- package/es/LoaderApp/index.d.ts +0 -31
- package/es/LoaderApp/index.js +0 -138
- package/es/LoaderApp/index.less +0 -3
- package/es/LoaderApp/interface.d.ts +0 -9
- package/es/LoaderApp/loader.d.ts +0 -19
- package/es/LoaderApp/loader.js +0 -85
- package/es/LoaderApp/sandbox.back.d.ts +0 -18
- package/es/LoaderApp/sandbox.back.js +0 -368
- package/es/LoaderApp/sandbox.d.ts +0 -12
- package/es/LoaderApp/sandbox.js +0 -113
- package/es/LoaderApp/utils.d.ts +0 -19
- package/es/LoaderApp/utils.js +0 -275
- package/es/ROI/utils.d.ts +0 -1
- package/es/ROI/utils.js +0 -1
|
@@ -1,23 +1,14 @@
|
|
|
1
1
|
import _useInterval from "ahooks/es/useInterval";
|
|
2
2
|
import _useUpdate from "ahooks/es/useUpdate";
|
|
3
3
|
var _excluded = ["containerRef", "oneWinExtTools", "allWinExtTools", "screenNum", "mode", "fit", "hasPlugin"];
|
|
4
|
-
|
|
5
4
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
6
|
-
|
|
7
5
|
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."); }
|
|
8
|
-
|
|
9
6
|
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); }
|
|
10
|
-
|
|
11
|
-
function
|
|
12
|
-
|
|
13
|
-
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; }
|
|
14
|
-
|
|
7
|
+
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; }
|
|
8
|
+
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; } }
|
|
15
9
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
16
|
-
|
|
17
10
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
18
|
-
|
|
19
11
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
20
|
-
|
|
21
12
|
import React from 'react';
|
|
22
13
|
import Volume from "../Player/contraller_bar/volume";
|
|
23
14
|
import IconFont from "../Player/iconfont";
|
|
@@ -25,59 +16,50 @@ import useFullscreen from "../useFullscreen";
|
|
|
25
16
|
import ScreenSelect from "./ScreenSelect";
|
|
26
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
27
18
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
28
|
-
|
|
29
19
|
function LiveTools(_ref) {
|
|
30
20
|
var containerRef = _ref.containerRef,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
21
|
+
oneWinExtTools = _ref.oneWinExtTools,
|
|
22
|
+
allWinExtTools = _ref.allWinExtTools,
|
|
23
|
+
screenNum = _ref.screenNum,
|
|
24
|
+
_ref$mode = _ref.mode,
|
|
25
|
+
mode = _ref$mode === void 0 ? 1 : _ref$mode,
|
|
26
|
+
fit = _ref.fit,
|
|
27
|
+
hasPlugin = _ref.hasPlugin,
|
|
28
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
40
29
|
var _useFullscreen = useFullscreen(containerRef),
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
30
|
+
_useFullscreen2 = _slicedToArray(_useFullscreen, 2),
|
|
31
|
+
isFullscreen = _useFullscreen2[0],
|
|
32
|
+
toggleFullscreen = _useFullscreen2[1].toggleFullscreen;
|
|
33
|
+
var update = _useUpdate();
|
|
34
|
+
// 播放状态控制
|
|
48
35
|
var playToggle = function playToggle() {
|
|
49
|
-
var player = props.getPlayerItem();
|
|
50
|
-
|
|
36
|
+
var player = props.getPlayerItem();
|
|
37
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
51
38
|
player ? player.video.paused ? player.api.play() : player.api.pause() : undefined;
|
|
52
39
|
update();
|
|
53
|
-
};
|
|
54
|
-
|
|
40
|
+
};
|
|
55
41
|
|
|
42
|
+
// 重连
|
|
56
43
|
var reload = function reload() {
|
|
57
44
|
var player = props.getPlayerItem();
|
|
58
45
|
player === null || player === void 0 ? void 0 : player.api.reload();
|
|
59
46
|
};
|
|
60
|
-
|
|
61
47
|
var snapshotaction = function snapshotaction() {
|
|
62
48
|
var player = props.getPlayerItem();
|
|
63
49
|
var base64 = player === null || player === void 0 ? void 0 : player.api.snapshot();
|
|
64
|
-
|
|
65
50
|
if (base64) {
|
|
66
51
|
var _props$snapshot;
|
|
67
|
-
|
|
68
52
|
(_props$snapshot = props.snapshot) === null || _props$snapshot === void 0 ? void 0 : _props$snapshot.call(props, base64);
|
|
69
53
|
}
|
|
70
54
|
};
|
|
71
|
-
|
|
72
55
|
var player = props.getPlayerItem();
|
|
56
|
+
|
|
73
57
|
/**
|
|
74
58
|
* 定时获取play状态
|
|
75
59
|
*/
|
|
76
|
-
|
|
77
60
|
_useInterval(function () {
|
|
78
61
|
return update();
|
|
79
62
|
}, 2000);
|
|
80
|
-
|
|
81
63
|
return /*#__PURE__*/_jsxs("div", {
|
|
82
64
|
className: "player-tools",
|
|
83
65
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
@@ -182,5 +164,4 @@ function LiveTools(_ref) {
|
|
|
182
164
|
})]
|
|
183
165
|
});
|
|
184
166
|
}
|
|
185
|
-
|
|
186
167
|
export default LiveTools;
|
|
@@ -1,32 +1,23 @@
|
|
|
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
|
import _useMemoizedFn from "ahooks/es/useMemoizedFn";
|
|
2
3
|
import _useLatest from "ahooks/es/useLatest";
|
|
3
4
|
import _useUpdate from "ahooks/es/useUpdate";
|
|
4
5
|
var _excluded = ["mode", "url", "type", "style", "className", "updatePlayer", "onClick", "pluginDownloadUrl"],
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
_excluded2 = ["begin", "style", "className", "segments", "mode", "fpsDelay", "fps", "httpLoading"],
|
|
7
|
+
_excluded3 = ["mode", "style", "className", "segments", "pluginDownloadUrl", "screenIndex", "httpLoading"];
|
|
8
8
|
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; }
|
|
9
|
-
|
|
10
9
|
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; }
|
|
11
|
-
|
|
12
|
-
function
|
|
13
|
-
|
|
10
|
+
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; }
|
|
11
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
12
|
+
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); }
|
|
14
13
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
15
|
-
|
|
16
14
|
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."); }
|
|
17
|
-
|
|
18
15
|
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); }
|
|
19
|
-
|
|
20
|
-
function
|
|
21
|
-
|
|
22
|
-
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; }
|
|
23
|
-
|
|
16
|
+
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; }
|
|
17
|
+
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; } }
|
|
24
18
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
25
|
-
|
|
26
19
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
27
|
-
|
|
28
20
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
29
|
-
|
|
30
21
|
import moment from 'dayjs';
|
|
31
22
|
import React, { useEffect, useRef, useState } from 'react';
|
|
32
23
|
import FrontendPlayer from "../Player/frontend_player";
|
|
@@ -38,30 +29,24 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
38
29
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
39
30
|
export function LivePlayerWithExt(_ref) {
|
|
40
31
|
var _ref$current;
|
|
41
|
-
|
|
42
32
|
var mode = _ref.mode,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
33
|
+
url = _ref.url,
|
|
34
|
+
type = _ref.type,
|
|
35
|
+
style = _ref.style,
|
|
36
|
+
className = _ref.className,
|
|
37
|
+
updatePlayer = _ref.updatePlayer,
|
|
38
|
+
onClick = _ref.onClick,
|
|
39
|
+
pluginDownloadUrl = _ref.pluginDownloadUrl,
|
|
40
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
52
41
|
var forceUpdate = _useUpdate();
|
|
53
|
-
|
|
54
42
|
var ref = useRef();
|
|
55
|
-
|
|
56
43
|
var update = function update() {
|
|
57
44
|
updatePlayer(ref);
|
|
58
45
|
forceUpdate();
|
|
59
46
|
};
|
|
60
|
-
|
|
61
47
|
var _useFullscreen = useFullscreen((_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.container),
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
48
|
+
_useFullscreen2 = _slicedToArray(_useFullscreen, 2),
|
|
49
|
+
toggleFullscreen = _useFullscreen2[1].toggleFullscreen;
|
|
65
50
|
return /*#__PURE__*/_jsx("div", {
|
|
66
51
|
className: "player-with-ext-layout ".concat(className),
|
|
67
52
|
style: style,
|
|
@@ -84,30 +69,24 @@ export function LivePlayerWithExt(_ref) {
|
|
|
84
69
|
}
|
|
85
70
|
export function SegmentPlayerWithExt(_ref2) {
|
|
86
71
|
var _ref$current2;
|
|
87
|
-
|
|
88
72
|
var begin = _ref2.begin,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
73
|
+
style = _ref2.style,
|
|
74
|
+
className = _ref2.className,
|
|
75
|
+
segments = _ref2.segments,
|
|
76
|
+
mode = _ref2.mode,
|
|
77
|
+
fpsDelay = _ref2.fpsDelay,
|
|
78
|
+
fps = _ref2.fps,
|
|
79
|
+
httpLoading = _ref2.httpLoading,
|
|
80
|
+
props = _objectWithoutProperties(_ref2, _excluded2);
|
|
98
81
|
var forceUpdate = _useUpdate();
|
|
99
|
-
|
|
100
82
|
var ref = useRef();
|
|
101
|
-
|
|
102
83
|
var update = function update() {
|
|
103
84
|
props.updatePlayer(ref);
|
|
104
85
|
forceUpdate();
|
|
105
86
|
};
|
|
106
|
-
|
|
107
87
|
var _useFullscreen3 = useFullscreen((_ref$current2 = ref.current) === null || _ref$current2 === void 0 ? void 0 : _ref$current2.container),
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
88
|
+
_useFullscreen4 = _slicedToArray(_useFullscreen3, 2),
|
|
89
|
+
toggleFullscreen = _useFullscreen4[1].toggleFullscreen;
|
|
111
90
|
return /*#__PURE__*/_jsx("div", {
|
|
112
91
|
className: "player-with-ext-layout ".concat(className),
|
|
113
92
|
style: style,
|
|
@@ -133,48 +112,39 @@ export function SegmentPlayerWithExt(_ref2) {
|
|
|
133
112
|
}
|
|
134
113
|
export function FrontendPlayerWithExt(_ref3) {
|
|
135
114
|
var _ref$current3;
|
|
136
|
-
|
|
137
115
|
var mode = _ref3.mode,
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
116
|
+
style = _ref3.style,
|
|
117
|
+
className = _ref3.className,
|
|
118
|
+
segments = _ref3.segments,
|
|
119
|
+
pluginDownloadUrl = _ref3.pluginDownloadUrl,
|
|
120
|
+
screenIndex = _ref3.screenIndex,
|
|
121
|
+
httpLoading = _ref3.httpLoading,
|
|
122
|
+
props = _objectWithoutProperties(_ref3, _excluded3);
|
|
146
123
|
var _useState = useState({
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
124
|
+
begin: 0,
|
|
125
|
+
end: 0,
|
|
126
|
+
url: undefined
|
|
127
|
+
}),
|
|
128
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
129
|
+
state = _useState2[0],
|
|
130
|
+
setState = _useState2[1];
|
|
155
131
|
var latestUrl = _useLatest(state.url);
|
|
156
|
-
|
|
157
132
|
useEffect(function () {
|
|
158
133
|
var _segments$index$url, _segments$index;
|
|
159
|
-
|
|
160
134
|
if (!(Array.isArray(segments) && segments.length > 0)) {
|
|
161
135
|
return undefined;
|
|
162
136
|
}
|
|
163
|
-
|
|
164
137
|
var index = segments.findIndex(function (v) {
|
|
165
138
|
return !!v.url;
|
|
166
139
|
});
|
|
167
|
-
|
|
168
140
|
if (index === -1) {
|
|
169
141
|
return undefined;
|
|
170
142
|
}
|
|
171
|
-
|
|
172
143
|
var _ref4 = [segments[0].beginTime, segments[segments.length - 1].endTime],
|
|
173
|
-
|
|
174
|
-
|
|
144
|
+
begin = _ref4[0],
|
|
145
|
+
end = _ref4[1];
|
|
175
146
|
var videoUrl = new URL((_segments$index$url = (_segments$index = segments[index]) === null || _segments$index === void 0 ? void 0 : _segments$index.url) !== null && _segments$index$url !== void 0 ? _segments$index$url : '');
|
|
176
147
|
var url;
|
|
177
|
-
|
|
178
148
|
if (props.getLocalRecordUrl) {
|
|
179
149
|
props.getLocalRecordUrl({
|
|
180
150
|
url: videoUrl,
|
|
@@ -197,19 +167,17 @@ export function FrontendPlayerWithExt(_ref3) {
|
|
|
197
167
|
end: end,
|
|
198
168
|
url: url
|
|
199
169
|
});
|
|
200
|
-
}
|
|
170
|
+
}
|
|
201
171
|
|
|
172
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
202
173
|
}, [segments]);
|
|
203
|
-
|
|
204
174
|
var seekTo = _useMemoizedFn(function (time) {
|
|
205
175
|
if (!latestUrl.current) {
|
|
206
176
|
return;
|
|
207
177
|
}
|
|
208
|
-
|
|
209
178
|
var end = moment().unix();
|
|
210
179
|
var begin = moment(time).unix();
|
|
211
180
|
var videoUrl = new URL(latestUrl.current);
|
|
212
|
-
|
|
213
181
|
if (props.getLocalRecordUrl) {
|
|
214
182
|
props.getLocalRecordUrl({
|
|
215
183
|
url: videoUrl,
|
|
@@ -234,20 +202,15 @@ export function FrontendPlayerWithExt(_ref3) {
|
|
|
234
202
|
});
|
|
235
203
|
}
|
|
236
204
|
});
|
|
237
|
-
|
|
238
205
|
var forceUpdate = _useUpdate();
|
|
239
|
-
|
|
240
206
|
var ref = useRef();
|
|
241
|
-
|
|
242
207
|
var update = _useMemoizedFn(function () {
|
|
243
208
|
props.updatePlayer(ref);
|
|
244
209
|
forceUpdate();
|
|
245
210
|
});
|
|
246
|
-
|
|
247
211
|
var _useFullscreen5 = useFullscreen((_ref$current3 = ref.current) === null || _ref$current3 === void 0 ? void 0 : _ref$current3.container),
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
212
|
+
_useFullscreen6 = _slicedToArray(_useFullscreen5, 2),
|
|
213
|
+
toggleFullscreen = _useFullscreen6[1].toggleFullscreen;
|
|
251
214
|
return /*#__PURE__*/_jsx("div", {
|
|
252
215
|
className: "player-with-ext-layout ".concat(className),
|
|
253
216
|
style: style,
|
|
@@ -3,23 +3,14 @@ import _useUpdateEffect from "ahooks/es/useUpdateEffect";
|
|
|
3
3
|
import _useUpdate from "ahooks/es/useUpdate";
|
|
4
4
|
import _useToggle3 from "ahooks/es/useToggle";
|
|
5
5
|
var _excluded = ["containerRef", "screenNum", "mode", "fit", "time", "oneWinExtTools", "allWinExtTools", "hasPlugin"];
|
|
6
|
-
|
|
7
6
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
-
|
|
9
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."); }
|
|
10
|
-
|
|
11
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); }
|
|
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
|
-
|
|
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; } }
|
|
17
11
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
18
|
-
|
|
19
12
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
20
|
-
|
|
21
13
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
22
|
-
|
|
23
14
|
import React from 'react';
|
|
24
15
|
import Volume from "../Player/contraller_bar/volume";
|
|
25
16
|
import IconFont from "../Player/iconfont";
|
|
@@ -29,83 +20,68 @@ import ScreenSelect from "./ScreenSelect";
|
|
|
29
20
|
import TimeSelect from "./TimeSelect";
|
|
30
21
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
31
22
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
32
|
-
|
|
33
23
|
function RecordTools(_ref) {
|
|
34
24
|
var _player$video$playbac, _player$video, _player$video2;
|
|
35
|
-
|
|
36
25
|
var containerRef = _ref.containerRef,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
26
|
+
screenNum = _ref.screenNum,
|
|
27
|
+
_ref$mode = _ref.mode,
|
|
28
|
+
mode = _ref$mode === void 0 ? 1 : _ref$mode,
|
|
29
|
+
fit = _ref.fit,
|
|
30
|
+
time = _ref.time,
|
|
31
|
+
oneWinExtTools = _ref.oneWinExtTools,
|
|
32
|
+
allWinExtTools = _ref.allWinExtTools,
|
|
33
|
+
hasPlugin = _ref.hasPlugin,
|
|
34
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
47
35
|
var _useFullscreen = useFullscreen(containerRef),
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
36
|
+
_useFullscreen2 = _slicedToArray(_useFullscreen, 2),
|
|
37
|
+
isFullscreen = _useFullscreen2[0],
|
|
38
|
+
toggleFullscreen = _useFullscreen2[1].toggleFullscreen;
|
|
52
39
|
var _useToggle = _useToggle3(false),
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
40
|
+
_useToggle2 = _slicedToArray(_useToggle, 2),
|
|
41
|
+
isFpsPlay = _useToggle2[0],
|
|
42
|
+
toggle = _useToggle2[1].toggle;
|
|
43
|
+
var update = _useUpdate();
|
|
44
|
+
// 播放状态控制
|
|
60
45
|
var playToggle = function playToggle() {
|
|
61
|
-
var player = props.getPlayerItem();
|
|
62
|
-
|
|
46
|
+
var player = props.getPlayerItem();
|
|
47
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
63
48
|
player ? player.video.paused ? player.api.play() : player.api.pause() : undefined;
|
|
64
49
|
update();
|
|
65
|
-
};
|
|
66
|
-
|
|
50
|
+
};
|
|
67
51
|
|
|
52
|
+
// 重连
|
|
68
53
|
var reload = function reload() {
|
|
69
|
-
var player = props.getPlayerItem();
|
|
70
|
-
|
|
54
|
+
var player = props.getPlayerItem();
|
|
55
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
71
56
|
player ? player.reload ? player.reload() : player.api.reload() : undefined;
|
|
72
57
|
};
|
|
73
|
-
|
|
74
58
|
var snapshotaction = function snapshotaction() {
|
|
75
59
|
var player = props.getPlayerItem();
|
|
76
60
|
var base64 = player === null || player === void 0 ? void 0 : player.api.snapshot();
|
|
77
|
-
|
|
78
61
|
if (base64) {
|
|
79
62
|
var _props$snapshot;
|
|
80
|
-
|
|
81
63
|
(_props$snapshot = props.snapshot) === null || _props$snapshot === void 0 ? void 0 : _props$snapshot.call(props, base64);
|
|
82
64
|
}
|
|
83
65
|
};
|
|
84
|
-
|
|
85
66
|
var ratechange = function ratechange(value) {
|
|
86
67
|
var player = props.getPlayerItem();
|
|
87
68
|
player === null || player === void 0 ? void 0 : player.api.setPlaybackRate(value);
|
|
88
69
|
update();
|
|
89
70
|
};
|
|
90
|
-
|
|
91
71
|
var player = props.getPlayerItem();
|
|
92
|
-
|
|
93
72
|
_useUpdateEffect(function () {
|
|
94
73
|
var player = props.getPlayerItem();
|
|
95
|
-
|
|
96
74
|
if (player) {
|
|
97
75
|
isFpsPlay ? player.api.openFpsPlay() : player.api.closeFpsPlay();
|
|
98
76
|
}
|
|
99
77
|
}, [isFpsPlay]);
|
|
78
|
+
|
|
100
79
|
/**
|
|
101
80
|
* 定时获取play状态
|
|
102
81
|
*/
|
|
103
|
-
|
|
104
|
-
|
|
105
82
|
_useRafInterval(function () {
|
|
106
83
|
return update();
|
|
107
84
|
}, 2000);
|
|
108
|
-
|
|
109
85
|
return /*#__PURE__*/_jsxs("div", {
|
|
110
86
|
className: "player-tools",
|
|
111
87
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
@@ -181,9 +157,8 @@ function RecordTools(_ref) {
|
|
|
181
157
|
time: time,
|
|
182
158
|
onChange: function onChange(time) {
|
|
183
159
|
var _props$onTimeChange;
|
|
184
|
-
|
|
185
160
|
return (_props$onTimeChange = props.onTimeChange) === null || _props$onTimeChange === void 0 ? void 0 : _props$onTimeChange.call(props, {
|
|
186
|
-
|
|
161
|
+
currentTime: time
|
|
187
162
|
});
|
|
188
163
|
}
|
|
189
164
|
}), /*#__PURE__*/_jsx("div", {
|
|
@@ -236,5 +211,4 @@ function RecordTools(_ref) {
|
|
|
236
211
|
})]
|
|
237
212
|
});
|
|
238
213
|
}
|
|
239
|
-
|
|
240
214
|
export default RecordTools;
|
|
@@ -3,23 +3,19 @@ import moment from 'dayjs';
|
|
|
3
3
|
import React, { useRef } from 'react';
|
|
4
4
|
import useTimeSlider from "./useTimeSlider";
|
|
5
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
-
|
|
7
6
|
function SegmentTimeLine(_ref) {
|
|
8
7
|
var _ref2;
|
|
9
|
-
|
|
10
8
|
var begin = _ref.begin,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
segments = _ref.segments,
|
|
10
|
+
onTimeChange = _ref.onTimeChange,
|
|
11
|
+
timeMode = _ref.timeMode,
|
|
12
|
+
updateState = _ref.updateState,
|
|
13
|
+
currentTime = _ref.currentTime;
|
|
16
14
|
var ref = useRef(null);
|
|
17
|
-
|
|
18
15
|
var _useThrottleFn = _useThrottleFn2(onTimeChange, {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
wait: 300
|
|
17
|
+
}),
|
|
18
|
+
run = _useThrottleFn.run;
|
|
23
19
|
useTimeSlider(ref, {
|
|
24
20
|
begin: begin !== null && begin !== void 0 ? begin : moment().set('hours', 0).set('minutes', 0).set('seconds', 0).valueOf() - timeMode / 2 * 3600 * 1000,
|
|
25
21
|
currentTime: (_ref2 = currentTime !== null && currentTime !== void 0 ? currentTime : begin) !== null && _ref2 !== void 0 ? _ref2 : moment().set('hours', 0).set('minutes', 0).set('seconds', 0).valueOf(),
|
|
@@ -39,5 +35,4 @@ function SegmentTimeLine(_ref) {
|
|
|
39
35
|
})
|
|
40
36
|
});
|
|
41
37
|
}
|
|
42
|
-
|
|
43
38
|
export default SegmentTimeLine;
|
|
@@ -1,55 +1,41 @@
|
|
|
1
1
|
import _useUpdateEffect from "ahooks/es/useUpdateEffect";
|
|
2
|
-
|
|
3
2
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
|
-
|
|
5
3
|
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."); }
|
|
6
|
-
|
|
7
4
|
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); }
|
|
8
|
-
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
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; }
|
|
12
|
-
|
|
5
|
+
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; }
|
|
6
|
+
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; } }
|
|
13
7
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
-
|
|
15
8
|
import { Button, InputNumber, Popover } from 'antd';
|
|
16
9
|
import moment from 'dayjs';
|
|
17
10
|
import React, { useMemo, useState } from 'react';
|
|
18
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
12
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
|
-
|
|
21
13
|
function TimeSelect(_ref) {
|
|
22
14
|
var time = _ref.time,
|
|
23
|
-
|
|
24
|
-
|
|
15
|
+
onChange = _ref.onChange;
|
|
25
16
|
var _useState = useState(function () {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
17
|
+
var m = time ? moment(time) : moment().set('hours', 0).set('minutes', 0).set('seconds', 0);
|
|
18
|
+
return [m.hour(), m.minute(), m.second()];
|
|
19
|
+
}),
|
|
20
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
21
|
+
values = _useState2[0],
|
|
22
|
+
setValues = _useState2[1];
|
|
33
23
|
var timeStr = useMemo(function () {
|
|
34
24
|
var m = time ? moment(time) : moment().set('hours', 0).set('minutes', 0).set('seconds', 0);
|
|
35
25
|
return m.format('HH:mm:ss');
|
|
36
26
|
}, [time]);
|
|
37
|
-
|
|
38
27
|
var onChangeTime = function onChangeTime() {
|
|
39
28
|
var m = time ? moment(time) : moment().set('hours', 0).set('minutes', 0).set('seconds', 0);
|
|
40
29
|
var newTime = m.set('hours', values[0]).set('minutes', values[1]).set('seconds', values[2]).valueOf();
|
|
41
30
|
onChange === null || onChange === void 0 ? void 0 : onChange(newTime);
|
|
42
31
|
};
|
|
43
|
-
|
|
44
32
|
_useUpdateEffect(function () {
|
|
45
33
|
var m = time ? moment(time) : moment().set('hours', 0).set('minutes', 0).set('seconds', 0);
|
|
46
34
|
setValues([m.hour(), m.minute(), m.second()]);
|
|
47
35
|
}, [time]);
|
|
48
|
-
|
|
49
36
|
var formatter = function formatter(value) {
|
|
50
37
|
return String(value).length === 1 ? "0".concat(value) : value + '';
|
|
51
38
|
};
|
|
52
|
-
|
|
53
39
|
return /*#__PURE__*/_jsx(Popover, {
|
|
54
40
|
content: /*#__PURE__*/_jsxs("div", {
|
|
55
41
|
className: "player-time-select",
|
|
@@ -105,5 +91,4 @@ function TimeSelect(_ref) {
|
|
|
105
91
|
})
|
|
106
92
|
});
|
|
107
93
|
}
|
|
108
|
-
|
|
109
94
|
export default TimeSelect;
|
package/es/ScreenPlayer/demo.js
CHANGED
|
@@ -3,8 +3,9 @@ import React from 'react';
|
|
|
3
3
|
import LivePlayer from "./Live";
|
|
4
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
5
|
var list = [{
|
|
6
|
-
url: '
|
|
7
|
-
type: '
|
|
6
|
+
url: 'http://192.168.101.29:19096/flv/live/38d099e7696af4a57_34020000001320000322/1.flv?origin_url=gb28181%3A%2F%2F192.168.101.149%3A15060%2Fcam%2Frealmonitor%3Fplatform_code%3D34020000002000000005%26code%3D34020000001320000322%26service_code%3D44030501022001000001%26service_ip%3D192.168.101.29%26service_port%3D15060%26media_protocol%3D1%26sip_protocol%3D0%26rtcp_interval%3D9',
|
|
7
|
+
type: 'flv',
|
|
8
|
+
cid: '111'
|
|
8
9
|
}];
|
|
9
10
|
export default function App() {
|
|
10
11
|
return /*#__PURE__*/_jsx(ConfigProvider, {
|