@cloud-app-dev/vidc 3.1.16 → 3.1.17

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.
Files changed (153) hide show
  1. package/es/Api/index.js +0 -23
  2. package/es/AppContext/Sync.js +1 -15
  3. package/es/AppContext/index.js +21 -52
  4. package/es/AppContext/static.js +0 -7
  5. package/es/Auth/index.js +2 -5
  6. package/es/AutoExit/index.js +1 -5
  7. package/es/Box/BetweenBox/index.js +6 -8
  8. package/es/Box/InfoBox/index.js +6 -8
  9. package/es/Box/TwoColumnBox/index.js +8 -18
  10. package/es/Box/deps/grid-factory.js +0 -12
  11. package/es/Box/index.js +4 -6
  12. package/es/CheckGroupFixed/index.js +19 -34
  13. package/es/Config/index.js +0 -4
  14. package/es/Config/utils.js +3 -18
  15. package/es/ConfigContext/index.js +1 -3
  16. package/es/CustomRenderSelect/index.js +13 -29
  17. package/es/DisableMark/index.js +2 -2
  18. package/es/DomMove/index.js +24 -37
  19. package/es/DomMove/utils.js +3 -8
  20. package/es/Drag/DragAndDropItem.js +19 -37
  21. package/es/Drag/DropItem.js +5 -15
  22. package/es/Drawer/Demo.js +3 -17
  23. package/es/Drawer/Footer.js +3 -5
  24. package/es/Drawer/index.js +28 -50
  25. package/es/ErrorFallback/index.js +1 -3
  26. package/es/FullScreen/index.js +8 -18
  27. package/es/HightLevel/index.js +1 -5
  28. package/es/IconFont/index.js +5 -11
  29. package/es/ImageView/index.js +8 -20
  30. package/es/Input/index.js +14 -27
  31. package/es/InstanceHistory/index.js +0 -2
  32. package/es/LabelValue/index.js +8 -10
  33. package/es/List/DynamicGridList/Demo.js +0 -11
  34. package/es/List/DynamicGridList/index.js +16 -25
  35. package/es/List/DynamicList/index.js +23 -38
  36. package/es/List/GridList/Demo.js +3 -16
  37. package/es/List/GridList/hook.js +34 -65
  38. package/es/List/GridList/utils.js +0 -1
  39. package/es/List/VList/index.js +10 -20
  40. package/es/List/VList/utils.js +2 -3
  41. package/es/List/index.js +5 -7
  42. package/es/LoaderApp/index.js +5 -22
  43. package/es/LoaderApp/loader.js +5 -13
  44. package/es/LoaderApp/sandbox.back.js +16 -81
  45. package/es/LoaderApp/sandbox.js +8 -22
  46. package/es/LoaderApp/utils.js +20 -49
  47. package/es/LoaderScript/index.js +8 -19
  48. package/es/LoaderScript/utils.js +0 -51
  49. package/es/Map/BasicMap/AMapInstance.js +0 -10
  50. package/es/Map/BasicMap/LeafletInstance.js +11 -20
  51. package/es/Map/BasicMap/index.js +6 -28
  52. package/es/Map/ClusterLayer/hook.js +10 -32
  53. package/es/Map/ClusterLayer/index.js +2 -6
  54. package/es/Map/Config/index.js +8 -21
  55. package/es/Map/Config/utils.js +0 -6
  56. package/es/Map/Context/index.js +2 -22
  57. package/es/Map/FindPio/index.js +0 -2
  58. package/es/Map/InfoWindow/MakerLikeWindow.js +9 -28
  59. package/es/Map/InfoWindow/demo.js +5 -22
  60. package/es/Map/InfoWindow/index.js +13 -29
  61. package/es/Map/LevelCenter/DragMarker/index.js +5 -9
  62. package/es/Map/LevelCenter/demo.js +6 -16
  63. package/es/Map/LevelCenter/index.js +8 -15
  64. package/es/Map/LoaderMap/index.js +10 -10
  65. package/es/Map/MapDrawSelect/demo.js +12 -23
  66. package/es/Map/MapDrawSelect/index.js +14 -21
  67. package/es/Map/MouseTool/index.js +16 -26
  68. package/es/Map/MouseTool/useMouseTools.js +6 -29
  69. package/es/Map/ResetTools/index.js +4 -8
  70. package/es/Map/SinglePoint/index.js +6 -13
  71. package/es/Map/hook/useMapEvent.js +3 -7
  72. package/es/Map/hook/useMapType.js +1 -2
  73. package/es/Map/useMarker/index.js +10 -24
  74. package/es/Map/withMap/index.js +0 -2
  75. package/es/Modal/index.d.ts +1 -1
  76. package/es/Modal/index.js +29 -50
  77. package/es/Picture/component/DefaultRects/RectInfo.js +11 -25
  78. package/es/Picture/component/DefaultRects/index.js +3 -5
  79. package/es/Picture/component/DrawRect/index.js +6 -8
  80. package/es/Picture/component/RectMenu/index.js +10 -16
  81. package/es/Picture/component/RectMenu/utils.js +3 -6
  82. package/es/Picture/component/Tools/index.js +6 -8
  83. package/es/Picture/component/WheelScale/index.js +3 -6
  84. package/es/Picture/dragBound.js +4 -17
  85. package/es/Picture/index.js +46 -87
  86. package/es/Picture/loadCaptureRectImage.js +10 -26
  87. package/es/Picture/useDraw.js +20 -39
  88. package/es/Picture/utils.js +2 -11
  89. package/es/Player/api/index.js +14 -78
  90. package/es/Player/context.js +1 -2
  91. package/es/Player/contraller_bar/bar.js +5 -9
  92. package/es/Player/contraller_bar/contraller_event.js +5 -23
  93. package/es/Player/contraller_bar/index.js +7 -9
  94. package/es/Player/contraller_bar/left_bar.js +15 -27
  95. package/es/Player/contraller_bar/right_bar.js +7 -18
  96. package/es/Player/contraller_bar/time.js +6 -16
  97. package/es/Player/contraller_bar/useBarStatus.js +5 -16
  98. package/es/Player/contraller_bar/volume.js +6 -26
  99. package/es/Player/demo.js +59 -75
  100. package/es/Player/event/errorEvent.js +14 -39
  101. package/es/Player/event/eventName.js +1 -1
  102. package/es/Player/event/index.js +19 -53
  103. package/es/Player/fps_play.js +10 -27
  104. package/es/Player/frontend_player.js +10 -19
  105. package/es/Player/frontend_timeline.js +25 -47
  106. package/es/Player/iconfont.js +2 -5
  107. package/es/Player/live_heart.js +2 -14
  108. package/es/Player/message.js +9 -29
  109. package/es/Player/segment_player.js +39 -77
  110. package/es/Player/segment_timeline.js +42 -68
  111. package/es/Player/single_player.js +64 -87
  112. package/es/Player/style/iconfont.js +10 -17
  113. package/es/Player/timeline.js +11 -28
  114. package/es/Player/util.js +0 -21
  115. package/es/PlayerExt/demo.js +11 -21
  116. package/es/PlayerExt/index.js +18 -43
  117. package/es/Progress/index.js +3 -15
  118. package/es/ROI/demo.js +0 -2
  119. package/es/ROI/index.js +15 -22
  120. package/es/ScreenPlayer/Live.js +34 -67
  121. package/es/ScreenPlayer/LiveTools.js +21 -38
  122. package/es/ScreenPlayer/PlayerWithExt.js +43 -78
  123. package/es/ScreenPlayer/RatePick.js +1 -3
  124. package/es/ScreenPlayer/Record.js +50 -121
  125. package/es/ScreenPlayer/RecordTools.js +32 -54
  126. package/es/ScreenPlayer/ScreenSelect.js +1 -3
  127. package/es/ScreenPlayer/SegmentTimeLine.js +8 -12
  128. package/es/ScreenPlayer/TimeMode.js +1 -3
  129. package/es/ScreenPlayer/TimeSelect.js +11 -26
  130. package/es/ScreenPlayer/demo.js +3 -1
  131. package/es/ScreenPlayer/demo2.js +9 -24
  132. package/es/ScreenPlayer/useRecordList.js +7 -72
  133. package/es/ScreenPlayer/useTimeSlider.js +40 -132
  134. package/es/ScreenPlayer/useVideoFit.js +5 -18
  135. package/es/ScreenPlayer/utils.js +0 -8
  136. package/es/Service/fetch-adapter.js +2 -37
  137. package/es/Service/http.js +8 -27
  138. package/es/TableLayout/index.js +3 -7
  139. package/es/ThemeAntd/demo.js +0 -2
  140. package/es/Timeout/index.js +10 -26
  141. package/es/Tree/demo.js +0 -2
  142. package/es/Tree/index.js +14 -21
  143. package/es/useDrawROI/index.js +51 -105
  144. package/es/useEventEmitterHandle/index.js +2 -6
  145. package/es/useFullscreen/demo.js +6 -16
  146. package/es/useFullscreen/index.js +5 -25
  147. package/es/useHistory/index.js +0 -2
  148. package/es/useInfiniteScroll/index.js +14 -39
  149. package/es/useRafInterval/index.js +2 -26
  150. package/es/useSimpleState/index.js +5 -16
  151. package/es/useVirtualList/index.js +19 -57
  152. package/es/utils.js +0 -28
  153. package/package.json +1 -1
@@ -1,33 +1,24 @@
1
1
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
-
3
2
  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."); }
4
-
5
3
  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); }
6
-
7
4
  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
-
9
5
  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; }
10
-
11
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
-
13
7
  import React, { useEffect, useMemo, useRef, useState } from 'react';
14
8
  import Events from './event/eventName';
15
9
  import useRafInterval from '../useRafInterval';
16
10
  import { useRegisterPlayerEvent } from './event';
17
11
  import { getDomStyleValue } from './util';
18
12
  var oneFps = 1 / 30;
19
-
20
13
  function FPSPlay(_ref) {
21
14
  var api = _ref.api,
22
- event = _ref.event,
23
- fpsDelay = _ref.fpsDelay,
24
- fps = _ref.fps;
25
-
15
+ event = _ref.event,
16
+ fpsDelay = _ref.fpsDelay,
17
+ fps = _ref.fps;
26
18
  var _useState = useState(Date.now()),
27
- _useState2 = _slicedToArray(_useState, 2),
28
- forceKey = _useState2[0],
29
- update = _useState2[1];
30
-
19
+ _useState2 = _slicedToArray(_useState, 2),
20
+ forceKey = _useState2[0],
21
+ update = _useState2[1];
31
22
  var ref = useRef(null);
32
23
  var timerRef = useRef(null);
33
24
  var fps_second = useMemo(function () {
@@ -38,28 +29,22 @@ function FPSPlay(_ref) {
38
29
  if (!ref.current || !event.video) {
39
30
  return;
40
31
  }
41
-
42
32
  var video = event.video;
43
33
  var fpsTime = api.getCurrentTime() + fps_second;
44
34
  video.currentTime = fpsTime;
45
-
46
35
  if (video.currentTime >= api.getDuration()) {
47
36
  clearInterval(timerRef.current);
48
37
  video.currentTime = 0;
49
38
  event.emit(Events.PLAY_ENDED);
50
39
  }
51
-
52
40
  var canvas = ref.current;
53
41
  var ctx = canvas.getContext('2d');
54
-
55
42
  var _video$getBoundingCli = video.getBoundingClientRect(),
56
- width = _video$getBoundingCli.width,
57
- height = _video$getBoundingCli.height;
58
-
43
+ width = _video$getBoundingCli.width,
44
+ height = _video$getBoundingCli.height;
59
45
  canvas.width = width;
60
46
  canvas.height = height;
61
47
  var fit = getDomStyleValue(video, 'object-fit');
62
-
63
48
  if (fit === 'fill') {
64
49
  //全画面绘制,存在拉伸
65
50
  ctx.drawImage(video, 0, 0, width, height);
@@ -73,7 +58,6 @@ function FPSPlay(_ref) {
73
58
  ctx.drawImage(video, paddingSize, 0, s_vw, height);
74
59
  }
75
60
  };
76
-
77
61
  fpsCapture();
78
62
  timerRef.current = setInterval(fpsCapture, fpsDelay);
79
63
  return function () {
@@ -85,8 +69,8 @@ function FPSPlay(_ref) {
85
69
  });
86
70
  useRegisterPlayerEvent(Events.CANVAS_PLAY, function () {
87
71
  update(Date.now());
88
- }); // TODO: 未知情况,video会自动播放,轮训检测并暂停零时解决
89
-
72
+ });
73
+ // TODO: 未知情况,video会自动播放,轮训检测并暂停零时解决
90
74
  useRafInterval(function () {
91
75
  return !api.paused ? api.pause() : null;
92
76
  }, 10);
@@ -95,5 +79,4 @@ function FPSPlay(_ref) {
95
79
  ref: ref
96
80
  });
97
81
  }
98
-
99
82
  export default FPSPlay;
@@ -5,47 +5,39 @@ import React, { useMemo, useRef } from 'react';
5
5
  import SinglePlayer from './single_player';
6
6
  import FrontendTimeLine from './frontend_timeline';
7
7
  import Events from './event/eventName';
8
-
9
8
  /**
10
9
  * @desc 主组件,负责片段整体逻辑控制
11
10
  * @return JSX.Element
12
11
  */
13
12
  function FrontendPlayer(_a) {
14
13
  var url = _a.url,
15
- begin = _a.begin,
16
- end = _a.end,
17
- onSeek = _a.onSeek,
18
- forwordRef = _a.forwordRef,
19
- customTimeLine = _a.customTimeLine,
20
- onCanPlayerInit = _a.onCanPlayerInit,
21
- props = __rest(_a, ["url", "begin", "end", "onSeek", "forwordRef", "customTimeLine", "onCanPlayerInit"]);
22
-
14
+ begin = _a.begin,
15
+ end = _a.end,
16
+ onSeek = _a.onSeek,
17
+ forwordRef = _a.forwordRef,
18
+ customTimeLine = _a.customTimeLine,
19
+ onCanPlayerInit = _a.onCanPlayerInit,
20
+ props = __rest(_a, ["url", "begin", "end", "onSeek", "forwordRef", "customTimeLine", "onCanPlayerInit"]);
23
21
  var update = _useUpdate();
24
-
25
22
  var ref = useRef(null);
26
23
  var playRef = forwordRef ? forwordRef : ref;
27
-
28
24
  var _ref = playRef.current || {},
29
- api = _ref.api,
30
- event = _ref.event; // 转换毫秒
31
-
32
-
25
+ api = _ref.api,
26
+ event = _ref.event;
27
+ // 转换毫秒
33
28
  var duration = useMemo(function () {
34
29
  return (end - begin) / 1000;
35
30
  }, [begin, end]); //单位s 秒
36
31
  // 重置reload
37
-
38
32
  var reload = _useMemoizedFn(function () {
39
33
  playRef.current.event.emit(Events.RELOAD);
40
34
  onSeek === null || onSeek === void 0 ? void 0 : onSeek(begin);
41
35
  playRef.current.api.reload();
42
36
  });
43
-
44
37
  var onInit = _useMemoizedFn(function () {
45
38
  update();
46
39
  onCanPlayerInit === null || onCanPlayerInit === void 0 ? void 0 : onCanPlayerInit();
47
40
  });
48
-
49
41
  var hasReady = api && event;
50
42
  var timeline = customTimeLine !== null && customTimeLine !== void 0 ? customTimeLine : /*#__PURE__*/React.createElement(FrontendTimeLine, {
51
43
  end: end,
@@ -64,5 +56,4 @@ function FrontendPlayer(_a) {
64
56
  customTimeLine: hasReady ? timeline : /*#__PURE__*/React.createElement(React.Fragment, null)
65
57
  }, props));
66
58
  }
67
-
68
59
  export default FrontendPlayer;
@@ -1,17 +1,10 @@
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
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; }
10
-
11
6
  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
7
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
14
-
15
8
  import React, { useMemo, useState, startTransition, useContext } from 'react';
16
9
  import useBarStatus from './contraller_bar/useBarStatus';
17
10
  import { useTimes } from './timeline';
@@ -19,39 +12,33 @@ import { FMT } from './util';
19
12
  import moment from 'moment';
20
13
  import { Context } from './context';
21
14
  import "./style/timeline.css";
22
-
23
15
  function FrontendTimeLine(_ref) {
24
16
  var duration = _ref.duration,
25
- begin = _ref.begin,
26
- end = _ref.end,
27
- onSeek = _ref.onSeek,
28
- url = _ref.url;
29
-
17
+ begin = _ref.begin,
18
+ end = _ref.end,
19
+ onSeek = _ref.onSeek,
20
+ url = _ref.url;
30
21
  var _useContext = useContext(Context),
31
- api = _useContext.api,
32
- event = _useContext.event; // time 是记录seek时跳了多少
33
-
34
-
22
+ api = _useContext.api,
23
+ event = _useContext.event;
24
+ // time 是记录seek时跳了多少
35
25
  var _useState = useState({
36
- time: 0,
37
- markTime: 0,
38
- left: -1,
39
- visible: false
40
- }),
41
- _useState2 = _slicedToArray(_useState, 2),
42
- state = _useState2[0],
43
- setState = _useState2[1];
44
-
45
- var status = useBarStatus(event); //获取视频当前播放时长单位s
46
-
26
+ time: 0,
27
+ markTime: 0,
28
+ left: -1,
29
+ visible: false
30
+ }),
31
+ _useState2 = _slicedToArray(_useState, 2),
32
+ state = _useState2[0],
33
+ setState = _useState2[1];
34
+ var status = useBarStatus(event);
35
+ //获取视频当前播放时长单位s
47
36
  var _useTimes = useTimes(api, event),
48
- _useTimes2 = _slicedToArray(_useTimes, 1),
49
- currentTime = _useTimes2[0];
50
-
37
+ _useTimes2 = _slicedToArray(_useTimes, 1),
38
+ currentTime = _useTimes2[0];
51
39
  var rTime = useMemo(function () {
52
40
  return state.time + currentTime;
53
41
  }, [state.time, currentTime]);
54
-
55
42
  _useUpdateEffect(function () {
56
43
  return setState(function (old) {
57
44
  return Object.assign(Object.assign({}, old), {
@@ -59,27 +46,24 @@ function FrontendTimeLine(_ref) {
59
46
  });
60
47
  });
61
48
  }, [begin]);
62
-
63
49
  var playPercent = useMemo(function () {
64
50
  return rTime / duration * 100;
65
51
  }, [duration, rTime]);
66
52
  var cTime = useMemo(function () {
67
53
  return begin + rTime * 1000;
68
54
  }, [begin, rTime]);
69
-
70
55
  var seekWithLine = function seekWithLine(e) {
71
56
  var rect = e.currentTarget.getBoundingClientRect();
72
57
  var current = e.pageX - rect.left;
73
58
  var cTime = current / rect.width * duration;
74
- onSeek === null || onSeek === void 0 ? void 0 : onSeek(begin + cTime * 1000); //时间轴进度条rTime是要加上currentTime,这里要减去一下,包装交互一致性
75
-
59
+ onSeek === null || onSeek === void 0 ? void 0 : onSeek(begin + cTime * 1000);
60
+ //时间轴进度条rTime是要加上currentTime,这里要减去一下,包装交互一致性
76
61
  setState(function (old) {
77
62
  return Object.assign(Object.assign({}, old), {
78
63
  time: cTime
79
64
  });
80
65
  });
81
66
  };
82
-
83
67
  var onLineMouseOver = function onLineMouseOver(e) {
84
68
  var rect = e.currentTarget.getBoundingClientRect();
85
69
  var left = e.pageX - rect.left;
@@ -91,7 +75,6 @@ function FrontendTimeLine(_ref) {
91
75
  });
92
76
  });
93
77
  };
94
-
95
78
  var onLineMouseOut = function onLineMouseOut(e) {
96
79
  return startTransition(function () {
97
80
  return setState(function (old) {
@@ -101,7 +84,6 @@ function FrontendTimeLine(_ref) {
101
84
  });
102
85
  });
103
86
  };
104
-
105
87
  return /*#__PURE__*/React.createElement("div", {
106
88
  className: "player-timeline-layout frontend-player-timeline-layout ".concat(status === 0 ? 'hide-time-line' : ''),
107
89
  onClick: seekWithLine,
@@ -125,18 +107,15 @@ function FrontendTimeLine(_ref) {
125
107
  }
126
108
  }));
127
109
  }
128
-
129
110
  function TipTitle(_ref2) {
130
111
  var end = _ref2.end,
131
- begin = _ref2.begin,
132
- left = _ref2.left,
133
- current = _ref2.current,
134
- markTime = _ref2.markTime;
135
-
112
+ begin = _ref2.begin,
113
+ left = _ref2.left,
114
+ current = _ref2.current,
115
+ markTime = _ref2.markTime;
136
116
  if (left === -1) {
137
117
  return null;
138
118
  }
139
-
140
119
  return /*#__PURE__*/React.createElement("div", {
141
120
  className: "frontend-line-tip-box",
142
121
  style: {
@@ -148,5 +127,4 @@ function TipTitle(_ref2) {
148
127
  }
149
128
  }, "\u5F55\u50CF\u4FE1\u606F"), /*#__PURE__*/React.createElement("div", null, "\u5F00\u59CB\uFF1A", moment(begin).format(FMT)), /*#__PURE__*/React.createElement("div", null, "\u7ED3\u675F\uFF1A", moment(end).format(FMT)), /*#__PURE__*/React.createElement("div", null, "\u523B\u5EA6\uFF1A", moment(markTime).format(FMT)), /*#__PURE__*/React.createElement("div", null, "\u5F53\u524D\uFF1A", moment(current).format(FMT)));
150
129
  }
151
-
152
130
  export default FrontendTimeLine;
@@ -2,15 +2,12 @@ import { __rest } from "tslib";
2
2
  import React from 'react';
3
3
  import Icon from '../IconFont';
4
4
  import './style/iconfont.js';
5
-
6
5
  function IconFont(_a) {
7
6
  var _a$className = _a.className,
8
- className = _a$className === void 0 ? '' : _a$className,
9
- props = __rest(_a, ["className"]);
10
-
7
+ className = _a$className === void 0 ? '' : _a$className,
8
+ props = __rest(_a, ["className"]);
11
9
  return /*#__PURE__*/React.createElement(Icon, Object.assign({
12
10
  className: "lm-player-iconfont ".concat(className)
13
11
  }, props));
14
12
  }
15
-
16
13
  export default IconFont;
@@ -3,50 +3,38 @@ import _useUpdateEffect from "ahooks/es/useUpdateEffect";
3
3
  import _useDocumentVisibility from "ahooks/es/useDocumentVisibility";
4
4
  import { useRef } from 'react';
5
5
  import Events from './event/eventName';
6
-
7
6
  function useLiveHeart(_ref) {
8
7
  var api = _ref.api,
9
- event = _ref.event,
10
- isLive = _ref.isLive;
11
-
8
+ event = _ref.event,
9
+ isLive = _ref.isLive;
12
10
  var documentVisibility = _useDocumentVisibility();
13
-
14
11
  var cTimeRef = useRef(null);
15
-
16
12
  var run = function run() {
17
13
  if (!isLive || documentVisibility !== 'visible') {
18
14
  return;
19
15
  }
20
-
21
16
  var current = api.getCurrentTime();
22
17
  var buffered = api.getSecondsLoaded();
23
-
24
18
  if (buffered - current > 5) {
25
19
  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));
26
20
  api.seekTo(buffered - 2 > 0 ? buffered - 2 : 0);
27
21
  api.play();
28
22
  }
29
23
  };
30
-
31
24
  _useUpdateEffect(function () {
32
25
  return run();
33
26
  }, [documentVisibility]);
34
-
35
27
  _useRafInterval(function () {
36
28
  return cTimeRef.current = api.getCurrentTime();
37
29
  }, 1 * 1000);
38
-
39
30
  _useRafInterval(function () {
40
31
  return run();
41
32
  }, 30 * 1000);
42
-
43
33
  _useRafInterval(function () {
44
34
  var cuurentTime = api.getCurrentTime();
45
-
46
35
  if (!!isLive && !api.video.paused && cuurentTime === cTimeRef.current) {
47
36
  event.emit(Events.ERROR);
48
37
  }
49
38
  }, 20 * 1000);
50
39
  }
51
-
52
40
  export default useLiveHeart;
@@ -1,49 +1,37 @@
1
1
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
-
3
2
  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."); }
4
-
5
3
  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); }
6
-
7
4
  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
-
9
5
  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; }
10
-
11
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
-
13
7
  import React, { useState, useMemo, useRef } from 'react';
14
8
  import IconFont from './iconfont';
15
9
  import { useRegisterPlayerEvent, useVideoEvent } from './event';
16
10
  import EventName from './event/eventName';
17
11
  import "./style/message.css";
18
-
19
12
  function VideoMessage(_ref) {
20
13
  var event = _ref.event,
21
- api = _ref.api;
22
-
14
+ api = _ref.api;
23
15
  var _useState = useState({
24
- status: null,
25
- errorTimer: null,
26
- loading: false
27
- }),
28
- _useState2 = _slicedToArray(_useState, 2),
29
- state = _useState2[0],
30
- setState = _useState2[1];
31
-
16
+ status: null,
17
+ errorTimer: null,
18
+ loading: false
19
+ }),
20
+ _useState2 = _slicedToArray(_useState, 2),
21
+ state = _useState2[0],
22
+ setState = _useState2[1];
32
23
  var timeRef = useRef(null);
33
24
  var message = useMemo(function () {
34
25
  if (state.status === 'fail') {
35
26
  console.warn("\u89C6\u9891\u9519\u8BEF\uFF0C\u8BF7\u624B\u52A8\u5237\u65B0\u91CD\u8BD5\uFF01");
36
27
  return '请稍后重试!';
37
28
  }
38
-
39
29
  if (state.status === 'reload') {
40
30
  console.warn("\u7B2C".concat(state.errorTimer, "\u6B21\u91CD\u8FDE"));
41
31
  return "\u6B63\u5728\u5237\u65B0...";
42
32
  }
43
-
44
33
  return '';
45
34
  }, [state.errorTimer, state.status]);
46
-
47
35
  var openLoading = function openLoading() {
48
36
  clearTimeout(timeRef.current);
49
37
  timeRef.current = setTimeout(function () {
@@ -54,7 +42,6 @@ function VideoMessage(_ref) {
54
42
  });
55
43
  }, 200);
56
44
  };
57
-
58
45
  var closeLoading = function closeLoading() {
59
46
  clearTimeout(timeRef.current);
60
47
  setState(function (old) {
@@ -63,7 +50,6 @@ function VideoMessage(_ref) {
63
50
  });
64
51
  });
65
52
  };
66
-
67
53
  var errorReload = function errorReload(timer) {
68
54
  clearTimeout(timeRef.current);
69
55
  setState(function () {
@@ -74,7 +60,6 @@ function VideoMessage(_ref) {
74
60
  };
75
61
  });
76
62
  };
77
-
78
63
  var reloadFail = function reloadFail() {
79
64
  return setState(function (old) {
80
65
  return Object.assign(Object.assign({}, old), {
@@ -82,7 +67,6 @@ function VideoMessage(_ref) {
82
67
  });
83
68
  });
84
69
  };
85
-
86
70
  var reloadSuccess = function reloadSuccess() {
87
71
  return setState(function (old) {
88
72
  return Object.assign(Object.assign({}, old), {
@@ -90,7 +74,6 @@ function VideoMessage(_ref) {
90
74
  });
91
75
  });
92
76
  };
93
-
94
77
  var reload = function reload() {
95
78
  return setState(function (old) {
96
79
  return Object.assign(Object.assign({}, old), {
@@ -99,7 +82,6 @@ function VideoMessage(_ref) {
99
82
  });
100
83
  });
101
84
  };
102
-
103
85
  var playEnd = function playEnd() {
104
86
  clearTimeout(timeRef.current);
105
87
  setState(function (old) {
@@ -110,7 +92,6 @@ function VideoMessage(_ref) {
110
92
  });
111
93
  api.pause();
112
94
  };
113
-
114
95
  useVideoEvent('loadstart', openLoading);
115
96
  useVideoEvent('loadeddata', closeLoading);
116
97
  useVideoEvent('canplay', closeLoading);
@@ -121,7 +102,7 @@ function VideoMessage(_ref) {
121
102
  useRegisterPlayerEvent(EventName.HISTORY_PLAY_END, playEnd);
122
103
  useRegisterPlayerEvent(EventName.CLEAR_ERROR_TIMER, reloadSuccess);
123
104
  var loading = state.loading,
124
- status = state.status;
105
+ status = state.status;
125
106
  return /*#__PURE__*/React.createElement("div", {
126
107
  className: "lm-player-message-mask ".concat(loading || status === 'fail' ? 'lm-player-mask-loading-animation' : '')
127
108
  }, /*#__PURE__*/React.createElement(IconFont, {
@@ -131,7 +112,6 @@ function VideoMessage(_ref) {
131
112
  className: "lm-player-message"
132
113
  }, message));
133
114
  }
134
-
135
115
  export var NoSource = function NoSource() {
136
116
  return /*#__PURE__*/React.createElement("div", {
137
117
  className: "lm-player-message-mask lm-player-mask-loading-animation"