@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,38 +1,24 @@
1
1
  import _nextTick from "@cloud-app-dev/utils/es/nextTick";
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
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
16
-
17
9
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
18
-
19
10
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
20
-
21
11
  import { useEffect, useState } from 'react';
22
12
  import { createFlvPlayer, createHlsPlayer, tryCatch } from '../util';
23
-
24
13
  var Api = /*#__PURE__*/function () {
25
14
  function Api(container) {
26
15
  var _this = this;
27
-
28
16
  _classCallCheck(this, Api);
29
-
30
17
  this.play = function () {
31
18
  tryCatch(function () {
32
19
  return _this.video.play();
33
20
  });
34
21
  };
35
-
36
22
  this.pause = function () {
37
23
  _this.video.pause();
38
24
  };
@@ -40,40 +26,30 @@ var Api = /*#__PURE__*/function () {
40
26
  * 设置currentTime实现seek
41
27
  * @param {*} seconds
42
28
  */
43
-
44
-
45
29
  this.seekTo = function (seconds) {
46
30
  _this.video.currentTime = seconds;
47
31
  };
48
-
49
32
  this.setVolume = function (fraction) {
50
33
  _this.video.volume = fraction;
51
34
  };
52
-
53
35
  this.getVolume = function () {
54
36
  return _this.video.volume;
55
37
  };
56
-
57
38
  this.mute = function () {
58
39
  _this.video.muted = true;
59
40
  };
60
-
61
41
  this.unmute = function () {
62
42
  _this.video.muted = false;
63
43
  };
64
44
  /**
65
45
  * 开启画中画功能
66
46
  */
67
-
68
-
69
47
  this.requestPictureInPicture = function () {
70
48
  _this.video.requestPictureInPicture();
71
49
  };
72
50
  /**
73
51
  * 关闭画中画功能
74
52
  */
75
-
76
-
77
53
  this.exitPictureInPicture = function () {
78
54
  if (document.exitPictureInPicture && document.pictureInPictureElement === _this.video) {
79
55
  document.exitPictureInPicture();
@@ -83,71 +59,52 @@ var Api = /*#__PURE__*/function () {
83
59
  * 设置播放速率
84
60
  * @param {*} rate
85
61
  */
86
-
87
-
88
62
  this.setPlaybackRate = function (rate) {
89
63
  _this.video.playbackRate = rate;
90
64
  };
91
65
  /**
92
66
  * 获取视频总时长
93
67
  */
94
-
95
-
96
68
  this.getDuration = function () {
97
69
  var _this$video = _this.video,
98
- duration = _this$video.duration,
99
- seekable = _this$video.seekable;
100
-
70
+ duration = _this$video.duration,
71
+ seekable = _this$video.seekable;
101
72
  if (duration === Infinity && seekable.length > 0) {
102
73
  return seekable.end(seekable.length - 1);
103
74
  }
104
-
105
75
  return duration;
106
76
  };
107
77
  /**
108
78
  * 获取当前播放时间
109
79
  */
110
-
111
-
112
80
  this.getCurrentTime = function () {
113
81
  return _this.video.currentTime;
114
82
  };
115
83
  /**
116
84
  * 获取缓存时间
117
85
  */
118
-
119
-
120
86
  this.getSecondsLoaded = function () {
121
87
  return _this.getBufferedTime()[1];
122
88
  };
123
89
  /**
124
90
  * 获取当前视频缓存的起止时间
125
91
  */
126
-
127
-
128
92
  this.getBufferedTime = function () {
129
93
  var buffered = _this.video.buffered;
130
-
131
94
  if (buffered.length === 0) {
132
95
  return [0, 0];
133
96
  }
134
-
135
97
  var end = buffered.end(buffered.length - 1);
136
98
  var start = buffered.start(buffered.length - 1);
137
-
138
99
  var duration = _this.getDuration();
139
-
140
100
  if (end > duration) {
141
101
  return duration;
142
102
  }
143
-
144
103
  return [start, end];
145
104
  };
146
105
  /**
147
106
  * 视频截屏方法
148
107
  */
149
-
150
-
151
108
  this.snapshot = function () {
152
109
  var canvas = document.createElement('canvas');
153
110
  var ctx = canvas.getContext('2d');
@@ -161,24 +118,16 @@ var Api = /*#__PURE__*/function () {
161
118
  }, 200);
162
119
  return canvas.toDataURL();
163
120
  };
164
-
165
121
  this.unload = function () {};
166
-
167
122
  this.reload = function () {};
168
-
169
123
  this.toggleFit = function () {};
170
-
171
124
  this.openFpsPlay = function () {};
172
-
173
125
  this.closeFpsPlay = function () {};
174
-
175
126
  this.destroy = function () {
176
127
  _this.container = null;
177
128
  };
178
-
179
129
  this.container = container;
180
130
  }
181
-
182
131
  _createClass(Api, [{
183
132
  key: "video",
184
133
  get: function get() {
@@ -195,48 +144,38 @@ var Api = /*#__PURE__*/function () {
195
144
  return this.video.muted;
196
145
  }
197
146
  }]);
198
-
199
147
  return Api;
200
148
  }(); // 创建播放介质
201
-
202
-
203
149
  export function useTypeAndPlay(url, type, isLive, container, segments, flvConfig, hlsConfig) {
204
150
  var _useState = useState({
205
- type: '',
206
- flv: undefined,
207
- hls: undefined
208
- }),
209
- _useState2 = _slicedToArray(_useState, 2),
210
- state = _useState2[0],
211
- setState = _useState2[1];
212
-
151
+ type: '',
152
+ flv: undefined,
153
+ hls: undefined
154
+ }),
155
+ _useState2 = _slicedToArray(_useState, 2),
156
+ state = _useState2[0],
157
+ setState = _useState2[1];
213
158
  useEffect(function () {
214
159
  var isReady = container && (url || type === 'flv' && segments);
215
-
216
160
  if (!isReady) {
217
161
  return undefined;
218
162
  }
219
-
220
163
  var video = container.querySelector('video');
221
164
  var options = {};
222
-
223
165
  switch (type) {
224
166
  case 'flv':
225
167
  options.type = 'flv';
226
168
  options.flv = createFlvPlayer(video, url, isLive, flvConfig);
227
169
  break;
228
-
229
170
  case 'hls':
230
171
  options.type = 'hls';
231
172
  options.hls = createHlsPlayer(video, url, isLive, hlsConfig);
232
173
  break;
233
-
234
174
  default:
235
175
  options.type = 'native';
236
176
  video.setAttribute('src', url);
237
177
  break;
238
178
  }
239
-
240
179
  video.paused && tryCatch(function () {
241
180
  return video.play();
242
181
  });
@@ -256,26 +195,23 @@ export function useTypeAndPlay(url, type, isLive, container, segments, flvConfig
256
195
  video.pause();
257
196
  video.removeAttribute('src');
258
197
  }
259
-
260
198
  setState({});
261
199
  };
262
200
  }, [url, container, segments, type, isLive, flvConfig, hlsConfig]);
263
201
  return [state.type, state.flv, state.hls];
264
- } //创建Api
265
-
202
+ }
203
+ //创建Api
266
204
  export function usePlayerApi(url, type, isLive, container, segments, flvConfig, hlsConfig) {
267
205
  var _useState3 = useState(null),
268
- _useState4 = _slicedToArray(_useState3, 2),
269
- api = _useState4[0],
270
- setApi = _useState4[1];
271
-
206
+ _useState4 = _slicedToArray(_useState3, 2),
207
+ api = _useState4[0],
208
+ setApi = _useState4[1];
272
209
  var typePlay = useTypeAndPlay(url, type, isLive, container, segments, flvConfig, hlsConfig);
273
210
  useEffect(function () {
274
211
  if (!container) {
275
212
  console.debug('wait create api...');
276
213
  return undefined;
277
214
  }
278
-
279
215
  var api = new Api(container);
280
216
  setApi(api);
281
217
  return function () {
@@ -3,8 +3,7 @@ import React from 'react';
3
3
  export var Context = /*#__PURE__*/React.createContext(null);
4
4
  export function Provider(_a) {
5
5
  var children = _a.children,
6
- props = __rest(_a, ["children"]);
7
-
6
+ props = __rest(_a, ["children"]);
8
7
  return /*#__PURE__*/React.createElement(Context.Provider, {
9
8
  value: Object.assign({}, props)
10
9
  }, children);
@@ -1,21 +1,17 @@
1
1
  import { __rest } from "tslib";
2
2
  import React from 'react';
3
-
4
3
  function Bar(_a) {
5
4
  var _a$visibel = _a.visibel,
6
- visibel = _a$visibel === void 0 ? true : _a$visibel,
7
- _a$className = _a.className,
8
- className = _a$className === void 0 ? '' : _a$className,
9
- children = _a.children,
10
- props = __rest(_a, ["visibel", "className", "children"]);
11
-
5
+ visibel = _a$visibel === void 0 ? true : _a$visibel,
6
+ _a$className = _a.className,
7
+ className = _a$className === void 0 ? '' : _a$className,
8
+ children = _a.children,
9
+ props = __rest(_a, ["visibel", "className", "children"]);
12
10
  if (visibel === false) {
13
11
  return null;
14
12
  }
15
-
16
13
  return /*#__PURE__*/React.createElement("span", Object.assign({
17
14
  className: "contraller-bar-item ".concat(className)
18
15
  }, props), children);
19
16
  }
20
-
21
17
  export default Bar;
@@ -1,42 +1,29 @@
1
1
  import _useEventListener from "ahooks/es/useEventListener";
2
2
  import _useMount from "ahooks/es/useMount";
3
-
4
3
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
5
-
6
4
  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."); }
7
-
8
5
  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); }
9
-
10
6
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
11
-
12
7
  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; }
13
-
14
8
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
15
-
16
9
  import React, { useState, useRef, useContext } from 'react';
17
10
  import { Context } from '../context';
18
11
  import EventName from '../event/eventName';
19
-
20
12
  function ContrallerEvent(_ref) {
21
13
  var children = _ref.children;
22
-
23
14
  var _useContext = useContext(Context),
24
- event = _useContext.event,
25
- container = _useContext.container;
26
-
15
+ event = _useContext.event,
16
+ container = _useContext.container;
27
17
  var timer = useRef(null);
28
-
29
18
  var _useState = useState(true),
30
- _useState2 = _slicedToArray(_useState, 2),
31
- visibel = _useState2[0],
32
- setVisibel = _useState2[1];
33
-
19
+ _useState2 = _slicedToArray(_useState, 2),
20
+ visibel = _useState2[0],
21
+ setVisibel = _useState2[1];
34
22
  var showContraller = function showContraller() {
35
23
  clearTimeout(timer.current);
36
24
  setVisibel(true);
37
25
  event.emit(EventName.SHOW_CONTRALLER);
38
26
  };
39
-
40
27
  var hideContraller = function hideContraller() {
41
28
  clearTimeout(timer.current);
42
29
  timer.current = setTimeout(function () {
@@ -44,24 +31,19 @@ function ContrallerEvent(_ref) {
44
31
  event.emit(EventName.HIDE_CONTRALLER);
45
32
  }, 3 * 1000);
46
33
  };
47
-
48
34
  _useMount(function () {
49
35
  return hideContraller();
50
36
  });
51
-
52
37
  _useEventListener('mouseenter', showContraller, {
53
38
  target: container
54
39
  });
55
-
56
40
  _useEventListener('mouseleave', hideContraller, {
57
41
  target: container
58
42
  });
59
-
60
43
  return /*#__PURE__*/React.createElement(React.Fragment, null, React.Children.map(children, function (child) {
61
44
  return /*#__PURE__*/React.isValidElement(child) ? /*#__PURE__*/React.cloneElement(child, {
62
45
  visibel: visibel
63
46
  }) : child;
64
47
  }));
65
48
  }
66
-
67
49
  export default ContrallerEvent;
@@ -2,16 +2,15 @@ import React from 'react';
2
2
  import LeftBar from './left_bar';
3
3
  import RightBar from './right_bar';
4
4
  import "../style/bar.css";
5
-
6
5
  function ContrallerBar(_ref) {
7
6
  var rightExtContents = _ref.rightExtContents,
8
- rightMidExtContents = _ref.rightMidExtContents,
9
- visibel = _ref.visibel,
10
- leftExtContents = _ref.leftExtContents,
11
- leftMidExtContents = _ref.leftMidExtContents,
12
- reload = _ref.reload,
13
- hideTimeProgress = _ref.hideTimeProgress,
14
- oneFpsPlay = _ref.oneFpsPlay;
7
+ rightMidExtContents = _ref.rightMidExtContents,
8
+ visibel = _ref.visibel,
9
+ leftExtContents = _ref.leftExtContents,
10
+ leftMidExtContents = _ref.leftMidExtContents,
11
+ reload = _ref.reload,
12
+ hideTimeProgress = _ref.hideTimeProgress,
13
+ oneFpsPlay = _ref.oneFpsPlay;
15
14
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
16
15
  className: "contraller-bar-layout ".concat(!visibel ? 'hide-contraller-bar' : '')
17
16
  }, /*#__PURE__*/React.createElement(LeftBar, {
@@ -25,5 +24,4 @@ function ContrallerBar(_ref) {
25
24
  rightMidExtContents: rightMidExtContents
26
25
  })));
27
26
  }
28
-
29
27
  export default ContrallerBar;
@@ -1,15 +1,9 @@
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, useCallback, useMemo, useContext } from 'react';
14
8
  import IconFont from '../iconfont';
15
9
  import Bar from './bar';
@@ -17,35 +11,30 @@ import { Context } from '../context';
17
11
  import { useVideoEvent } from '../event';
18
12
  import Volume from './volume';
19
13
  import Time from './time';
20
-
21
14
  function LeftBar(_ref) {
22
15
  var reload = _ref.reload,
23
- leftExtContents = _ref.leftExtContents,
24
- leftMidExtContents = _ref.leftMidExtContents,
25
- hideTimeProgress = _ref.hideTimeProgress,
26
- oneFpsPlay = _ref.oneFpsPlay;
27
-
16
+ leftExtContents = _ref.leftExtContents,
17
+ leftMidExtContents = _ref.leftMidExtContents,
18
+ hideTimeProgress = _ref.hideTimeProgress,
19
+ oneFpsPlay = _ref.oneFpsPlay;
28
20
  var _useContext = useContext(Context),
29
- api = _useContext.api,
30
- container = _useContext.container,
31
- isLive = _useContext.isLive,
32
- isFpsPlay = _useContext.isFpsPlay;
33
-
21
+ api = _useContext.api,
22
+ container = _useContext.container,
23
+ isLive = _useContext.isLive,
24
+ isFpsPlay = _useContext.isFpsPlay;
34
25
  var _useState = useState(Date.now()),
35
- _useState2 = _slicedToArray(_useState, 2),
36
- dep = _useState2[0],
37
- setDep = _useState2[1];
38
-
26
+ _useState2 = _slicedToArray(_useState, 2),
27
+ dep = _useState2[0],
28
+ setDep = _useState2[1];
39
29
  var updateRender = function updateRender() {
40
30
  return setDep(Date.now());
41
31
  };
42
-
43
32
  useVideoEvent('play', updateRender);
44
33
  useVideoEvent('pause', updateRender);
45
34
  useVideoEvent('volumechange', updateRender);
46
- var video = container.querySelector('video'); //缓存值
35
+ var video = container.querySelector('video');
36
+ //缓存值
47
37
  // eslint-disable-next-line react-hooks/exhaustive-deps
48
-
49
38
  var paused = useMemo(function () {
50
39
  return video === null || video === void 0 ? void 0 : video.paused;
51
40
  }, [dep, video]);
@@ -54,8 +43,8 @@ function LeftBar(_ref) {
54
43
  }, [paused]);
55
44
  var statusText = useMemo(function () {
56
45
  return paused ? '播放' : '暂停';
57
- }, [paused]); //TODO 方法
58
-
46
+ }, [paused]);
47
+ //TODO 方法
59
48
  var changePlayStatus = useCallback(function () {
60
49
  if (video === null || video === void 0 ? void 0 : video.paused) {
61
50
  var buffered = api.getSecondsLoaded();
@@ -83,5 +72,4 @@ function LeftBar(_ref) {
83
72
  title: "\u9010\u5E27\u64AD\u653E"
84
73
  })), leftMidExtContents);
85
74
  }
86
-
87
75
  export default LeftBar;
@@ -1,35 +1,25 @@
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, { useContext } from 'react';
14
8
  import IconFont from '../iconfont';
15
9
  import Bar from './bar';
16
10
  import useFullscreen from '../../useFullscreen';
17
11
  import { Context } from '../context';
18
-
19
12
  function RightBar(_ref) {
20
13
  var rightExtContents = _ref.rightExtContents,
21
- rightMidExtContents = _ref.rightMidExtContents;
22
-
14
+ rightMidExtContents = _ref.rightMidExtContents;
23
15
  var _useContext = useContext(Context),
24
- container = _useContext.container;
25
-
16
+ container = _useContext.container;
26
17
  var _useFullscreen = useFullscreen(container),
27
- _useFullscreen2 = _slicedToArray(_useFullscreen, 2),
28
- isFullScreen = _useFullscreen2[0],
29
- _useFullscreen2$ = _useFullscreen2[1],
30
- enterFullscreen = _useFullscreen2$.enterFullscreen,
31
- exitFullscreen = _useFullscreen2$.exitFullscreen;
32
-
18
+ _useFullscreen2 = _slicedToArray(_useFullscreen, 2),
19
+ isFullScreen = _useFullscreen2[0],
20
+ _useFullscreen2$ = _useFullscreen2[1],
21
+ enterFullscreen = _useFullscreen2$.enterFullscreen,
22
+ exitFullscreen = _useFullscreen2$.exitFullscreen;
33
23
  var fullscreen = isFullScreen ? exitFullscreen : enterFullscreen;
34
24
  return /*#__PURE__*/React.createElement("div", {
35
25
  className: "contraller-right-bar"
@@ -39,5 +29,4 @@ function RightBar(_ref) {
39
29
  type: isFullScreen ? 'lm-player-ExitFull_Main' : 'lm-player-Full_Main'
40
30
  })), rightExtContents);
41
31
  }
42
-
43
32
  export default RightBar;
@@ -1,34 +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, { useContext } from 'react';
14
8
  import { Context } from '../context';
15
9
  import { useTimes } from '../timeline';
16
10
  import { timeStamp } from '../util';
17
-
18
11
  function Time() {
19
12
  var _useContext = useContext(Context),
20
- api = _useContext.api,
21
- event = _useContext.event,
22
- isFpsPlay = _useContext.isFpsPlay;
23
-
13
+ api = _useContext.api,
14
+ event = _useContext.event,
15
+ isFpsPlay = _useContext.isFpsPlay;
24
16
  var _useTimes = useTimes(api, event, isFpsPlay),
25
- _useTimes2 = _slicedToArray(_useTimes, 3),
26
- current = _useTimes2[0],
27
- duration = _useTimes2[2];
28
-
17
+ _useTimes2 = _slicedToArray(_useTimes, 3),
18
+ current = _useTimes2[0],
19
+ duration = _useTimes2[2];
29
20
  return /*#__PURE__*/React.createElement("span", {
30
21
  className: "video-time-progress"
31
22
  }, timeStamp(current), "/", timeStamp(duration || 0));
32
23
  }
33
-
34
24
  export default Time;
@@ -1,27 +1,19 @@
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 { useState } from 'react';
14
8
  import { useRegisterPlayerEvents } from '../event';
15
9
  import EventName from '../event/eventName';
16
-
17
10
  function useBarStatus(event) {
18
11
  var _useState = useState({
19
- status: 1
20
- }),
21
- _useState2 = _slicedToArray(_useState, 2),
22
- state = _useState2[0],
23
- setState = _useState2[1];
24
-
12
+ status: 1
13
+ }),
14
+ _useState2 = _slicedToArray(_useState, 2),
15
+ state = _useState2[0],
16
+ setState = _useState2[1];
25
17
  var show = function show() {
26
18
  return setState(function (old) {
27
19
  return Object.assign(Object.assign({}, old), {
@@ -29,7 +21,6 @@ function useBarStatus(event) {
29
21
  });
30
22
  });
31
23
  };
32
-
33
24
  var hide = function hide() {
34
25
  return setState(function (old) {
35
26
  return Object.assign(Object.assign({}, old), {
@@ -37,9 +28,7 @@ function useBarStatus(event) {
37
28
  });
38
29
  });
39
30
  };
40
-
41
31
  useRegisterPlayerEvents(event, [[EventName.SHOW_CONTRALLER, show], [EventName.HIDE_CONTRALLER, hide]]);
42
32
  return state.status;
43
33
  }
44
-
45
34
  export default useBarStatus;