@cloud-app-dev/vidc 4.0.17 → 4.1.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.
Files changed (299) hide show
  1. package/.dumirc.ts +1 -1
  2. package/.eslintrc.js +3 -0
  3. package/.fatherrc.ts +0 -6
  4. package/es/AppContext/Sync.d.ts +7 -0
  5. package/es/AppContext/Sync.js +44 -0
  6. package/es/AppContext/index.d.ts +17 -0
  7. package/es/AppContext/index.js +154 -0
  8. package/es/AppContext/interface.d.ts +42 -0
  9. package/es/AppContext/static.d.ts +8 -0
  10. package/es/AppContext/static.js +9 -0
  11. package/es/CheckGroupFixed/demo.d.ts +2 -0
  12. package/es/CheckGroupFixed/demo.js +20 -0
  13. package/es/CheckGroupFixed/index.d.ts +22 -0
  14. package/es/CheckGroupFixed/index.js +150 -0
  15. package/es/CheckGroupFixed/style.d.ts +6 -0
  16. package/es/CheckGroupFixed/style.js +9 -0
  17. package/es/Config/index.d.ts +4 -0
  18. package/es/Config/index.js +77 -0
  19. package/es/Config/interface.d.ts +65 -0
  20. package/es/Config/utils.d.ts +4 -0
  21. package/es/Config/utils.js +33 -0
  22. package/es/CustomRenderSelect/index.d.ts +13 -0
  23. package/es/CustomRenderSelect/index.js +86 -0
  24. package/es/DBTools/index.d.ts +25 -0
  25. package/es/DBTools/index.js +336 -0
  26. package/es/DisableMark/index.d.ts +8 -0
  27. package/es/DisableMark/index.js +25 -0
  28. package/es/DomMove/demo.d.ts +1 -0
  29. package/es/DomMove/demo.js +19 -0
  30. package/es/DomMove/index.d.ts +16 -0
  31. package/es/DomMove/index.js +148 -0
  32. package/es/DomMove/utils.d.ts +8 -0
  33. package/es/DomMove/utils.js +33 -0
  34. package/es/Drag/DragAndDropItem.d.ts +4 -0
  35. package/es/Drag/DragAndDropItem.js +133 -0
  36. package/es/Drag/DropItem.d.ts +4 -0
  37. package/es/Drag/DropItem.js +50 -0
  38. package/es/Drag/index.d.ts +7 -0
  39. package/es/Drag/index.js +7 -0
  40. package/es/Drag/interface.d.ts +16 -0
  41. package/es/DynamicGridList/demo.d.ts +2 -0
  42. package/es/DynamicGridList/demo.js +86 -0
  43. package/es/DynamicGridList/index.d.ts +27 -0
  44. package/es/DynamicGridList/index.js +71 -0
  45. package/es/DynamicList/demo.d.ts +1 -0
  46. package/es/DynamicList/demo.js +45 -0
  47. package/es/DynamicList/index.d.ts +30 -0
  48. package/es/DynamicList/index.js +98 -0
  49. package/es/DynamicList/interface.d.ts +19 -0
  50. package/es/DynamicList/utils.d.ts +4 -0
  51. package/es/DynamicList/utils.js +6 -0
  52. package/es/ErrorFallback/index.d.ts +8 -0
  53. package/es/ErrorFallback/index.js +38 -0
  54. package/es/ErrorFallback/inerface.d.ts +48 -0
  55. package/es/EventTools/index.d.ts +3 -0
  56. package/es/EventTools/index.js +12 -0
  57. package/es/FrontendPlayer/index.d.ts +4 -0
  58. package/es/FrontendPlayer/index.js +2 -0
  59. package/es/GridList/data.d.ts +16 -0
  60. package/es/GridList/data.js +609 -0
  61. package/es/GridList/demo.d.ts +2 -0
  62. package/es/GridList/demo.js +89 -0
  63. package/es/GridList/hook.d.ts +13 -0
  64. package/es/GridList/hook.js +270 -0
  65. package/es/GridList/index.d.ts +14 -0
  66. package/es/GridList/index.js +51 -0
  67. package/es/GridList/interface.d.ts +59 -0
  68. package/es/GridList/utils.d.ts +9 -0
  69. package/es/GridList/utils.js +42 -0
  70. package/es/HightLevel/index.d.ts +8 -0
  71. package/es/HightLevel/index.js +20 -0
  72. package/es/IconFont/index.d.ts +12 -0
  73. package/es/IconFont/index.js +63 -0
  74. package/es/InstanceHistory/index.d.ts +3 -0
  75. package/es/InstanceHistory/index.js +7 -0
  76. package/es/LabelValue/index.d.ts +14 -0
  77. package/es/LabelValue/index.js +35 -0
  78. package/es/List/demo.d.ts +2 -0
  79. package/es/List/demo.js +25 -0
  80. package/es/List/index.d.ts +27 -0
  81. package/es/List/index.js +38 -0
  82. package/es/ListWithSizeAnimate/demo.d.ts +1 -0
  83. package/es/ListWithSizeAnimate/demo.js +128 -0
  84. package/es/ListWithSizeAnimate/index.d.ts +13 -0
  85. package/es/ListWithSizeAnimate/index.js +106 -0
  86. package/es/LoaderScript/index.d.ts +47 -0
  87. package/es/LoaderScript/index.js +38 -0
  88. package/es/LoaderScript/utils.d.ts +13 -0
  89. package/es/LoaderScript/utils.js +179 -0
  90. package/es/Picture/component/DefaultRects/RectInfo.d.ts +7 -0
  91. package/es/Picture/component/DefaultRects/RectInfo.js +90 -0
  92. package/es/Picture/component/DefaultRects/index.d.ts +11 -0
  93. package/es/Picture/component/DefaultRects/index.js +58 -0
  94. package/es/Picture/component/DefaultRects/style.d.ts +10 -0
  95. package/es/Picture/component/DefaultRects/style.js +28 -0
  96. package/es/Picture/component/DefaultRects/utils.d.ts +2 -0
  97. package/es/Picture/component/DefaultRects/utils.js +11 -0
  98. package/es/Picture/component/DrawRect/index.d.ts +11 -0
  99. package/es/Picture/component/DrawRect/index.js +54 -0
  100. package/es/Picture/component/RectMenu/index.d.ts +10 -0
  101. package/es/Picture/component/RectMenu/index.js +84 -0
  102. package/es/Picture/component/RectMenu/utils.d.ts +12 -0
  103. package/es/Picture/component/RectMenu/utils.js +19 -0
  104. package/es/Picture/component/Tools/index.d.ts +11 -0
  105. package/es/Picture/component/Tools/index.js +105 -0
  106. package/es/Picture/component/Tools/style.d.ts +2 -0
  107. package/es/Picture/component/Tools/style.js +5 -0
  108. package/es/Picture/component/WheelScale/index.d.ts +6 -0
  109. package/es/Picture/component/WheelScale/index.js +29 -0
  110. package/es/Picture/demo.d.ts +1 -0
  111. package/es/Picture/demo.js +114 -0
  112. package/es/Picture/index.d.ts +17 -0
  113. package/es/Picture/index.js +356 -0
  114. package/es/Picture/interface.d.ts +196 -0
  115. package/es/Picture/loadCaptureRectImage.d.ts +3 -0
  116. package/es/Picture/loadCaptureRectImage.js +99 -0
  117. package/es/Picture/useDraw.d.ts +1 -0
  118. package/es/Picture/useDraw.js +103 -0
  119. package/es/Picture/utils.d.ts +26 -0
  120. package/es/Picture/utils.js +143 -0
  121. package/es/Player/api/index.d.ts +68 -0
  122. package/es/Player/api/index.js +309 -0
  123. package/es/Player/context.d.ts +21 -0
  124. package/es/Player/context.js +25 -0
  125. package/es/Player/contraller_bar/bar.d.ts +8 -0
  126. package/es/Player/contraller_bar/bar.js +32 -0
  127. package/es/Player/contraller_bar/contraller_event.d.ts +6 -0
  128. package/es/Player/contraller_bar/contraller_event.js +52 -0
  129. package/es/Player/contraller_bar/index.d.ts +13 -0
  130. package/es/Player/contraller_bar/index.js +39 -0
  131. package/es/Player/contraller_bar/left_bar.d.ts +10 -0
  132. package/es/Player/contraller_bar/left_bar.js +97 -0
  133. package/es/Player/contraller_bar/right_bar.d.ts +8 -0
  134. package/es/Player/contraller_bar/right_bar.js +36 -0
  135. package/es/Player/contraller_bar/time.d.ts +2 -0
  136. package/es/Player/contraller_bar/time.js +24 -0
  137. package/es/Player/contraller_bar/useBarStatus.d.ts +2 -0
  138. package/es/Player/contraller_bar/useBarStatus.js +43 -0
  139. package/es/Player/contraller_bar/volume.d.ts +8 -0
  140. package/es/Player/contraller_bar/volume.js +70 -0
  141. package/es/Player/demo.d.ts +2 -0
  142. package/es/Player/demo.js +289 -0
  143. package/es/Player/empty.d.ts +1 -0
  144. package/es/Player/empty.js +5 -0
  145. package/es/Player/event/errorEvent.d.ts +14 -0
  146. package/es/Player/event/errorEvent.js +88 -0
  147. package/es/Player/event/eventName.d.ts +18 -0
  148. package/es/Player/event/eventName.js +30 -0
  149. package/es/Player/event/index.d.ts +24 -0
  150. package/es/Player/event/index.js +205 -0
  151. package/es/Player/fps_play.d.ts +10 -0
  152. package/es/Player/fps_play.js +88 -0
  153. package/es/Player/frontend_player.d.ts +7 -0
  154. package/es/Player/frontend_player.js +71 -0
  155. package/es/Player/frontend_timeline.d.ts +8 -0
  156. package/es/Player/frontend_timeline.js +153 -0
  157. package/es/Player/iconfont.d.ts +4 -0
  158. package/es/Player/iconfont.js +21 -0
  159. package/es/Player/index.d.ts +2 -0
  160. package/es/Player/index.js +2 -0
  161. package/es/Player/live_heart.d.ts +8 -0
  162. package/es/Player/live_heart.js +45 -0
  163. package/es/Player/message.d.ts +3 -0
  164. package/es/Player/message.js +147 -0
  165. package/es/Player/player.d.ts +233 -0
  166. package/es/Player/segment_player.d.ts +8 -0
  167. package/es/Player/segment_player.js +229 -0
  168. package/es/Player/segment_timeline.d.ts +10 -0
  169. package/es/Player/segment_timeline.js +200 -0
  170. package/es/Player/single_player.d.ts +4 -0
  171. package/es/Player/single_player.js +278 -0
  172. package/es/Player/style/iconfont.js +43 -0
  173. package/es/Player/timeline.d.ts +7 -0
  174. package/es/Player/timeline.js +104 -0
  175. package/es/Player/util.d.ts +43 -0
  176. package/es/Player/util.js +189 -0
  177. package/es/PlayerExt/demo.d.ts +2 -0
  178. package/es/PlayerExt/demo.js +170 -0
  179. package/es/PlayerExt/index.d.ts +47 -0
  180. package/es/PlayerExt/index.js +212 -0
  181. package/es/Progress/index.d.ts +10 -0
  182. package/es/Progress/index.js +60 -0
  183. package/es/ROI/demo.d.ts +2 -0
  184. package/es/ROI/demo.js +17 -0
  185. package/es/ROI/index.d.ts +32 -0
  186. package/es/ROI/index.js +67 -0
  187. package/es/RefDrawer/Footer.d.ts +9 -0
  188. package/es/RefDrawer/Footer.js +27 -0
  189. package/es/RefDrawer/demo.d.ts +3 -0
  190. package/es/RefDrawer/demo.js +32 -0
  191. package/es/RefDrawer/index.d.ts +26 -0
  192. package/es/RefDrawer/index.js +73 -0
  193. package/es/RefModal/demo.d.ts +2 -0
  194. package/es/RefModal/demo.js +32 -0
  195. package/es/RefModal/index.d.ts +17 -0
  196. package/es/RefModal/index.js +71 -0
  197. package/es/ScreenPlayer/Live.d.ts +8 -0
  198. package/es/ScreenPlayer/Live.js +219 -0
  199. package/es/ScreenPlayer/LiveTools.d.ts +33 -0
  200. package/es/ScreenPlayer/LiveTools.js +172 -0
  201. package/es/ScreenPlayer/PlayerWithExt.d.ts +34 -0
  202. package/es/ScreenPlayer/PlayerWithExt.js +241 -0
  203. package/es/ScreenPlayer/RatePick.d.ts +7 -0
  204. package/es/ScreenPlayer/RatePick.js +35 -0
  205. package/es/ScreenPlayer/Record.d.ts +8 -0
  206. package/es/ScreenPlayer/Record.js +452 -0
  207. package/es/ScreenPlayer/RecordTools.d.ts +38 -0
  208. package/es/ScreenPlayer/RecordTools.js +214 -0
  209. package/es/ScreenPlayer/ScreenSelect.d.ts +6 -0
  210. package/es/ScreenPlayer/ScreenSelect.js +59 -0
  211. package/es/ScreenPlayer/SegmentTimeLine.d.ts +16 -0
  212. package/es/ScreenPlayer/SegmentTimeLine.js +44 -0
  213. package/es/ScreenPlayer/TimeMode.d.ts +6 -0
  214. package/es/ScreenPlayer/TimeMode.js +34 -0
  215. package/es/ScreenPlayer/TimeSelect.d.ts +6 -0
  216. package/es/ScreenPlayer/TimeSelect.js +99 -0
  217. package/es/ScreenPlayer/containerStyle.d.ts +13 -0
  218. package/es/ScreenPlayer/containerStyle.js +32 -0
  219. package/es/ScreenPlayer/demo.d.ts +1 -0
  220. package/es/ScreenPlayer/demo.js +19 -0
  221. package/es/ScreenPlayer/demo2.d.ts +1 -0
  222. package/es/ScreenPlayer/demo2.js +196 -0
  223. package/es/ScreenPlayer/index.d.ts +6 -0
  224. package/es/ScreenPlayer/index.js +9 -0
  225. package/es/ScreenPlayer/interface.d.ts +216 -0
  226. package/es/ScreenPlayer/useTimeSlider.d.ts +25 -0
  227. package/es/ScreenPlayer/useTimeSlider.js +451 -0
  228. package/es/ScreenPlayer/useVideoFit.d.ts +5 -0
  229. package/es/ScreenPlayer/useVideoFit.js +35 -0
  230. package/es/ScreenPlayer/utils.d.ts +17 -0
  231. package/es/ScreenPlayer/utils.js +85 -0
  232. package/es/SegmentPlayer/index.d.ts +2 -0
  233. package/es/SegmentPlayer/index.js +2 -0
  234. package/es/Service/http.d.ts +6 -0
  235. package/es/Service/http.js +125 -0
  236. package/es/Service/index.d.ts +3 -0
  237. package/es/Service/index.js +10 -0
  238. package/es/Service/interface.d.ts +22 -0
  239. package/es/Service/middleware.d.ts +5 -0
  240. package/es/Service/middleware.js +15 -0
  241. package/es/SocketEmitter/eventEmitter.d.ts +27 -0
  242. package/es/SocketEmitter/eventEmitter.js +88 -0
  243. package/es/SocketEmitter/index.d.ts +24 -0
  244. package/es/SocketEmitter/index.js +125 -0
  245. package/es/SocketEmitter/interface.d.ts +4 -0
  246. package/es/TableLayout/index.d.ts +9 -0
  247. package/es/TableLayout/index.js +32 -0
  248. package/es/Timeout/index.d.ts +31 -0
  249. package/es/Timeout/index.js +69 -0
  250. package/es/cache/index.d.ts +34 -0
  251. package/es/cache/index.js +94 -0
  252. package/es/copy/index.d.ts +1 -0
  253. package/es/copy/index.js +9 -0
  254. package/es/core.d.ts +0 -0
  255. package/es/getThemeStyle/index.d.ts +2 -0
  256. package/es/getThemeStyle/index.js +5 -0
  257. package/es/index.d.ts +52 -0
  258. package/es/index.js +52 -0
  259. package/es/likeGo/index.d.ts +2 -0
  260. package/es/likeGo/index.js +31 -0
  261. package/es/likeGoSync/index.d.ts +2 -0
  262. package/es/likeGoSync/index.js +10 -0
  263. package/es/logger/index.d.ts +7 -0
  264. package/es/logger/index.js +30 -0
  265. package/es/nextTick/index.d.ts +1 -0
  266. package/es/nextTick/index.js +3 -0
  267. package/es/recorder/demo.d.ts +2 -0
  268. package/es/recorder/demo.js +200 -0
  269. package/es/recorder/index.d.ts +294 -0
  270. package/es/recorder/index.js +991 -0
  271. package/es/submidstr/index.d.ts +5 -0
  272. package/es/submidstr/index.js +14 -0
  273. package/es/treeHelper/index.d.ts +11 -0
  274. package/es/treeHelper/index.js +189 -0
  275. package/es/typings.d.ts +2 -0
  276. package/es/useDrawROI/index.d.ts +16 -0
  277. package/es/useDrawROI/index.js +318 -0
  278. package/es/useEventEmitterHandle/index.d.ts +2 -0
  279. package/es/useEventEmitterHandle/index.js +17 -0
  280. package/es/useHistory/index.d.ts +3 -0
  281. package/es/useHistory/index.js +9 -0
  282. package/es/useHistory/interface.d.ts +3 -0
  283. package/es/useInfiniteScroll/index.d.ts +16 -0
  284. package/es/useInfiniteScroll/index.js +102 -0
  285. package/es/useRafInterval/index.d.ts +5 -0
  286. package/es/useRafInterval/index.js +70 -0
  287. package/es/useSimpleState/index.d.ts +3 -0
  288. package/es/useSimpleState/index.js +35 -0
  289. package/es/useVirtualList/index.d.ts +13 -0
  290. package/es/useVirtualList/index.js +136 -0
  291. package/es/utils.d.ts +14 -0
  292. package/es/utils.js +46 -0
  293. package/es/uuid/index.d.ts +5 -0
  294. package/es/uuid/index.js +6 -0
  295. package/package.json +16 -21
  296. package/release-build.sh +2 -0
  297. package/scripts/{entry.js → entry.mjs} +4 -6
  298. package/{icon-fix.js → scripts/icon-fix.mjs} +4 -3
  299. package/tsconfig.json +1 -1
@@ -0,0 +1,97 @@
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
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."); }
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); }
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; }
5
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
6
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
+ import React, { useCallback, useContext, useMemo, useState } from 'react';
8
+ import { Context } from "../context";
9
+ import { useVideoEvent } from "../event";
10
+ import EventName from "../event/eventName";
11
+ import IconFont from "../iconfont";
12
+ import Bar from "./bar";
13
+ import Time from "./time";
14
+ import Volume from "./volume";
15
+ import { jsx as _jsx } from "react/jsx-runtime";
16
+ import { jsxs as _jsxs } from "react/jsx-runtime";
17
+ function LeftBar(_ref) {
18
+ var reload = _ref.reload,
19
+ leftExtContents = _ref.leftExtContents,
20
+ leftMidExtContents = _ref.leftMidExtContents,
21
+ hideTimeProgress = _ref.hideTimeProgress,
22
+ oneFpsPlay = _ref.oneFpsPlay;
23
+ var _useContext = useContext(Context),
24
+ api = _useContext.api,
25
+ container = _useContext.container,
26
+ isLive = _useContext.isLive,
27
+ isFpsPlay = _useContext.isFpsPlay,
28
+ event = _useContext.event;
29
+ var _useState = useState(Date.now()),
30
+ _useState2 = _slicedToArray(_useState, 2),
31
+ dep = _useState2[0],
32
+ setDep = _useState2[1];
33
+ var updateRender = function updateRender() {
34
+ return setDep(Date.now());
35
+ };
36
+ useVideoEvent('play', updateRender);
37
+ useVideoEvent('pause', updateRender);
38
+ useVideoEvent('volumechange', updateRender);
39
+ var video = container === null || container === void 0 ? void 0 : container.querySelector('video');
40
+ //缓存值
41
+ // eslint-disable-next-line react-hooks/exhaustive-deps
42
+ var paused = useMemo(function () {
43
+ return video === null || video === void 0 ? void 0 : video.paused;
44
+ }, [dep, video]);
45
+ var statusIconClassName = useMemo(function () {
46
+ return paused ? 'lm-player-Play_Main' : 'lm-player-Pause_Main';
47
+ }, [paused]);
48
+ var statusText = useMemo(function () {
49
+ return paused ? '播放' : '暂停';
50
+ }, [paused]);
51
+
52
+ //TODO 方法
53
+ var changePlayStatus = useCallback(function () {
54
+ if (video !== null && video !== void 0 && video.paused) {
55
+ var _api$getSecondsLoaded;
56
+ var buffered = (_api$getSecondsLoaded = api === null || api === void 0 ? void 0 : api.getSecondsLoaded()) !== null && _api$getSecondsLoaded !== void 0 ? _api$getSecondsLoaded : 1;
57
+ api === null || api === void 0 ? void 0 : api.seekTo(buffered - 1);
58
+ api === null || api === void 0 ? void 0 : api.play();
59
+ } else {
60
+ api === null || api === void 0 ? void 0 : api.pause();
61
+ }
62
+ }, [video, api]);
63
+ var reloadAction = function reloadAction() {
64
+ event === null || event === void 0 ? void 0 : event.emit(EventName.CLEAR_ERROR_TIMER);
65
+ event === null || event === void 0 ? void 0 : event.emit(EventName.RELOAD_SUCCESS);
66
+ reload();
67
+ };
68
+ return /*#__PURE__*/_jsxs("div", {
69
+ children: [leftExtContents, !isFpsPlay && /*#__PURE__*/_jsx(Bar, {
70
+ children: /*#__PURE__*/_jsx(IconFont, {
71
+ onClick: changePlayStatus,
72
+ type: statusIconClassName,
73
+ title: statusText
74
+ })
75
+ }), /*#__PURE__*/_jsx(Bar, {
76
+ children: /*#__PURE__*/_jsx(Volume, {
77
+ api: api
78
+ })
79
+ }), !isLive && !hideTimeProgress && /*#__PURE__*/_jsx(Time, {}), /*#__PURE__*/_jsx(Bar, {
80
+ children: /*#__PURE__*/_jsx(IconFont, {
81
+ onClick: reloadAction,
82
+ type: "lm-player-Refresh_Main",
83
+ title: "\u91CD\u8F7D"
84
+ })
85
+ }), !isLive && oneFpsPlay && /*#__PURE__*/_jsx(Bar, {
86
+ children: /*#__PURE__*/_jsx(IconFont, {
87
+ style: isFpsPlay ? {
88
+ color: 'var(--primary)'
89
+ } : undefined,
90
+ onClick: isFpsPlay ? api === null || api === void 0 ? void 0 : api.closeFpsPlay : api === null || api === void 0 ? void 0 : api.openFpsPlay,
91
+ type: "lm-player-zhuzhenplay",
92
+ title: "\u9010\u5E27\u64AD\u653E"
93
+ })
94
+ }), leftMidExtContents]
95
+ });
96
+ }
97
+ export default LeftBar;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ interface IRightBarProps {
3
+ visibel?: boolean;
4
+ rightExtContents: React.ReactNode;
5
+ rightMidExtContents: React.ReactNode;
6
+ }
7
+ declare function RightBar({ rightExtContents, rightMidExtContents }: IRightBarProps): import("react/jsx-runtime").JSX.Element;
8
+ export default RightBar;
@@ -0,0 +1,36 @@
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
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."); }
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); }
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; }
5
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
6
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
+ import { useFullscreen } from 'ahooks';
8
+ import React, { useContext } from 'react';
9
+ import { Context } from "../context";
10
+ import IconFont from "../iconfont";
11
+ import Bar from "./bar";
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ import { jsxs as _jsxs } from "react/jsx-runtime";
14
+ function RightBar(_ref) {
15
+ var rightExtContents = _ref.rightExtContents,
16
+ rightMidExtContents = _ref.rightMidExtContents;
17
+ var _useContext = useContext(Context),
18
+ container = _useContext.container;
19
+ var _useFullscreen = useFullscreen(container),
20
+ _useFullscreen2 = _slicedToArray(_useFullscreen, 2),
21
+ isFullScreen = _useFullscreen2[0],
22
+ _useFullscreen2$ = _useFullscreen2[1],
23
+ enterFullscreen = _useFullscreen2$.enterFullscreen,
24
+ exitFullscreen = _useFullscreen2$.exitFullscreen;
25
+ var fullscreen = isFullScreen ? exitFullscreen : enterFullscreen;
26
+ return /*#__PURE__*/_jsxs("div", {
27
+ children: [rightMidExtContents, /*#__PURE__*/_jsx(Bar, {
28
+ children: /*#__PURE__*/_jsx(IconFont, {
29
+ title: isFullScreen ? '窗口' : '全屏',
30
+ onClick: fullscreen,
31
+ type: isFullScreen ? 'lm-player-S_View_ScreenViewExit' : 'lm-player-S_View_ScreenViewFull'
32
+ })
33
+ }), rightExtContents]
34
+ });
35
+ }
36
+ export default RightBar;
@@ -0,0 +1,2 @@
1
+ declare function Time(): import("react/jsx-runtime").JSX.Element;
2
+ export default Time;
@@ -0,0 +1,24 @@
1
+ var _templateObject;
2
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
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."); }
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); }
5
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
6
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
7
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
8
+ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
9
+ import { css } from '@emotion/css';
10
+ import { useTimes } from "../timeline";
11
+ import { timeStamp } from "../util";
12
+ import { jsxs as _jsxs } from "react/jsx-runtime";
13
+ var classname = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n float: left;\n padding: 0 6px;\n font-size: 10px;\n line-height: 28px;\n color: #fff;\n"])));
14
+ function Time() {
15
+ var _useTimes = useTimes(),
16
+ _useTimes2 = _slicedToArray(_useTimes, 3),
17
+ current = _useTimes2[0],
18
+ duration = _useTimes2[2];
19
+ return /*#__PURE__*/_jsxs("span", {
20
+ className: classname,
21
+ children: [timeStamp(current), "/", timeStamp(duration || 0)]
22
+ });
23
+ }
24
+ export default Time;
@@ -0,0 +1,2 @@
1
+ declare function useBarStatus(): number;
2
+ export default useBarStatus;
@@ -0,0 +1,43 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
8
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
9
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
10
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
11
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
12
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
+ import { useContext, useState } from 'react';
14
+ import { Context } from "../context";
15
+ import { useRegisterPlayerEvents } from "../event";
16
+ import EventName from "../event/eventName";
17
+ function useBarStatus() {
18
+ var _useContext = useContext(Context),
19
+ event = _useContext.event;
20
+ var _useState = useState({
21
+ status: 1
22
+ }),
23
+ _useState2 = _slicedToArray(_useState, 2),
24
+ state = _useState2[0],
25
+ setState = _useState2[1];
26
+ var show = function show() {
27
+ return setState(function (old) {
28
+ return _objectSpread(_objectSpread({}, old), {}, {
29
+ status: 1
30
+ });
31
+ });
32
+ };
33
+ var hide = function hide() {
34
+ return setState(function (old) {
35
+ return _objectSpread(_objectSpread({}, old), {}, {
36
+ status: 0
37
+ });
38
+ });
39
+ };
40
+ useRegisterPlayerEvents(event, [[EventName.SHOW_CONTRALLER, show], [EventName.HIDE_CONTRALLER, hide]]);
41
+ return state.status;
42
+ }
43
+ export default useBarStatus;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import type Api from '../api';
3
+ declare function Volume({ api, style }: {
4
+ api?: Api;
5
+ style?: React.CSSProperties;
6
+ }): import("react/jsx-runtime").JSX.Element;
7
+ declare const _default: React.MemoExoticComponent<typeof Volume>;
8
+ export default _default;
@@ -0,0 +1,70 @@
1
+ var _templateObject;
2
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
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."); }
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); }
5
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
6
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
7
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
8
+ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
9
+ import { css } from '@emotion/css';
10
+ import { useUpdate, useUpdateEffect } from 'ahooks';
11
+ import { Slider, Tooltip } from 'antd';
12
+ import React, { useMemo, useState } from 'react';
13
+ import IconFont from "../iconfont";
14
+ import { jsx as _jsx } from "react/jsx-runtime";
15
+ var classname = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ant-tooltip-inner {\n display: flex;\n width: 30px;\n height: 130px;\n padding: 12px 6px;\n text-align: center;\n border-radius: 15px;\n justify-content: center;\n }\n\n .ant-slider-vertical {\n margin: 0;\n }\n\n .ant-slider-track {\n background-color: var(--primary);\n }\n\n .ant-slider-handle {\n background-color: var(--primary);\n border-color: var(--gray1);\n }\n"])));
16
+ function Volume(_ref) {
17
+ var _api$getVolume;
18
+ var api = _ref.api,
19
+ style = _ref.style;
20
+ var _useState = useState(Math.round((_api$getVolume = api === null || api === void 0 ? void 0 : api.getVolume()) !== null && _api$getVolume !== void 0 ? _api$getVolume : 0 * 100)),
21
+ _useState2 = _slicedToArray(_useState, 2),
22
+ val = _useState2[0],
23
+ setVal = _useState2[1];
24
+ var update = useUpdate();
25
+ // eslint-disable-next-line react-hooks/exhaustive-deps
26
+ var volume = useMemo(function () {
27
+ return api !== null && api !== void 0 && api.muted ? 0 : val;
28
+ }, undefined);
29
+ var onChange = function onChange(num) {
30
+ if (api !== null && api !== void 0 && api.muted) {
31
+ api === null || api === void 0 ? void 0 : api.unmute();
32
+ }
33
+ setVal(num);
34
+ update();
35
+ };
36
+ var toggleMuted = function toggleMuted() {
37
+ if (!api) {
38
+ return;
39
+ }
40
+ if (api.muted) {
41
+ api.unmute();
42
+ setVal(100);
43
+ } else {
44
+ api.mute();
45
+ setVal(0);
46
+ }
47
+ update();
48
+ };
49
+ useUpdateEffect(function () {
50
+ return api === null || api === void 0 ? void 0 : api.setVolume(val / 100);
51
+ }, [val]);
52
+ return /*#__PURE__*/_jsx(Tooltip, {
53
+ arrow: false,
54
+ overlayClassName: classname,
55
+ title: /*#__PURE__*/_jsx(Slider, {
56
+ onChange: onChange,
57
+ style: {
58
+ height: 100
59
+ },
60
+ vertical: true,
61
+ value: val
62
+ }),
63
+ children: /*#__PURE__*/_jsx(IconFont, {
64
+ style: style,
65
+ type: volume !== 0 ? 'lm-player-volume-open' : 'lm-player-volume-close',
66
+ onClick: toggleMuted
67
+ })
68
+ });
69
+ }
70
+ export default /*#__PURE__*/React.memo(Volume);
@@ -0,0 +1,2 @@
1
+ declare const App: () => import("react/jsx-runtime").JSX.Element;
2
+ export default App;
@@ -0,0 +1,289 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
8
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
9
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
10
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
11
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
12
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
+ import { Button, Input, Select } from 'antd';
14
+ import moment from 'dayjs';
15
+ import { useState } from 'react';
16
+ import FrontendPlayer from "./frontend_player";
17
+ import SegmentPlayer from "./segment_player";
18
+ import Player from "./single_player";
19
+ import { jsx as _jsx } from "react/jsx-runtime";
20
+ import { jsxs as _jsxs } from "react/jsx-runtime";
21
+ import { Fragment as _Fragment } from "react/jsx-runtime";
22
+ var options = [{
23
+ value: '',
24
+ label: '自动'
25
+ }, {
26
+ value: 'flv',
27
+ label: 'FLV'
28
+ }, {
29
+ value: 'hls',
30
+ label: 'HLS'
31
+ }];
32
+ var options2 = [{
33
+ value: 1,
34
+ label: '直播'
35
+ }, {
36
+ value: 0,
37
+ label: '录像'
38
+ }];
39
+ function Demo1() {
40
+ var _useState = useState({
41
+ type: undefined,
42
+ isLive: 1,
43
+ url: 'http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4',
44
+ tempUrl: ''
45
+ }),
46
+ _useState2 = _slicedToArray(_useState, 2),
47
+ state = _useState2[0],
48
+ setState = _useState2[1];
49
+ return /*#__PURE__*/_jsxs("div", {
50
+ style: {
51
+ width: '100%'
52
+ },
53
+ children: [/*#__PURE__*/_jsx("h3", {
54
+ children: "\u6807\u51C6\u89C6\u9891\u64AD\u653E"
55
+ }), /*#__PURE__*/_jsxs("div", {
56
+ style: {
57
+ marginBottom: 10,
58
+ display: 'flex'
59
+ },
60
+ children: [/*#__PURE__*/_jsx(Select, {
61
+ value: state.type || '',
62
+ onChange: function onChange(val) {
63
+ return setState(function (old) {
64
+ return _objectSpread(_objectSpread({}, old), {}, {
65
+ type: val
66
+ });
67
+ });
68
+ },
69
+ children: options.map(function (v) {
70
+ return /*#__PURE__*/_jsx(Select.Option, {
71
+ value: v.value,
72
+ children: v.label
73
+ }, v.label);
74
+ })
75
+ }), /*#__PURE__*/_jsx(Input, {
76
+ style: {
77
+ flex: 1,
78
+ height: 32
79
+ },
80
+ type: "text",
81
+ placeholder: "\u8BF7\u8F93\u5165\u89C6\u9891\u5730\u5740",
82
+ onChange: function onChange(e) {
83
+ return setState(function (old) {
84
+ return _objectSpread(_objectSpread({}, old), {}, {
85
+ tempUrl: e.target.value
86
+ });
87
+ });
88
+ }
89
+ }), /*#__PURE__*/_jsx(Select, {
90
+ value: state.isLive,
91
+ onChange: function onChange(val) {
92
+ return setState(function (old) {
93
+ return _objectSpread(_objectSpread({}, old), {}, {
94
+ isLive: val
95
+ });
96
+ });
97
+ },
98
+ children: options2.map(function (v) {
99
+ return /*#__PURE__*/_jsx(Select.Option, {
100
+ value: v.value,
101
+ children: v.label
102
+ }, v.label);
103
+ })
104
+ }), /*#__PURE__*/_jsx(Button, {
105
+ style: {
106
+ width: 60,
107
+ height: 32
108
+ },
109
+ onClick: function onClick() {
110
+ return setState(function (old) {
111
+ return _objectSpread(_objectSpread({}, old), {}, {
112
+ url: state.tempUrl
113
+ });
114
+ });
115
+ },
116
+ children: "\u64AD\u653E"
117
+ })]
118
+ }), /*#__PURE__*/_jsx("div", {
119
+ style: {
120
+ height: 600
121
+ },
122
+ children: /*#__PURE__*/_jsx(Player, {
123
+ fpsDelay: 800,
124
+ oneFpsPlay: true,
125
+ type: state.type,
126
+ url: state.url,
127
+ isLive: !!state.isLive,
128
+ customTimeLine: state.isLive ? /*#__PURE__*/_jsx(_Fragment, {}) : undefined
129
+ })
130
+ })]
131
+ });
132
+ }
133
+ var mm = moment().set('hours', 0).set('minutes', 0).set('seconds', 0);
134
+ var m = mm.clone();
135
+ function Demo2() {
136
+ var _useState3 = useState({
137
+ isLive: 1,
138
+ segments: [{
139
+ beginTime: m.valueOf(),
140
+ endTime: m.set('minutes', 1).valueOf(),
141
+ url: 'http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4'
142
+ }, {
143
+ beginTime: m.set('minutes', 1).valueOf(),
144
+ endTime: m.set('minutes', 2).valueOf()
145
+ }, {
146
+ beginTime: m.set('minutes', 2).valueOf(),
147
+ endTime: m.set('minutes', 3).valueOf(),
148
+ url: 'http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4?date=1'
149
+ }, {
150
+ beginTime: m.set('minutes', 3).valueOf(),
151
+ endTime: m.set('minutes', 4).valueOf()
152
+ }, {
153
+ beginTime: m.set('minutes', 4).valueOf(),
154
+ endTime: m.set('minutes', 5).valueOf(),
155
+ url: 'http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4?date=2'
156
+ }],
157
+ tempUrl: ''
158
+ }),
159
+ _useState4 = _slicedToArray(_useState3, 2),
160
+ state = _useState4[0],
161
+ setState = _useState4[1];
162
+ return /*#__PURE__*/_jsxs("div", {
163
+ style: {
164
+ width: '100%',
165
+ marginTop: 20
166
+ },
167
+ children: [/*#__PURE__*/_jsx("h3", {
168
+ children: " Sements\u89C6\u9891\u64AD\u653E"
169
+ }), /*#__PURE__*/_jsxs("div", {
170
+ style: {
171
+ marginBottom: 10,
172
+ display: 'flex'
173
+ },
174
+ children: [/*#__PURE__*/_jsx(Input, {
175
+ style: {
176
+ flex: 1,
177
+ height: 32
178
+ },
179
+ type: "text",
180
+ placeholder: "\u8BF7\u8F93\u5165\u89C6\u9891\u7247\u6BB5JSON",
181
+ onChange: function onChange(e) {
182
+ return setState(function (old) {
183
+ return _objectSpread(_objectSpread({}, old), {}, {
184
+ tempUrl: e.target.value
185
+ });
186
+ });
187
+ }
188
+ }), /*#__PURE__*/_jsx(Button, {
189
+ style: {
190
+ width: 60,
191
+ height: 32
192
+ },
193
+ onClick: function onClick() {
194
+ return setState(function (old) {
195
+ return _objectSpread(_objectSpread({}, old), {}, {
196
+ segments: JSON.parse(state.tempUrl)
197
+ });
198
+ });
199
+ },
200
+ children: "\u64AD\u653E"
201
+ })]
202
+ }), /*#__PURE__*/_jsx("div", {
203
+ style: {
204
+ height: 600
205
+ },
206
+ children: /*#__PURE__*/_jsx(SegmentPlayer, {
207
+ oneFpsPlay: true,
208
+ begin: mm.valueOf(),
209
+ segments: state.segments,
210
+ isLive: false
211
+ })
212
+ })]
213
+ });
214
+ }
215
+ function Demo3() {
216
+ var _useState5 = useState({
217
+ url: 'http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4',
218
+ tempUrl: '',
219
+ begin: 1652889636000,
220
+ end: 1652890200000
221
+ }),
222
+ _useState6 = _slicedToArray(_useState5, 2),
223
+ state = _useState6[0],
224
+ setState = _useState6[1];
225
+ return /*#__PURE__*/_jsxs("div", {
226
+ style: {
227
+ marginTop: 20
228
+ },
229
+ children: [/*#__PURE__*/_jsx("h3", {
230
+ children: " \u524D\u7AEF\u5F55\u50CF\u89C6\u9891\u64AD\u653E"
231
+ }), /*#__PURE__*/_jsxs("div", {
232
+ style: {
233
+ marginBottom: 10,
234
+ display: 'flex'
235
+ },
236
+ children: [/*#__PURE__*/_jsx(Input, {
237
+ style: {
238
+ flex: 1,
239
+ height: 32
240
+ },
241
+ type: "text",
242
+ placeholder: "\u8BF7\u8F93\u5165\u524D\u7AEF\u5F55\u50CF\u5730\u5740",
243
+ onChange: function onChange(e) {
244
+ return setState(function (old) {
245
+ return _objectSpread(_objectSpread({}, old), {}, {
246
+ tempUrl: e.target.value
247
+ });
248
+ });
249
+ }
250
+ }), /*#__PURE__*/_jsx(Button, {
251
+ style: {
252
+ width: 60,
253
+ height: 32
254
+ },
255
+ onClick: function onClick() {
256
+ return setState(function (old) {
257
+ return _objectSpread(_objectSpread({}, old), {}, {
258
+ url: state.tempUrl
259
+ });
260
+ });
261
+ },
262
+ children: "\u64AD\u653E"
263
+ })]
264
+ }), /*#__PURE__*/_jsx("div", {
265
+ style: {
266
+ height: 600
267
+ },
268
+ children: /*#__PURE__*/_jsx(FrontendPlayer, {
269
+ begin: state.begin,
270
+ end: state.end,
271
+ url: state.url,
272
+ onSeek: function onSeek(time) {
273
+ return setState(function (old) {
274
+ return _objectSpread(_objectSpread({}, old), {}, {
275
+ url: "".concat(old.url, "?").concat(time)
276
+ });
277
+ });
278
+ },
279
+ type: "native"
280
+ })
281
+ })]
282
+ });
283
+ }
284
+ var App = function App() {
285
+ return /*#__PURE__*/_jsxs(_Fragment, {
286
+ children: [/*#__PURE__*/_jsx(Demo1, {}), /*#__PURE__*/_jsx(Demo2, {}), /*#__PURE__*/_jsx(Demo3, {})]
287
+ });
288
+ };
289
+ export default App;
@@ -0,0 +1 @@
1
+ export default function Empty(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ export default function Empty() {
4
+ return /*#__PURE__*/_jsx(_Fragment, {});
5
+ }
@@ -0,0 +1,14 @@
1
+ import Flvjs from '@cloud-app-dev/mpegts.js';
2
+ import Hls from 'hls.js';
3
+ import type VideoEventInstance from '.';
4
+ interface IErrorEventProps {
5
+ event?: VideoEventInstance;
6
+ errorReloadTimer: number;
7
+ flv: Flvjs.Player;
8
+ hls: Hls;
9
+ reload: () => void;
10
+ unload: () => void;
11
+ errorHandleAdapter?: (errorInfo: any) => boolean;
12
+ }
13
+ declare function useErrorEvent({ event, reload, unload, errorReloadTimer, flv, hls, errorHandleAdapter }: IErrorEventProps): void;
14
+ export default useErrorEvent;