@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,153 @@
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
+ var _templateObject, _templateObject2;
3
+ 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; }
4
+ 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; }
5
+ 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; }
6
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
7
+ 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); }
8
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
9
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
10
+ 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); }
11
+ 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; }
12
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
13
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
14
+ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
15
+ import { css } from '@emotion/css';
16
+ import { useUpdateEffect } from 'ahooks';
17
+ import moment from 'dayjs';
18
+ import React, { startTransition, useMemo, useState } from 'react';
19
+ import useBarStatus from "./contraller_bar/useBarStatus";
20
+ import { currentLineCss, playerTimelineLayoutCss, useTimes } from "./timeline";
21
+ import { FMT } from "./util";
22
+ import { jsx as _jsx } from "react/jsx-runtime";
23
+ import { jsxs as _jsxs } from "react/jsx-runtime";
24
+ var frontendLineMarkCss = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n width: 2px;\n height: 100%;\n pointer-events: none;\n background-color: #fff;\n"])));
25
+ var frontendLineTipBoxCss = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: absolute;\n top: -130px;\n width: max-content;\n padding: 10px;\n margin-left: -81px;\n font-size: 12px;\n line-height: 20px;\n color: #fff;\n background-color: rgb(0 0 0 / 65%);\n border-radius: 3px;\n"])));
26
+ function TipTitle(_ref) {
27
+ var end = _ref.end,
28
+ begin = _ref.begin,
29
+ left = _ref.left,
30
+ current = _ref.current,
31
+ markTime = _ref.markTime;
32
+ if (left === -1) {
33
+ return null;
34
+ }
35
+ return /*#__PURE__*/_jsxs("div", {
36
+ className: frontendLineTipBoxCss,
37
+ style: {
38
+ left: left
39
+ },
40
+ children: [/*#__PURE__*/_jsx("div", {
41
+ style: {
42
+ fontWeight: 600
43
+ },
44
+ children: "\u5F55\u50CF\u4FE1\u606F"
45
+ }), /*#__PURE__*/_jsxs("div", {
46
+ children: ["\u5F00\u59CB\uFF1A", moment(begin).format(FMT)]
47
+ }), /*#__PURE__*/_jsxs("div", {
48
+ children: ["\u7ED3\u675F\uFF1A", moment(end).format(FMT)]
49
+ }), /*#__PURE__*/_jsxs("div", {
50
+ children: ["\u523B\u5EA6\uFF1A", moment(markTime).format(FMT)]
51
+ }), /*#__PURE__*/_jsxs("div", {
52
+ children: ["\u5F53\u524D\uFF1A", moment(current).format(FMT)]
53
+ })]
54
+ });
55
+ }
56
+ function FrontendTimeLine(_ref2) {
57
+ var duration = _ref2.duration,
58
+ begin = _ref2.begin,
59
+ end = _ref2.end,
60
+ onSeek = _ref2.onSeek;
61
+ // time 是记录seek时跳了多少
62
+ var _useState = useState({
63
+ time: 0,
64
+ markTime: 0,
65
+ left: -1,
66
+ visible: false
67
+ }),
68
+ _useState2 = _slicedToArray(_useState, 2),
69
+ state = _useState2[0],
70
+ setState = _useState2[1];
71
+ var status = useBarStatus();
72
+
73
+ //获取视频当前播放时长单位s
74
+ var _useTimes = useTimes(),
75
+ _useTimes2 = _slicedToArray(_useTimes, 1),
76
+ currentTime = _useTimes2[0];
77
+ var rTime = useMemo(function () {
78
+ return state.time + currentTime;
79
+ }, [state.time, currentTime]);
80
+ useUpdateEffect(function () {
81
+ return setState(function (old) {
82
+ return _objectSpread(_objectSpread({}, old), {}, {
83
+ time: 0
84
+ });
85
+ });
86
+ }, [begin]);
87
+ var playPercent = useMemo(function () {
88
+ return rTime / duration * 100;
89
+ }, [duration, rTime]);
90
+ var cTime = useMemo(function () {
91
+ return begin + rTime * 1000;
92
+ }, [begin, rTime]);
93
+ var seekWithLine = function seekWithLine(e) {
94
+ var rect = e.currentTarget.getBoundingClientRect();
95
+ var current = e.pageX - rect.left;
96
+ var cTime = current / rect.width * duration;
97
+ onSeek === null || onSeek === void 0 ? void 0 : onSeek(begin + cTime * 1000);
98
+ //时间轴进度条rTime是要加上currentTime,这里要减去一下,包装交互一致性
99
+ setState(function (old) {
100
+ return _objectSpread(_objectSpread({}, old), {}, {
101
+ time: cTime
102
+ });
103
+ });
104
+ };
105
+ var onLineMouseOver = function onLineMouseOver(e) {
106
+ var rect = e.currentTarget.getBoundingClientRect();
107
+ var left = e.pageX - rect.left;
108
+ var mTime = left / rect.width * duration;
109
+ setState(function (old) {
110
+ return _objectSpread(_objectSpread({}, old), {}, {
111
+ left: left,
112
+ markTime: begin + mTime * 1000
113
+ });
114
+ });
115
+ };
116
+ var onLineMouseOut = function onLineMouseOut() {
117
+ return startTransition(function () {
118
+ return setState(function (old) {
119
+ return _objectSpread(_objectSpread({}, old), {}, {
120
+ left: -1
121
+ });
122
+ });
123
+ });
124
+ };
125
+ return /*#__PURE__*/_jsxs("div", {
126
+ className: playerTimelineLayoutCss,
127
+ style: status === 0 ? {
128
+ bottom: 0,
129
+ height: 4
130
+ } : undefined,
131
+ onClick: seekWithLine,
132
+ onMouseMove: onLineMouseOver,
133
+ onMouseOut: onLineMouseOut,
134
+ children: [/*#__PURE__*/_jsx("div", {
135
+ className: currentLineCss,
136
+ style: {
137
+ width: "".concat(playPercent, "%")
138
+ }
139
+ }), /*#__PURE__*/_jsx(TipTitle, {
140
+ end: end,
141
+ begin: begin,
142
+ left: state.left,
143
+ current: cTime,
144
+ markTime: state.markTime
145
+ }), state.left !== -1 && /*#__PURE__*/_jsx("span", {
146
+ className: frontendLineMarkCss,
147
+ style: {
148
+ left: state.left
149
+ }
150
+ })]
151
+ });
152
+ }
153
+ export default FrontendTimeLine;
@@ -0,0 +1,4 @@
1
+ import { IIconFontProps } from '../IconFont';
2
+ import './style/iconfont.js';
3
+ declare function IconFont({ className, ...props }: IIconFontProps): import("react/jsx-runtime").JSX.Element;
4
+ export default IconFont;
@@ -0,0 +1,21 @@
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
+ var _excluded = ["className"];
3
+ 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; }
4
+ 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; }
5
+ 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; }
6
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
7
+ 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); }
8
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
9
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
10
+ import Icon from "../IconFont";
11
+ import "./style/iconfont.js";
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ function IconFont(_ref) {
14
+ var _ref$className = _ref.className,
15
+ className = _ref$className === void 0 ? '' : _ref$className,
16
+ props = _objectWithoutProperties(_ref, _excluded);
17
+ return /*#__PURE__*/_jsx(Icon, _objectSpread({
18
+ className: "".concat(className)
19
+ }, props));
20
+ }
21
+ export default IconFont;
@@ -0,0 +1,2 @@
1
+ import SinglePlayer from './single_player';
2
+ export default SinglePlayer;
@@ -0,0 +1,2 @@
1
+ import SinglePlayer from "./single_player";
2
+ export default SinglePlayer;
@@ -0,0 +1,8 @@
1
+ import type Api from './api';
2
+ import type VideoEventInstance from './event';
3
+ declare function useLiveHeart({ api, event, isLive }: {
4
+ api?: Api;
5
+ event?: VideoEventInstance;
6
+ isLive?: boolean;
7
+ }): void;
8
+ export default useLiveHeart;
@@ -0,0 +1,45 @@
1
+ /* eslint-disable react-hooks/rules-of-hooks */
2
+ import { useDocumentVisibility, useRafInterval, useUpdateEffect } from 'ahooks';
3
+ import { useRef } from 'react';
4
+ import Events from "./event/eventName";
5
+ function useLiveHeart(_ref) {
6
+ var api = _ref.api,
7
+ event = _ref.event,
8
+ isLive = _ref.isLive;
9
+ var documentVisibility = useDocumentVisibility();
10
+ var cTimeRef = useRef(0);
11
+ var run = function run() {
12
+ var _api$getCurrentTime;
13
+ if (!isLive || documentVisibility !== 'visible' || !api) {
14
+ return;
15
+ }
16
+ var current = (_api$getCurrentTime = api.getCurrentTime()) !== null && _api$getCurrentTime !== void 0 ? _api$getCurrentTime : 0;
17
+ var buffered = api.getSecondsLoaded();
18
+ if (buffered - current > 5) {
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));
20
+ api.seekTo(buffered - 2 > 0 ? buffered - 2 : 0);
21
+ api.play();
22
+ }
23
+ };
24
+ useUpdateEffect(function () {
25
+ return run();
26
+ }, [documentVisibility]);
27
+ useRafInterval(function () {
28
+ var _api$getCurrentTime2;
29
+ return cTimeRef.current = (_api$getCurrentTime2 = api === null || api === void 0 ? void 0 : api.getCurrentTime()) !== null && _api$getCurrentTime2 !== void 0 ? _api$getCurrentTime2 : 0;
30
+ }, 1 * 1000);
31
+ useRafInterval(function () {
32
+ return run();
33
+ }, 30 * 1000);
34
+ useRafInterval(function () {
35
+ var _api$video;
36
+ if (!api || !event) {
37
+ return;
38
+ }
39
+ var cuurentTime = api.getCurrentTime();
40
+ if (!!isLive && !((_api$video = api.video) !== null && _api$video !== void 0 && _api$video.paused) && cuurentTime === cTimeRef.current) {
41
+ event.emit(Events.ERROR, 'long time no play!');
42
+ }
43
+ }, 20 * 1000);
44
+ }
45
+ export default useLiveHeart;
@@ -0,0 +1,3 @@
1
+ declare function VideoMessage(): import("react/jsx-runtime").JSX.Element;
2
+ export declare const NoSource: () => import("react/jsx-runtime").JSX.Element;
3
+ export default VideoMessage;
@@ -0,0 +1,147 @@
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
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
3
+ 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; }
4
+ 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; }
5
+ 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; }
6
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
7
+ 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); }
8
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
9
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
10
+ 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); }
11
+ 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; }
12
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
13
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
14
+ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
15
+ import { css, keyframes } from '@emotion/css';
16
+ import { useContext, useMemo, useRef, useState } from 'react';
17
+ import { Context } from "./context";
18
+ import { useRegisterPlayerEvent, useVideoEvent } from "./event";
19
+ import EventName from "./event/eventName";
20
+ import IconFont from "./iconfont";
21
+ import { jsx as _jsx } from "react/jsx-runtime";
22
+ import { jsxs as _jsxs } from "react/jsx-runtime";
23
+ var lmPlayerMessageMaskCss = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n top: 0;\n left: 0;\n z-index: -1;\n display: flex;\n width: 100%;\n height: 100%;\n pointer-events: none;\n background: transparent;\n opacity: 0;\n transition: all 0.5s;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n"])));
24
+ var lmPlayerLoadingIconCss = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n z-index: -1;\n font-size: 48px;\n visibility: hidden;\n"])));
25
+ var lmPlayerMaskLoadingAnimationCss = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n z-index: 1;\n background: rgb(0 0 0 / 60%);\n opacity: 1;\n"])));
26
+ var loadingAnimationFrames = keyframes(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n"])));
27
+ var lmPlayerLoadingAnimationCss = css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n z-index: 9;\n visibility: visible;\n animation: ", " 1s linear infinite;\n"])), loadingAnimationFrames);
28
+ var lmPlayerLoadfailCss = css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n z-index: 9;\n visibility: visible;\n"])));
29
+ var lmPlayerMessageCss = css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n padding: 10px;\n font-size: 16px;\n color: #fff;\n"])));
30
+ function VideoMessage() {
31
+ var _useContext = useContext(Context),
32
+ api = _useContext.api;
33
+ var _useState = useState({
34
+ status: null,
35
+ errorTimer: 1,
36
+ loading: false
37
+ }),
38
+ _useState2 = _slicedToArray(_useState, 2),
39
+ state = _useState2[0],
40
+ setState = _useState2[1];
41
+ var timeRef = useRef();
42
+ var message = useMemo(function () {
43
+ if (state.status === 'fail') {
44
+ console.warn("\u89C6\u9891\u9519\u8BEF\uFF0C\u8BF7\u624B\u52A8\u5237\u65B0\u91CD\u8BD5\uFF01");
45
+ return '请稍后重试';
46
+ }
47
+ if (state.status === 'reload') {
48
+ console.warn("\u7B2C".concat(state.errorTimer, "\u6B21\u91CD\u8FDE"));
49
+ return "\u6B63\u5728\u5237\u65B0...";
50
+ }
51
+ return '';
52
+ }, [state.errorTimer, state.status]);
53
+ var openLoading = function openLoading() {
54
+ clearTimeout(timeRef.current);
55
+ timeRef.current = setTimeout(function () {
56
+ return setState(function (old) {
57
+ return _objectSpread(_objectSpread({}, old), {}, {
58
+ loading: true
59
+ });
60
+ });
61
+ }, 200);
62
+ };
63
+ var closeLoading = function closeLoading() {
64
+ clearTimeout(timeRef.current);
65
+ setState(function (old) {
66
+ return _objectSpread(_objectSpread({}, old), {}, {
67
+ loading: false
68
+ });
69
+ });
70
+ };
71
+ var errorReload = function errorReload(timer) {
72
+ clearTimeout(timeRef.current);
73
+ setState(function () {
74
+ return {
75
+ status: 'reload',
76
+ errorTimer: timer,
77
+ loading: true
78
+ };
79
+ });
80
+ };
81
+ var reloadFail = function reloadFail() {
82
+ return setState(function (old) {
83
+ return _objectSpread(_objectSpread({}, old), {}, {
84
+ status: 'fail'
85
+ });
86
+ });
87
+ };
88
+ var reloadSuccess = function reloadSuccess() {
89
+ return setState(function (old) {
90
+ return _objectSpread(_objectSpread({}, old), {}, {
91
+ status: null
92
+ });
93
+ });
94
+ };
95
+ var reload = function reload() {
96
+ return setState(function (old) {
97
+ return _objectSpread(_objectSpread({}, old), {}, {
98
+ status: 'reload',
99
+ loading: true
100
+ });
101
+ });
102
+ };
103
+ var playEnd = function playEnd() {
104
+ clearTimeout(timeRef.current);
105
+ setState(function (old) {
106
+ return _objectSpread(_objectSpread({}, old), {}, {
107
+ status: null,
108
+ loading: false
109
+ });
110
+ });
111
+ api === null || api === void 0 ? void 0 : api.pause();
112
+ };
113
+ useVideoEvent('loadstart', openLoading);
114
+ useVideoEvent('loadeddata', closeLoading);
115
+ useVideoEvent('canplay', closeLoading);
116
+ useRegisterPlayerEvent(EventName.ERROR_RELOAD, errorReload);
117
+ useRegisterPlayerEvent(EventName.RELOAD_FAIL, reloadFail);
118
+ useRegisterPlayerEvent(EventName.RELOAD_SUCCESS, reloadSuccess);
119
+ useRegisterPlayerEvent(EventName.RELOAD, reload);
120
+ useRegisterPlayerEvent(EventName.HISTORY_PLAY_END, playEnd);
121
+ useRegisterPlayerEvent(EventName.CLEAR_ERROR_TIMER, reloadSuccess);
122
+ var loading = state.loading,
123
+ status = state.status;
124
+ return /*#__PURE__*/_jsxs("div", {
125
+ className: "".concat(lmPlayerMessageMaskCss, " ").concat(loading || status === 'fail' ? lmPlayerMaskLoadingAnimationCss : ''),
126
+ children: [/*#__PURE__*/_jsx(IconFont, {
127
+ type: status === 'fail' ? 'lm-player-YesorNo_No_Dark' : 'lm-player-Loading',
128
+ className: "".concat(lmPlayerLoadingIconCss, " ").concat(loading && status !== 'fail' ? lmPlayerLoadingAnimationCss : status === 'fail' ? lmPlayerLoadfailCss : '')
129
+ }), /*#__PURE__*/_jsx("span", {
130
+ className: lmPlayerMessageCss,
131
+ children: message
132
+ })]
133
+ });
134
+ }
135
+ export var NoSource = function NoSource() {
136
+ return /*#__PURE__*/_jsx("div", {
137
+ className: "".concat(lmPlayerMessageMaskCss, " ").concat(lmPlayerMaskLoadingAnimationCss),
138
+ children: /*#__PURE__*/_jsx(IconFont, {
139
+ style: {
140
+ fontSize: 80
141
+ },
142
+ type: "lm-player-PlaySource",
143
+ title: "\u8BF7\u9009\u62E9\u89C6\u9891\u6E90"
144
+ })
145
+ });
146
+ };
147
+ export default VideoMessage;
@@ -0,0 +1,233 @@
1
+ import type Flvjs from '@cloud-app-dev/mpegts.js';
2
+ import type Hls from 'hls.js';
3
+ import type { HlsConfig } from 'hls.js';
4
+ import type React from 'react';
5
+ import type Api from './api';
6
+ import type VideoEventInstance from './event';
7
+
8
+ export type FlvPlayerConfig = {
9
+ mediaDataSource: Flvjs.MediaDataSource;
10
+ config: Flvjs.Config;
11
+ };
12
+
13
+ export interface ISinglePlayerProps {
14
+ /**
15
+ * 视频播放地址
16
+ */
17
+ url?: string;
18
+
19
+ /**
20
+ * 容器类名
21
+ */
22
+ className?: string;
23
+ children?: React.ReactNode;
24
+
25
+ /**
26
+ * 同html video muted 静音
27
+ * @default true
28
+ */
29
+ muted?: boolean;
30
+ /**
31
+ * 同html video autoplay 自动播放
32
+ * @default true
33
+ */
34
+ autoPlay?: boolean;
35
+
36
+ /**
37
+ * 同html video playsinline 自动播放
38
+ * @default false
39
+ */
40
+ playsInline?: boolean;
41
+ /**
42
+ *同html video preload 预加载
43
+ */
44
+ preload?: string;
45
+ /**
46
+ * 视频封面
47
+ */
48
+ poster?: string;
49
+
50
+ /**
51
+ * 同html video loop 循环
52
+ * @default false
53
+ */
54
+ loop?: boolean;
55
+
56
+ /**
57
+ * 视频格式
58
+ * @default 'native'
59
+ */
60
+ type?: 'flv' | 'hls' | 'native';
61
+
62
+ /**
63
+ * 隐藏工具栏
64
+ * @default false
65
+ */
66
+ hideContrallerBar?: boolean;
67
+
68
+ /**
69
+ * 直播模式
70
+ * @default true
71
+ */
72
+ isLive?: boolean;
73
+
74
+ /**
75
+ * 工具栏右外侧拓展
76
+ */
77
+ rightExtContents?: React.ReactNode;
78
+ /**
79
+ * 工具栏右内侧拓展
80
+ */
81
+ rightMidExtContents?: React.ReactNode;
82
+ /**
83
+ * 工具栏左外侧拓展
84
+ */
85
+ leftExtContents?: React.ReactNode;
86
+ /**
87
+ * 工具栏左内侧拓展
88
+ */
89
+ leftMidExtContents?: React.ReactNode;
90
+
91
+ /**
92
+ * 自定义时间轴
93
+ */
94
+ customTimeLine?: React.ReactNode;
95
+
96
+ /**
97
+ * 错误重试次数
98
+ * @default 5
99
+ */
100
+ errorReloadTimer?: number;
101
+
102
+ /**
103
+ * 自定义flv参数配置
104
+ * @type FlvPlayerConfig
105
+ */
106
+ flvConfig?: FlvPlayerConfig;
107
+
108
+ /**
109
+ * 自定义hls参数配置
110
+ * @type HlsConfig
111
+ */
112
+ hlsConfig?: HlsConfig;
113
+
114
+ /**
115
+ * 自定义reload函数
116
+ */
117
+ reload?: () => void;
118
+
119
+ /**
120
+ * extaction
121
+ */
122
+ extActions?: { [key: string]: (...args: any) => void };
123
+
124
+ /**
125
+ * 视频可播放时执行钩子
126
+ */
127
+ onCanPlayerInit?: () => void;
128
+
129
+ /**
130
+ * 自定义video事件
131
+ */
132
+ videoEvents?: CustomEvent[];
133
+
134
+ /**
135
+ * 自定义播放器的事件
136
+ */
137
+ playerEvents?: CustomEvent[];
138
+
139
+ /**
140
+ * 开启单帧播放
141
+ */
142
+ oneFpsPlay?: boolean;
143
+
144
+ /**
145
+ * 获取视频针的频次 (ms)
146
+ */
147
+ fpsDelay?: number;
148
+
149
+ /**
150
+ * 视频每秒多少帧,用于控制逐帧播放
151
+ */
152
+ fps?: number;
153
+ }
154
+
155
+ export interface IFrontendPlayerProps extends Omit<ISinglePlayerProps, 'isLive' | 'reload'> {
156
+ /**
157
+ * 前端录像开始时间
158
+ */
159
+ begin?: number;
160
+
161
+ /**
162
+ * 前端录像结束时间
163
+ */
164
+ end?: number;
165
+
166
+ /**
167
+ * 录像时间轴发生变化回调
168
+ */
169
+ onSeek?: (time: number) => void;
170
+
171
+ forwordRef?: React.MutableRefObject<ExportPlayerType>;
172
+ }
173
+
174
+ export interface ISegmentPlayerProps extends Omit<ISinglePlayerProps, 'url'> {
175
+ /**
176
+ * 云录像片段信息
177
+ */
178
+ segments?: ISegmentType[];
179
+
180
+ /**
181
+ * 云录像开始时间
182
+ */
183
+ begin?: number;
184
+
185
+ forwordRef?: React.MutableRefObject<ExportPlayerType>;
186
+
187
+ defaultIndex?: number;
188
+ }
189
+
190
+ export const SinglePlayer: React.FunctionComponent<ISinglePlayerProps>;
191
+ export const FrontendPlayer: React.FunctionComponent<IFrontendPlayerProps>;
192
+ export const SegmentPlayer: React.FunctionComponent<ISegmentPlayerProps>;
193
+
194
+ export type EventInfo = {
195
+ type: string;
196
+ listener: ((...args: any) => void)[];
197
+ };
198
+
199
+ export type ExportPlayerType = {
200
+ video: HTMLVideoElement;
201
+ container: HTMLElement;
202
+ api: Api;
203
+ event: VideoEventInstance;
204
+ plugins: [Flvjs.Player, Hls];
205
+ fit?: string;
206
+ setIndex?: (i: number) => void;
207
+ seekTo?: (i: number) => void;
208
+ reload?: () => void;
209
+ };
210
+
211
+ export interface ISegmentType {
212
+ id?: string;
213
+ /**
214
+ * 视频片段地址
215
+ */
216
+ url?: string;
217
+
218
+ /**
219
+ * 片段开始时间
220
+ */
221
+ beginTime: number;
222
+
223
+ /**
224
+ * 片段结束时间
225
+ */
226
+ endTime: number;
227
+
228
+ style?: any;
229
+ }
230
+
231
+ export const ISegmentTypeDemo: React.FC<ISegmentType>;
232
+
233
+ export type CustomEvent = [string, () => void];
@@ -0,0 +1,8 @@
1
+ import type { ISegmentPlayerProps } from './player';
2
+ /**
3
+ * @desc 主组件,负责片段整体逻辑控制
4
+ * @param param0
5
+ * @returns
6
+ */
7
+ declare function SegmentPlayer({ segments, begin, forwordRef, defaultIndex, onCanPlayerInit, customTimeLine, ...props }: ISegmentPlayerProps): import("react/jsx-runtime").JSX.Element;
8
+ export default SegmentPlayer;