@cloud-app-dev/vidc 2.3.0 → 3.0.0
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/.umirc.ts +2 -2
- package/es/Config/interface.d.ts +2 -1
- package/es/DomMove/demo.d.ts +2 -0
- package/es/DomMove/demo.js +16 -0
- package/es/DomMove/index.d.ts +16 -0
- package/es/DomMove/index.js +145 -0
- package/es/DomMove/utils.d.ts +8 -0
- package/es/{Picture/component/MoveContent → DomMove}/utils.js +19 -0
- package/es/Drawer/index.d.ts +2 -2
- package/es/Drawer/interface.d.ts +4 -174
- package/es/ErrorBoundary/index.d.ts +18 -0
- package/es/ErrorBoundary/index.js +84 -0
- package/es/List/DynamicGridList/Demo.js +40 -27
- package/es/List/DynamicGridList/index.d.ts +20 -29
- package/es/List/DynamicGridList/index.js +40 -63
- package/es/List/DynamicList/index.css +15 -0
- package/es/List/DynamicList/index.d.ts +14 -0
- package/es/List/DynamicList/index.js +105 -0
- package/es/List/DynamicList/interface.d.ts +19 -0
- package/es/List/DynamicList/utils.d.ts +4 -0
- package/es/List/DynamicList/utils.js +6 -0
- package/es/List/GridList/Demo.js +27 -4
- package/es/List/GridList/index.css +1 -0
- package/es/List/GridList/index.d.ts +2 -2
- package/es/List/GridList/index.js +8 -12
- package/es/List/GridList/interface.d.ts +1 -1
- package/es/List/VList/index.js +2 -3
- package/es/List/index.css +2 -54
- package/es/List/index.d.ts +6 -7
- package/es/List/index.js +14 -153
- package/es/List/interface.d.ts +3 -61
- package/es/LoaderApp/index.d.ts +1 -1
- package/es/LoaderApp/index.js +27 -46
- package/es/LoaderApp/interface.d.ts +3 -0
- package/es/LoaderApp/loader.d.ts +6 -7
- package/es/LoaderApp/loader.js +20 -30
- package/es/LoaderApp/sandbox.back.d.ts +18 -0
- package/es/LoaderApp/sandbox.back.js +356 -0
- package/es/LoaderApp/sandbox.d.ts +12 -0
- package/es/LoaderApp/sandbox.js +110 -0
- package/es/LoaderApp/utils.d.ts +5 -1
- package/es/LoaderApp/utils.js +98 -2
- package/es/Map/AMap.d.ts +1572 -0
- package/es/Map/BasicMap/AMapInstance.d.ts +15 -0
- package/es/Map/BasicMap/AMapInstance.js +66 -0
- package/es/Map/BasicMap/LeafletInstance.d.ts +15 -0
- package/es/Map/BasicMap/LeafletInstance.js +98 -0
- package/es/Map/BasicMap/index.css +24 -0
- package/es/Map/BasicMap/index.d.ts +9 -0
- package/es/Map/BasicMap/index.js +108 -0
- package/es/Map/ClusterLayer/hook.d.ts +5 -0
- package/es/Map/ClusterLayer/hook.js +144 -0
- package/es/Map/ClusterLayer/index.css +26 -0
- package/es/Map/ClusterLayer/index.d.ts +5 -0
- package/es/Map/ClusterLayer/index.js +31 -0
- package/es/Map/ClusterLayer/props.d.ts +8 -0
- package/es/Map/Config/index.d.ts +7 -0
- package/es/{InitialConfig → Map/Config}/index.js +35 -36
- package/es/Map/Config/utils.d.ts +2 -0
- package/es/{List/DynamicDeviceList → Map/Config}/utils.js +48 -45
- package/es/Map/Context/index.d.ts +11 -0
- package/es/Map/Context/index.js +66 -0
- package/es/Map/FindPio/index.css +7 -0
- package/es/Map/FindPio/index.d.ts +4 -0
- package/es/Map/FindPio/index.js +16 -0
- package/es/{WorkerFlow/Demo.d.ts → Map/InfoWindow/demo.d.ts} +0 -0
- package/es/{List/DynamicDeviceList/Demo.js → Map/InfoWindow/demo.js} +27 -25
- package/es/Map/InfoWindow/index.d.ts +8 -0
- package/es/Map/InfoWindow/index.js +74 -0
- package/es/Map/LevelCenter/DragMarker/index.d.ts +12 -0
- package/es/Map/LevelCenter/DragMarker/index.js +48 -0
- package/es/{List/DeviceList → Map/LevelCenter}/index.css +0 -0
- package/es/Map/LevelCenter/index.d.ts +13 -0
- package/es/Map/LevelCenter/index.js +42 -0
- package/es/Map/LoaderMap/index.d.ts +12 -0
- package/es/Map/LoaderMap/index.js +58 -0
- package/es/Map/ResetTools/index.css +32 -0
- package/es/Map/ResetTools/index.d.ts +9 -0
- package/es/Map/ResetTools/index.js +61 -0
- package/es/Map/SinglePoint/Marker/index.d.ts +7 -0
- package/es/Map/SinglePoint/Marker/index.js +29 -0
- package/es/Map/SinglePoint/icon/Place_icon_OnLine_Hover.svg +15 -0
- package/es/Map/SinglePoint/icon/Place_icon_OnLine_Normal.svg +15 -0
- package/es/Map/SinglePoint/icon/Place_icon_OutLine_Hover.svg +15 -0
- package/es/Map/SinglePoint/icon/Place_icon_OutLine_Normal.svg +15 -0
- package/es/Map/SinglePoint/index.css +29 -0
- package/es/Map/SinglePoint/index.d.ts +7 -0
- package/es/Map/SinglePoint/index.js +32 -0
- package/es/Map/hook/useMapType.d.ts +4 -0
- package/es/Map/hook/useMapType.js +13 -0
- package/es/Map/icon.d.ts +2 -0
- package/es/Map/icon.js +10 -0
- package/es/Map/index.d.ts +23 -0
- package/es/Map/index.js +25 -0
- package/es/Map/interface.d.ts +55 -0
- package/es/Map/points.json +61247 -0
- package/es/{Picture/component/MoveContent → Map/useMarker}/index.css +0 -0
- package/es/Map/useMarker/index.d.ts +11 -0
- package/es/{WorkerFlow/Form/FormAuth.js → Map/useMarker/index.js} +57 -80
- package/es/Map/withMap/index.d.ts +2 -0
- package/es/Map/withMap/index.js +12 -0
- package/es/Picture/index.d.ts +1 -1
- package/es/Picture/index.js +2 -2
- package/es/Player/api/index.d.ts +1 -0
- package/es/Player/api/index.js +7 -1
- package/es/Player/demo.js +13 -21
- package/es/Player/event/index.js +5 -1
- package/es/Player/frontend_player.d.ts +1 -1
- package/es/Player/frontend_player.js +20 -13
- package/es/Player/frontend_timeline.d.ts +1 -1
- package/es/Player/live_heart.js +45 -12
- package/es/Player/message.js +23 -12
- package/es/Player/player.d.ts +31 -7
- package/es/Player/segment_player.d.ts +1 -1
- package/es/Player/segment_player.js +30 -18
- package/es/Player/segment_timeline.js +6 -6
- package/es/Player/single_player.js +50 -9
- package/es/Player/timeline.js +8 -6
- package/es/Player/util.d.ts +2 -1
- package/es/Player/util.js +4 -1
- package/es/PlayerExt/index.css +2 -2
- package/es/PlayerExt/index.d.ts +3 -1
- package/es/PlayerExt/index.js +19 -5
- package/es/ScreenPlayer/Live.d.ts +5 -0
- package/es/ScreenPlayer/Live.js +109 -0
- package/es/ScreenPlayer/LiveTools.d.ts +15 -0
- package/es/ScreenPlayer/LiveTools.js +95 -0
- package/es/ScreenPlayer/PlayerWithExt.d.ts +22 -0
- package/es/ScreenPlayer/PlayerWithExt.js +169 -0
- package/es/ScreenPlayer/Record.d.ts +5 -0
- package/es/{WorkerFlow/index.js → ScreenPlayer/Record.js} +290 -273
- package/es/ScreenPlayer/RecordTools.d.ts +17 -0
- package/es/ScreenPlayer/RecordTools.js +102 -0
- package/es/ScreenPlayer/SegmentTimeLine.d.ts +10 -0
- package/es/ScreenPlayer/SegmentTimeLine.js +40 -0
- package/es/ScreenPlayer/TimeSlider.d.ts +127 -0
- package/es/ScreenPlayer/TimeSlider.js +528 -0
- package/es/ScreenPlayer/demo.d.ts +2 -0
- package/es/ScreenPlayer/demo.js +25 -0
- package/es/ScreenPlayer/demo2.d.ts +2 -0
- package/es/ScreenPlayer/demo2.js +153 -0
- package/es/ScreenPlayer/index.css +50 -0
- package/es/ScreenPlayer/index.d.ts +6 -0
- package/es/ScreenPlayer/index.js +7 -0
- package/es/ScreenPlayer/interface.d.ts +81 -0
- package/es/ScreenPlayer/useRecordList.d.ts +3 -0
- package/es/{WorkerFlow/Form/UserAndGroupSelect.js → ScreenPlayer/useRecordList.js} +173 -176
- package/es/ScreenPlayer/useVideoFit.d.ts +5 -0
- package/es/ScreenPlayer/useVideoFit.js +46 -0
- package/es/ScreenPlayer/utils.d.ts +25 -0
- package/es/ScreenPlayer/utils.js +84 -0
- package/es/Tree/demo.js +9 -12
- package/es/Tree/index.css +55 -29
- package/es/Tree/index.d.ts +20 -19
- package/es/Tree/index.js +70 -185
- package/es/index.d.ts +7 -9
- package/es/index.js +7 -9
- package/es/useInfiniteScroll/index.d.ts +16 -0
- package/es/{useHttp → useInfiniteScroll}/index.js +79 -43
- package/es/useVirtualList/index.d.ts +13 -0
- package/es/useVirtualList/index.js +175 -0
- package/es/withErrorBoundary/index.d.ts +8 -0
- package/es/withErrorBoundary/index.js +43 -0
- package/package.json +18 -21
- package/test.js +48 -0
- package/es/DeviceIcon/icon.d.ts +0 -9
- package/es/DeviceIcon/icon.js +0 -138
- package/es/DeviceIcon/index.css +0 -8
- package/es/DeviceIcon/index.d.ts +0 -14
- package/es/DeviceIcon/index.js +0 -37
- package/es/DeviceSelect/TreeType.d.ts +0 -7
- package/es/DeviceSelect/TreeType.js +0 -36
- package/es/DeviceSelect/demo.d.ts +0 -3
- package/es/DeviceSelect/demo.js +0 -22
- package/es/DeviceSelect/index.css +0 -11
- package/es/DeviceSelect/index.d.ts +0 -13
- package/es/DeviceSelect/index.js +0 -191
- package/es/Dict/cache.d.ts +0 -3
- package/es/Dict/cache.js +0 -21
- package/es/Dict/device.d.ts +0 -28
- package/es/Dict/device.js +0 -117
- package/es/Dict/hook.d.ts +0 -3
- package/es/Dict/hook.js +0 -98
- package/es/Dict/index.d.ts +0 -9
- package/es/Dict/index.js +0 -10
- package/es/Dict/interface.d.ts +0 -16
- package/es/Dict/utils.d.ts +0 -10
- package/es/Dict/utils.js +0 -44
- package/es/InitialConfig/index.d.ts +0 -8
- package/es/InitialConfig/utils.d.ts +0 -20
- package/es/InitialConfig/utils.js +0 -110
- package/es/InitialRequest/index.d.ts +0 -9
- package/es/InitialRequest/index.js +0 -97
- package/es/InitialRequest/utils.d.ts +0 -10
- package/es/InitialRequest/utils.js +0 -116
- package/es/List/CheckExt.d.ts +0 -9
- package/es/List/CheckExt.js +0 -36
- package/es/List/DeviceList/index.d.ts +0 -11
- package/es/List/DeviceList/index.js +0 -50
- package/es/List/DynamicDeviceList/Demo.d.ts +0 -3
- package/es/List/DynamicDeviceList/index.css +0 -39
- package/es/List/DynamicDeviceList/index.d.ts +0 -12
- package/es/List/DynamicDeviceList/index.js +0 -205
- package/es/List/DynamicDeviceList/interface.d.ts +0 -37
- package/es/List/DynamicDeviceList/utils.d.ts +0 -16
- package/es/List/ListExt/index.css +0 -3
- package/es/List/ListExt/index.d.ts +0 -19
- package/es/List/ListExt/index.js +0 -44
- package/es/Picture/component/MoveContent/index.d.ts +0 -39
- package/es/Picture/component/MoveContent/index.js +0 -244
- package/es/Picture/component/MoveContent/utils.d.ts +0 -4
- package/es/Title/index.css +0 -25
- package/es/Title/index.d.ts +0 -12
- package/es/Title/index.js +0 -30
- package/es/Tree/BaseTree/index.css +0 -64
- package/es/Tree/BaseTree/index.d.ts +0 -24
- package/es/Tree/BaseTree/index.js +0 -83
- package/es/UserSelect/demo.d.ts +0 -3
- package/es/UserSelect/demo.js +0 -21
- package/es/UserSelect/index.css +0 -16
- package/es/UserSelect/index.d.ts +0 -18
- package/es/UserSelect/index.js +0 -194
- package/es/WorkerFlow/Demo.js +0 -57
- package/es/WorkerFlow/Form/Approver.d.ts +0 -10
- package/es/WorkerFlow/Form/Approver.js +0 -33
- package/es/WorkerFlow/Form/Condition.d.ts +0 -11
- package/es/WorkerFlow/Form/Condition.js +0 -235
- package/es/WorkerFlow/Form/EmptyUserSet.d.ts +0 -8
- package/es/WorkerFlow/Form/EmptyUserSet.js +0 -137
- package/es/WorkerFlow/Form/FormAuth.d.ts +0 -8
- package/es/WorkerFlow/Form/GroupList.d.ts +0 -12
- package/es/WorkerFlow/Form/GroupList.js +0 -44
- package/es/WorkerFlow/Form/GroupSelect.d.ts +0 -8
- package/es/WorkerFlow/Form/GroupSelect.js +0 -167
- package/es/WorkerFlow/Form/GroupSelectModalContent.d.ts +0 -6
- package/es/WorkerFlow/Form/GroupSelectModalContent.js +0 -177
- package/es/WorkerFlow/Form/Handle.d.ts +0 -10
- package/es/WorkerFlow/Form/Handle.js +0 -33
- package/es/WorkerFlow/Form/LevelGroupSelect.d.ts +0 -12
- package/es/WorkerFlow/Form/LevelGroupSelect.js +0 -208
- package/es/WorkerFlow/Form/Notifier.d.ts +0 -8
- package/es/WorkerFlow/Form/Notifier.js +0 -16
- package/es/WorkerFlow/Form/UserAndGroupSelect.d.ts +0 -8
- package/es/WorkerFlow/Form/UserSelect.d.ts +0 -8
- package/es/WorkerFlow/Form/UserSelect.js +0 -150
- package/es/WorkerFlow/Form/UserSelectModalContent.d.ts +0 -6
- package/es/WorkerFlow/Form/UserSelectModalContent.js +0 -166
- package/es/WorkerFlow/Form/UserSet.d.ts +0 -14
- package/es/WorkerFlow/Form/UserSet.js +0 -308
- package/es/WorkerFlow/Form/UsersHandleType.d.ts +0 -7
- package/es/WorkerFlow/Form/UsersHandleType.js +0 -32
- package/es/WorkerFlow/Form/utils.d.ts +0 -3
- package/es/WorkerFlow/Form/utils.js +0 -47
- package/es/WorkerFlow/Nodes/Add.d.ts +0 -7
- package/es/WorkerFlow/Nodes/Add.js +0 -98
- package/es/WorkerFlow/Nodes/AddOption.d.ts +0 -10
- package/es/WorkerFlow/Nodes/AddOption.js +0 -23
- package/es/WorkerFlow/Nodes/AddOptionList.d.ts +0 -8
- package/es/WorkerFlow/Nodes/AddOptionList.js +0 -46
- package/es/WorkerFlow/Nodes/Approver.d.ts +0 -11
- package/es/WorkerFlow/Nodes/Approver.js +0 -53
- package/es/WorkerFlow/Nodes/Condition.d.ts +0 -10
- package/es/WorkerFlow/Nodes/Condition.js +0 -140
- package/es/WorkerFlow/Nodes/Constants.d.ts +0 -35
- package/es/WorkerFlow/Nodes/Constants.js +0 -150
- package/es/WorkerFlow/Nodes/End.d.ts +0 -7
- package/es/WorkerFlow/Nodes/End.js +0 -16
- package/es/WorkerFlow/Nodes/Handle.d.ts +0 -11
- package/es/WorkerFlow/Nodes/Handle.js +0 -52
- package/es/WorkerFlow/Nodes/Node.d.ts +0 -8
- package/es/WorkerFlow/Nodes/Node.js +0 -26
- package/es/WorkerFlow/Nodes/Notifier.d.ts +0 -11
- package/es/WorkerFlow/Nodes/Notifier.js +0 -52
- package/es/WorkerFlow/Nodes/Render.d.ts +0 -8
- package/es/WorkerFlow/Nodes/Render.js +0 -16
- package/es/WorkerFlow/Nodes/Start.d.ts +0 -12
- package/es/WorkerFlow/Nodes/Start.js +0 -26
- package/es/WorkerFlow/Nodes/TitleElement.d.ts +0 -10
- package/es/WorkerFlow/Nodes/TitleElement.js +0 -127
- package/es/WorkerFlow/Nodes/Wrap.d.ts +0 -13
- package/es/WorkerFlow/Nodes/Wrap.js +0 -35
- package/es/WorkerFlow/OperatorContext.d.ts +0 -4
- package/es/WorkerFlow/OperatorContext.js +0 -3
- package/es/WorkerFlow/Tools.d.ts +0 -8
- package/es/WorkerFlow/Tools.js +0 -78
- package/es/WorkerFlow/XML/CanvasTag.d.ts +0 -3
- package/es/WorkerFlow/XML/CanvasTag.js +0 -142
- package/es/WorkerFlow/XML/EndEvent.d.ts +0 -1
- package/es/WorkerFlow/XML/EndEvent.js +0 -14
- package/es/WorkerFlow/XML/ExclusiveGateway.d.ts +0 -9
- package/es/WorkerFlow/XML/ExclusiveGateway.js +0 -101
- package/es/WorkerFlow/XML/Root.d.ts +0 -1
- package/es/WorkerFlow/XML/Root.js +0 -5
- package/es/WorkerFlow/XML/StartEvent.d.ts +0 -5
- package/es/WorkerFlow/XML/StartEvent.js +0 -28
- package/es/WorkerFlow/XML/UserTask.d.ts +0 -5
- package/es/WorkerFlow/XML/UserTask.js +0 -93
- package/es/WorkerFlow/XML/index.d.ts +0 -4
- package/es/WorkerFlow/XML/index.js +0 -100
- package/es/WorkerFlow/XML/utils.d.ts +0 -6
- package/es/WorkerFlow/XML/utils.js +0 -97
- package/es/WorkerFlow/data.json +0 -83
- package/es/WorkerFlow/index.css +0 -779
- package/es/WorkerFlow/index.d.ts +0 -13
- package/es/WorkerFlow/interface.d.ts +0 -93
- package/es/WorkerFlow/template.d.ts +0 -2
- package/es/WorkerFlow/template.js +0 -17
- package/es/WorkerFlow/utils.d.ts +0 -14
- package/es/WorkerFlow/utils.js +0 -212
- package/es/useHttp/index.d.ts +0 -8
|
File without changes
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Map } from '../interface';
|
|
2
|
+
import { AMap as AMapType } from '../AMap';
|
|
3
|
+
import './index.less';
|
|
4
|
+
export interface IUseMarkerProps {
|
|
5
|
+
map: Map;
|
|
6
|
+
center: [number, number];
|
|
7
|
+
createIcon: (options?: any) => any;
|
|
8
|
+
options?: AMapType.MarkerOptions;
|
|
9
|
+
}
|
|
10
|
+
declare function useMarker({ map, center, createIcon, options }: IUseMarkerProps): any;
|
|
11
|
+
export default useMarker;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct.bind(); } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
|
|
2
|
+
|
|
3
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
4
|
+
|
|
5
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
5
6
|
|
|
6
7
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
7
8
|
|
|
@@ -23,95 +24,71 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
23
24
|
|
|
24
25
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
25
26
|
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
27
|
+
import { useEffect, useRef, useState } from 'react';
|
|
28
|
+
import useMapType from '../hook/useMapType';
|
|
29
|
+
import "./index.css";
|
|
30
|
+
var _global = window;
|
|
29
31
|
|
|
30
|
-
function
|
|
31
|
-
var
|
|
32
|
-
|
|
32
|
+
function useMarker(_ref) {
|
|
33
|
+
var map = _ref.map,
|
|
34
|
+
center = _ref.center,
|
|
35
|
+
createIcon = _ref.createIcon,
|
|
36
|
+
options = _ref.options;
|
|
33
37
|
|
|
34
38
|
var _useState = useState({
|
|
35
|
-
|
|
39
|
+
marker: null
|
|
36
40
|
}),
|
|
37
41
|
_useState2 = _slicedToArray(_useState, 2),
|
|
38
42
|
state = _useState2[0],
|
|
39
43
|
setState = _useState2[1];
|
|
40
44
|
|
|
41
|
-
var
|
|
42
|
-
|
|
43
|
-
newForm.forEach(function (item) {
|
|
44
|
-
if (item.name === options.name) {
|
|
45
|
-
item.auth = options.auth;
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
setState(function (old) {
|
|
49
|
-
return Object.assign(Object.assign({}, old), {
|
|
50
|
-
form: _toConsumableArray(newForm)
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
}, [state.form]);
|
|
45
|
+
var inMap = useRef(false);
|
|
46
|
+
var type = useMapType();
|
|
54
47
|
useEffect(function () {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}, {
|
|
71
|
-
title: '可编辑',
|
|
72
|
-
align: 'center',
|
|
73
|
-
render: function render(item) {
|
|
74
|
-
return /*#__PURE__*/React.createElement(_Radio, {
|
|
75
|
-
checked: item.auth === 1,
|
|
76
|
-
onClick: function onClick() {
|
|
77
|
-
return onFormAuthChange({
|
|
78
|
-
name: item.name,
|
|
79
|
-
auth: 1
|
|
80
|
-
});
|
|
81
|
-
}
|
|
48
|
+
if (!(center && center.length === 2) || !map) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (type.leaflet) {
|
|
53
|
+
var L = window.L;
|
|
54
|
+
var latlng = L.latLng(center);
|
|
55
|
+
|
|
56
|
+
if (inMap.current) {
|
|
57
|
+
state.marker.setLatLng(latlng);
|
|
58
|
+
} else {
|
|
59
|
+
var marker = L.marker(latlng, {
|
|
60
|
+
icon: createIcon(),
|
|
61
|
+
draggable: true,
|
|
62
|
+
zIndexOffset: 10
|
|
82
63
|
});
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
align: 'center',
|
|
87
|
-
render: function render(item) {
|
|
88
|
-
return /*#__PURE__*/React.createElement(_Radio, {
|
|
89
|
-
checked: item.auth === 2,
|
|
90
|
-
onClick: function onClick() {
|
|
91
|
-
return onFormAuthChange({
|
|
92
|
-
name: item.name,
|
|
93
|
-
auth: 2
|
|
94
|
-
});
|
|
95
|
-
}
|
|
64
|
+
map.addLayer(marker);
|
|
65
|
+
setState({
|
|
66
|
+
marker: marker
|
|
96
67
|
});
|
|
68
|
+
inMap.current = true;
|
|
97
69
|
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if (type.AMap) {
|
|
73
|
+
var AMap = _global.AMap;
|
|
74
|
+
|
|
75
|
+
if (inMap.current) {
|
|
76
|
+
state.marker.setPosition(_construct(AMap.LngLat, _toConsumableArray(center)));
|
|
77
|
+
} else {
|
|
78
|
+
var _marker = new AMap.Marker(Object.assign({
|
|
79
|
+
position: _construct(AMap.LngLat, _toConsumableArray(center))
|
|
80
|
+
}, options));
|
|
81
|
+
|
|
82
|
+
map.add(_marker);
|
|
83
|
+
setState({
|
|
84
|
+
marker: _marker
|
|
110
85
|
});
|
|
86
|
+
inMap.current = true;
|
|
111
87
|
}
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
})
|
|
88
|
+
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
89
|
+
|
|
90
|
+
}, [center, map, options]);
|
|
91
|
+
return state.marker;
|
|
115
92
|
}
|
|
116
93
|
|
|
117
|
-
export default
|
|
94
|
+
export default useMarker;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Map from '../BasicMap';
|
|
3
|
+
|
|
4
|
+
function withMap(Component, className) {
|
|
5
|
+
return function withMapComponent(props) {
|
|
6
|
+
return /*#__PURE__*/React.createElement(Map, {
|
|
7
|
+
className: className
|
|
8
|
+
}, /*#__PURE__*/React.createElement(Component, Object.assign({}, props)));
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default withMap;
|
package/es/Picture/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { IPictureProps } from './interface';
|
|
2
|
+
import type { IPictureProps } from './interface';
|
|
3
3
|
import './index.less';
|
|
4
4
|
declare function Picture({ className, width, height, minHeight, disabledDrag, imagePath, rects, isOpenSelect, disabledDrawMenu, menus, hasTool, fullScreenEle, ...props }: IPictureProps): JSX.Element;
|
|
5
5
|
declare namespace Picture {
|
package/es/Picture/index.js
CHANGED
|
@@ -18,7 +18,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
18
18
|
|
|
19
19
|
import { __awaiter, __rest } from "tslib";
|
|
20
20
|
import React, { useMemo, useRef, useState, useCallback, useEffect } from 'react';
|
|
21
|
-
import
|
|
21
|
+
import DomMove from '../DomMove';
|
|
22
22
|
import { getRectImagePath } from './loadCaptureRectImage';
|
|
23
23
|
import { computedBound } from './dragBound';
|
|
24
24
|
import { customContextMenu, computedRectScale, cloneImageNode } from './utils';
|
|
@@ -276,7 +276,7 @@ function Picture(_a) {
|
|
|
276
276
|
},
|
|
277
277
|
ref: layoutRef,
|
|
278
278
|
onContextMenu: customContextMenu
|
|
279
|
-
}, /*#__PURE__*/React.createElement(
|
|
279
|
+
}, /*#__PURE__*/React.createElement(DomMove, {
|
|
280
280
|
className: "picture-move-layout",
|
|
281
281
|
disabled: isOpenSelect || disabledDrag,
|
|
282
282
|
position: {
|
package/es/Player/api/index.d.ts
CHANGED
package/es/Player/api/index.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import _nextTick from "@cloud-app-dev/utils/es/nextTick";
|
|
2
|
+
|
|
1
3
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
4
|
|
|
3
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."); }
|
|
@@ -180,6 +182,8 @@ var Api = /*#__PURE__*/function () {
|
|
|
180
182
|
|
|
181
183
|
this.reload = function () {};
|
|
182
184
|
|
|
185
|
+
this.toggleFit = function () {};
|
|
186
|
+
|
|
183
187
|
this.destroy = function () {
|
|
184
188
|
_this.container = null;
|
|
185
189
|
};
|
|
@@ -276,7 +280,9 @@ export function usePlayerApi(url, type, isLive, container, segments, flvConfig,
|
|
|
276
280
|
var api = new Api(container);
|
|
277
281
|
setApi(api);
|
|
278
282
|
return function () {
|
|
279
|
-
return
|
|
283
|
+
return _nextTick(function () {
|
|
284
|
+
return api.destroy();
|
|
285
|
+
});
|
|
280
286
|
};
|
|
281
287
|
}, [container, segments]);
|
|
282
288
|
return [api, typePlay];
|
package/es/Player/demo.js
CHANGED
|
@@ -122,37 +122,29 @@ function Demo1() {
|
|
|
122
122
|
}));
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
+
var begin = Date.now();
|
|
126
|
+
|
|
125
127
|
function Demo2() {
|
|
126
128
|
var _useState3 = useState({
|
|
127
129
|
isLive: 1,
|
|
128
130
|
segments: [{
|
|
129
|
-
|
|
131
|
+
beginTime: begin,
|
|
132
|
+
endTime: begin + 60 * 1000,
|
|
130
133
|
url: 'http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4'
|
|
131
134
|
}, {
|
|
132
|
-
|
|
135
|
+
beginTime: begin + 60 * 1000,
|
|
136
|
+
endTime: begin + 2 * 60 * 1000
|
|
133
137
|
}, {
|
|
134
|
-
|
|
138
|
+
beginTime: begin + 2 * 60 * 1000,
|
|
139
|
+
endTime: begin + 3 * 60 * 1000,
|
|
135
140
|
url: 'http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4?date=1'
|
|
136
141
|
}, {
|
|
137
|
-
|
|
142
|
+
beginTime: begin + 3 * 60 * 1000,
|
|
143
|
+
endTime: begin + 4 * 60 * 1000
|
|
138
144
|
}, {
|
|
139
|
-
|
|
145
|
+
beginTime: begin + 4 * 60 * 1000,
|
|
146
|
+
endTime: begin + 5 * 60 * 1000,
|
|
140
147
|
url: 'http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4?date=2'
|
|
141
|
-
}, {
|
|
142
|
-
duration: 60
|
|
143
|
-
}, {
|
|
144
|
-
duration: 60,
|
|
145
|
-
url: 'http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4?date=3'
|
|
146
|
-
}, {
|
|
147
|
-
duration: 60
|
|
148
|
-
}, {
|
|
149
|
-
duration: 60,
|
|
150
|
-
url: 'http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4?date=4'
|
|
151
|
-
}, {
|
|
152
|
-
duration: 60
|
|
153
|
-
}, {
|
|
154
|
-
duration: 60,
|
|
155
|
-
url: 'http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4?date=5'
|
|
156
148
|
}],
|
|
157
149
|
tempUrl: ''
|
|
158
150
|
}),
|
|
@@ -197,7 +189,7 @@ function Demo2() {
|
|
|
197
189
|
});
|
|
198
190
|
}
|
|
199
191
|
}, "\u64AD\u653E")), /*#__PURE__*/React.createElement(SegmentPlayer, {
|
|
200
|
-
begin:
|
|
192
|
+
begin: begin,
|
|
201
193
|
segments: state.segments,
|
|
202
194
|
isLive: false
|
|
203
195
|
}));
|
package/es/Player/event/index.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import _nextTick from "@cloud-app-dev/utils/es/nextTick";
|
|
2
|
+
|
|
1
3
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
4
|
|
|
3
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."); }
|
|
@@ -119,7 +121,9 @@ export function usePlayerEvent(video) {
|
|
|
119
121
|
var event = new VideoEventInstance(video);
|
|
120
122
|
setEvent(event);
|
|
121
123
|
return function () {
|
|
122
|
-
return
|
|
124
|
+
return _nextTick(function () {
|
|
125
|
+
return event.destroy();
|
|
126
|
+
});
|
|
123
127
|
};
|
|
124
128
|
}, [video]);
|
|
125
129
|
return event;
|
|
@@ -5,5 +5,5 @@ import type { IFrontendPlayerProps } from './player';
|
|
|
5
5
|
* @param param0
|
|
6
6
|
* @returns
|
|
7
7
|
*/
|
|
8
|
-
declare function FrontendPlayer({ url, begin, end, onSeek, ...props }: IFrontendPlayerProps): JSX.Element;
|
|
8
|
+
declare function FrontendPlayer({ url, begin, end, onSeek, forwordRef, customTimeLine, onCanPlayerInit, ...props }: IFrontendPlayerProps): JSX.Element;
|
|
9
9
|
export default FrontendPlayer;
|
|
@@ -14,6 +14,7 @@ import { __rest } from "tslib";
|
|
|
14
14
|
import React, { useMemo, useRef, useState } from 'react';
|
|
15
15
|
import SinglePlayer from './single_player';
|
|
16
16
|
import FrontendTimeLine from './frontend_timeline';
|
|
17
|
+
import Events from './event/eventName';
|
|
17
18
|
/**
|
|
18
19
|
* @desc 主组件,负责片段整体逻辑控制
|
|
19
20
|
* @param param0
|
|
@@ -25,7 +26,10 @@ function FrontendPlayer(_a) {
|
|
|
25
26
|
begin = _a.begin,
|
|
26
27
|
end = _a.end,
|
|
27
28
|
onSeek = _a.onSeek,
|
|
28
|
-
|
|
29
|
+
forwordRef = _a.forwordRef,
|
|
30
|
+
customTimeLine = _a.customTimeLine,
|
|
31
|
+
_onCanPlayerInit = _a.onCanPlayerInit,
|
|
32
|
+
props = __rest(_a, ["url", "begin", "end", "onSeek", "forwordRef", "customTimeLine", "onCanPlayerInit"]);
|
|
29
33
|
|
|
30
34
|
var _useState = useState({
|
|
31
35
|
forceKey: Date.now()
|
|
@@ -34,9 +38,10 @@ function FrontendPlayer(_a) {
|
|
|
34
38
|
state = _useState2[0],
|
|
35
39
|
setState = _useState2[1];
|
|
36
40
|
|
|
37
|
-
var
|
|
41
|
+
var ref = useRef(null);
|
|
42
|
+
var playRef = forwordRef ? forwordRef : ref;
|
|
38
43
|
|
|
39
|
-
var _ref =
|
|
44
|
+
var _ref = playRef.current || {},
|
|
40
45
|
api = _ref.api,
|
|
41
46
|
event = _ref.event; // 秒级别转换毫秒
|
|
42
47
|
|
|
@@ -53,8 +58,9 @@ function FrontendPlayer(_a) {
|
|
|
53
58
|
// 重置reload
|
|
54
59
|
|
|
55
60
|
var reload = function reload() {
|
|
56
|
-
|
|
57
|
-
|
|
61
|
+
playRef.current.event.emit(Events.RELOAD);
|
|
62
|
+
onSeek && onSeek(beginTemp);
|
|
63
|
+
playRef.current.api.reload();
|
|
58
64
|
setState(function (old) {
|
|
59
65
|
return Object.assign(Object.assign({}, old), {
|
|
60
66
|
forceKey: Date.now()
|
|
@@ -63,19 +69,20 @@ function FrontendPlayer(_a) {
|
|
|
63
69
|
};
|
|
64
70
|
|
|
65
71
|
return /*#__PURE__*/React.createElement(SinglePlayer, Object.assign({
|
|
66
|
-
ref:
|
|
72
|
+
ref: playRef,
|
|
67
73
|
url: url,
|
|
68
74
|
type: "flv",
|
|
69
75
|
reload: reload,
|
|
70
|
-
isLive:
|
|
76
|
+
isLive: true,
|
|
71
77
|
onCanPlayerInit: function onCanPlayerInit() {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
78
|
+
setState({
|
|
79
|
+
forceKey: Date.now()
|
|
80
|
+
});
|
|
81
|
+
_onCanPlayerInit && _onCanPlayerInit({
|
|
82
|
+
reload: reload
|
|
76
83
|
});
|
|
77
84
|
},
|
|
78
|
-
customTimeLine: api && event
|
|
85
|
+
customTimeLine: api && event && (customTimeLine || /*#__PURE__*/React.createElement(FrontendTimeLine, {
|
|
79
86
|
end: endTemp,
|
|
80
87
|
onSeek: onSeek,
|
|
81
88
|
key: state.forceKey,
|
|
@@ -83,7 +90,7 @@ function FrontendPlayer(_a) {
|
|
|
83
90
|
api: api,
|
|
84
91
|
event: event,
|
|
85
92
|
duration: duration
|
|
86
|
-
})
|
|
93
|
+
}))
|
|
87
94
|
}, props));
|
|
88
95
|
}
|
|
89
96
|
|
|
@@ -8,7 +8,7 @@ interface ITimeLineProps {
|
|
|
8
8
|
duration: number;
|
|
9
9
|
begin: number;
|
|
10
10
|
end: number;
|
|
11
|
-
onSeek(time: number)
|
|
11
|
+
onSeek?: (time: number) => void;
|
|
12
12
|
}
|
|
13
13
|
declare function FrontendTimeLine({ api, event, duration, begin, end, onSeek }: ITimeLineProps): JSX.Element;
|
|
14
14
|
export default FrontendTimeLine;
|
package/es/Player/live_heart.js
CHANGED
|
@@ -1,21 +1,41 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _useUpdateEffect from "ahooks/es/useUpdateEffect";
|
|
2
|
+
|
|
3
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
|
+
|
|
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."); }
|
|
6
|
+
|
|
7
|
+
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 _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
|
+
|
|
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
|
+
|
|
13
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
+
|
|
15
|
+
import React, { useEffect, useState } from 'react';
|
|
2
16
|
import BrowserTab from './event/browserTabEvent';
|
|
3
17
|
|
|
4
18
|
function LiveHeart(_ref) {
|
|
5
19
|
var api = _ref.api;
|
|
6
|
-
useEffect(function () {
|
|
7
|
-
var browserTabChange = function browserTabChange() {
|
|
8
|
-
if (BrowserTab.visibilityState() !== 'visible') {
|
|
9
|
-
return;
|
|
10
|
-
}
|
|
11
20
|
|
|
12
|
-
|
|
13
|
-
|
|
21
|
+
var _useState = useState(Date.now()),
|
|
22
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
23
|
+
runDep = _useState2[0],
|
|
24
|
+
setRundep = _useState2[1];
|
|
14
25
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
26
|
+
var run = function run() {
|
|
27
|
+
var current = api.getCurrentTime();
|
|
28
|
+
var buffered = api.getSecondsLoaded();
|
|
29
|
+
|
|
30
|
+
if (buffered - current > 5) {
|
|
31
|
+
console.debug("\u5F53\u524D\u5EF6\u65F6\u8FC7\u5927current->".concat(current, " buffered->").concat(buffered, ", \u57FA\u4E8E\u89C6\u9891\u5F53\u524D\u7F13\u5B58\u65F6\u95F4\u66F4\u65B0\u5F53\u524D\u64AD\u653E\u65F6\u95F4 updateTime -> ").concat(buffered - 2));
|
|
32
|
+
api.seekTo(buffered - 2 > 0 ? buffered - 2 : 0);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
useEffect(function () {
|
|
37
|
+
var browserTabChange = function browserTabChange() {
|
|
38
|
+
BrowserTab.visibilityState() === 'visible' && run();
|
|
19
39
|
};
|
|
20
40
|
|
|
21
41
|
BrowserTab.addEventListener(browserTabChange);
|
|
@@ -23,6 +43,19 @@ function LiveHeart(_ref) {
|
|
|
23
43
|
BrowserTab.removeEventListener(browserTabChange);
|
|
24
44
|
};
|
|
25
45
|
}, [api]);
|
|
46
|
+
|
|
47
|
+
_useUpdateEffect(function () {
|
|
48
|
+
run();
|
|
49
|
+
}, [runDep]);
|
|
50
|
+
|
|
51
|
+
useEffect(function () {
|
|
52
|
+
var timer = setInterval(function () {
|
|
53
|
+
return setRundep(Date.now());
|
|
54
|
+
}, 30 * 1000);
|
|
55
|
+
return function () {
|
|
56
|
+
return clearInterval(timer);
|
|
57
|
+
};
|
|
58
|
+
}, []);
|
|
26
59
|
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
27
60
|
}
|
|
28
61
|
|
package/es/Player/message.js
CHANGED
|
@@ -10,7 +10,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
10
10
|
|
|
11
11
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
12
|
|
|
13
|
-
import React, { useEffect, useState, useMemo } from 'react';
|
|
13
|
+
import React, { useEffect, useState, useMemo, useRef } from 'react';
|
|
14
14
|
import IconFont from './iconfont';
|
|
15
15
|
import EventName from './event/eventName';
|
|
16
16
|
import "./style/message.css";
|
|
@@ -28,28 +28,35 @@ function VideoMessage(_ref) {
|
|
|
28
28
|
state = _useState2[0],
|
|
29
29
|
setState = _useState2[1];
|
|
30
30
|
|
|
31
|
+
var timeRef = useRef(null);
|
|
31
32
|
var message = useMemo(function () {
|
|
32
33
|
if (state.status === 'fail') {
|
|
33
|
-
|
|
34
|
+
console.warn("\u89C6\u9891\u9519\u8BEF\uFF0C\u8BF7\u624B\u52A8\u5237\u65B0\u91CD\u8BD5\uFF01");
|
|
35
|
+
return '请稍后重试!';
|
|
34
36
|
}
|
|
35
37
|
|
|
36
38
|
if (state.status === 'reload') {
|
|
37
|
-
|
|
39
|
+
console.warn("\u7B2C".concat(state.errorTimer, "\u6B21\u91CD\u8FDE"));
|
|
40
|
+
return "\u6B63\u5728\u5237\u65B0...";
|
|
38
41
|
}
|
|
39
42
|
|
|
40
43
|
return '';
|
|
41
44
|
}, [state.errorTimer, state.status]);
|
|
42
45
|
useEffect(function () {
|
|
43
46
|
var openLoading = function openLoading() {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
+
clearTimeout(timeRef.current);
|
|
48
|
+
timeRef.current = setTimeout(function () {
|
|
49
|
+
return setState(function (old) {
|
|
50
|
+
return Object.assign(Object.assign({}, old), {
|
|
51
|
+
loading: true
|
|
52
|
+
});
|
|
47
53
|
});
|
|
48
|
-
});
|
|
54
|
+
}, 200);
|
|
49
55
|
};
|
|
50
56
|
|
|
51
57
|
var closeLoading = function closeLoading() {
|
|
52
|
-
|
|
58
|
+
clearTimeout(timeRef.current);
|
|
59
|
+
setState(function (old) {
|
|
53
60
|
return Object.assign(Object.assign({}, old), {
|
|
54
61
|
loading: false
|
|
55
62
|
});
|
|
@@ -57,7 +64,8 @@ function VideoMessage(_ref) {
|
|
|
57
64
|
};
|
|
58
65
|
|
|
59
66
|
var errorReload = function errorReload(timer) {
|
|
60
|
-
|
|
67
|
+
clearTimeout(timeRef.current);
|
|
68
|
+
setState(function () {
|
|
61
69
|
return {
|
|
62
70
|
status: 'reload',
|
|
63
71
|
errorTimer: timer,
|
|
@@ -85,18 +93,21 @@ function VideoMessage(_ref) {
|
|
|
85
93
|
var reload = function reload() {
|
|
86
94
|
return setState(function (old) {
|
|
87
95
|
return Object.assign(Object.assign({}, old), {
|
|
88
|
-
status: 'reload'
|
|
96
|
+
status: 'reload',
|
|
97
|
+
loading: true
|
|
89
98
|
});
|
|
90
99
|
});
|
|
91
100
|
};
|
|
92
101
|
|
|
93
102
|
var playEnd = function playEnd() {
|
|
94
|
-
|
|
103
|
+
clearTimeout(timeRef.current);
|
|
104
|
+
setState(function (old) {
|
|
95
105
|
return Object.assign(Object.assign({}, old), {
|
|
96
106
|
status: null,
|
|
97
107
|
loading: false
|
|
98
108
|
});
|
|
99
|
-
})
|
|
109
|
+
});
|
|
110
|
+
api.pause();
|
|
100
111
|
};
|
|
101
112
|
|
|
102
113
|
event.addEventListener('loadstart', openLoading);
|
package/es/Player/player.d.ts
CHANGED
|
@@ -129,9 +129,7 @@ export interface ISinglePlayerProps {
|
|
|
129
129
|
playerEvents?: CustomEvent[];
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
export interface IFrontendPlayerProps extends Omit<ISinglePlayerProps, OmitPlayerProps> {
|
|
132
|
+
export interface IFrontendPlayerProps extends Omit<ISinglePlayerProps, 'isLive' | 'reload' | 'type'> {
|
|
135
133
|
/**
|
|
136
134
|
* 前端录像开始时间
|
|
137
135
|
*/
|
|
@@ -145,10 +143,19 @@ export interface IFrontendPlayerProps extends Omit<ISinglePlayerProps, OmitPlaye
|
|
|
145
143
|
/**
|
|
146
144
|
* 录像时间轴发生变化回调
|
|
147
145
|
*/
|
|
148
|
-
onSeek(time: number)
|
|
146
|
+
onSeek?: (time: number) => void;
|
|
147
|
+
|
|
148
|
+
forwordRef?: React.MutableRefObject<ExportPlayerType>;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* 视频可播放时执行钩子
|
|
152
|
+
*/
|
|
153
|
+
onCanPlayerInit?: (data: any) => void;
|
|
149
154
|
}
|
|
150
155
|
|
|
151
|
-
export interface ISegmentPlayerProps extends Omit<ISinglePlayerProps, 'url' | '
|
|
156
|
+
export interface ISegmentPlayerProps extends Omit<ISinglePlayerProps, 'url' | 'onCanPlayerInit'> {
|
|
157
|
+
onCanPlayerInit?: (ext: { [key: string]: any }) => void;
|
|
158
|
+
|
|
152
159
|
/**
|
|
153
160
|
* 云录像片段信息
|
|
154
161
|
*/
|
|
@@ -158,6 +165,10 @@ export interface ISegmentPlayerProps extends Omit<ISinglePlayerProps, 'url' | 'c
|
|
|
158
165
|
* 云录像开始时间
|
|
159
166
|
*/
|
|
160
167
|
begin?: number;
|
|
168
|
+
|
|
169
|
+
forwordRef?: React.MutableRefObject<ExportPlayerType>;
|
|
170
|
+
|
|
171
|
+
defaultIndex?: number;
|
|
161
172
|
}
|
|
162
173
|
|
|
163
174
|
export const SinglePlayer: React.FunctionComponent<ISinglePlayerProps>;
|
|
@@ -190,17 +201,30 @@ export type ExportPlayerType = {
|
|
|
190
201
|
api: Api;
|
|
191
202
|
event: VideoEventInstance;
|
|
192
203
|
plugins: [FlvJs.Player, Hls];
|
|
204
|
+
fit?: string;
|
|
205
|
+
setIndex?: (i: number) => void;
|
|
206
|
+
seekTo?: (i: number) => void;
|
|
207
|
+
reload?: () => void;
|
|
193
208
|
};
|
|
194
209
|
|
|
195
210
|
export interface ISegmentType {
|
|
211
|
+
id?: string;
|
|
196
212
|
/**
|
|
197
213
|
* 视频片段地址
|
|
198
214
|
*/
|
|
199
215
|
url?: string;
|
|
216
|
+
|
|
200
217
|
/**
|
|
201
|
-
*
|
|
218
|
+
* 片段开始时间
|
|
202
219
|
*/
|
|
203
|
-
|
|
220
|
+
beginTime: number;
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* 片段结束时间
|
|
224
|
+
*/
|
|
225
|
+
endTime: number;
|
|
226
|
+
|
|
227
|
+
style?: any;
|
|
204
228
|
}
|
|
205
229
|
|
|
206
230
|
export const ISegmentTypeDemo: React.FC<ISegmentType>;
|