@cloud-app-dev/vidc 4.0.20 → 4.0.22

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 (234) hide show
  1. package/es/AppContext/Sync.js +42 -0
  2. package/es/AppContext/index.js +141 -0
  3. package/es/AppContext/interface.d.ts +41 -0
  4. package/es/AppContext/static.js +9 -0
  5. package/es/Auth/index.js +14 -0
  6. package/es/AutoExit/index.js +19 -0
  7. package/es/CheckGroupFixed/demo.js +22 -0
  8. package/es/CheckGroupFixed/index.js +140 -0
  9. package/es/CheckGroupFixed/index.less +56 -0
  10. package/es/Config/index.js +77 -0
  11. package/es/Config/interface.d.ts +65 -0
  12. package/es/Config/utils.js +33 -0
  13. package/es/ConfigContext/index.js +21 -0
  14. package/es/CustomRenderSelect/index.js +72 -0
  15. package/es/CustomRenderSelect/index.less +25 -0
  16. package/es/DBTools/index.js +336 -0
  17. package/es/DisableMark/index.js +19 -0
  18. package/es/DisableMark/index.less +9 -0
  19. package/es/DomMove/demo.js +16 -0
  20. package/es/DomMove/index.js +139 -0
  21. package/es/DomMove/utils.js +32 -0
  22. package/es/Drag/DragAndDropItem.js +133 -0
  23. package/es/Drag/DropItem.js +50 -0
  24. package/es/Drag/index.d.ts +9 -0
  25. package/es/Drag/index.js +7 -0
  26. package/es/Drag/interface.d.ts +16 -0
  27. package/es/DynamicGridList/Demo.js +77 -0
  28. package/es/DynamicGridList/index.js +67 -0
  29. package/es/DynamicList/demo.js +44 -0
  30. package/es/DynamicList/index.js +86 -0
  31. package/es/DynamicList/index.less +17 -0
  32. package/es/DynamicList/interface.d.ts +19 -0
  33. package/es/DynamicList/utils.js +6 -0
  34. package/es/ErrorFallback/index.js +31 -0
  35. package/es/ErrorFallback/inerface.d.ts +48 -0
  36. package/es/EventTools/index.js +12 -0
  37. package/es/FrontendPlayer/index.js +2 -0
  38. package/es/FullScreen/index.js +33 -0
  39. package/es/FullScreen/index.less +18 -0
  40. package/es/GridList/Demo.js +80 -0
  41. package/es/GridList/data.js +609 -0
  42. package/es/GridList/hook.js +270 -0
  43. package/es/GridList/index.js +44 -0
  44. package/es/GridList/index.less +8 -0
  45. package/es/GridList/interface.d.ts +59 -0
  46. package/es/GridList/utils.js +42 -0
  47. package/es/HightLevel/index.js +18 -0
  48. package/es/HightLevel/index.less +3 -0
  49. package/es/IconFont/index.js +54 -0
  50. package/es/ImageView/index.js +51 -0
  51. package/es/ImageView/index.less +11 -0
  52. package/es/InstanceHistory/index.js +7 -0
  53. package/es/LabelPlayer/111.png +0 -0
  54. package/es/LabelPlayer/demo.js +115 -0
  55. package/es/LabelPlayer/index.js +160 -0
  56. package/es/LabelPlayer/index.less +24 -0
  57. package/es/LabelValue/index.js +27 -0
  58. package/es/LabelValue/index.less +23 -0
  59. package/es/List/demo.js +23 -0
  60. package/es/List/index.js +28 -0
  61. package/es/List/index.less +20 -0
  62. package/es/ListWithSizeAnimate/demo.js +98 -0
  63. package/es/ListWithSizeAnimate/index.js +85 -0
  64. package/es/ListWithSizeAnimate/index.less +23 -0
  65. package/es/LoaderScript/index.js +34 -0
  66. package/es/LoaderScript/utils.js +179 -0
  67. package/es/Map/AMap.d.ts +7109 -0
  68. package/es/Map/BasicMap/AMapInstance.js +98 -0
  69. package/es/Map/BasicMap/LeafletInstance.js +111 -0
  70. package/es/Map/BasicMap/index.js +90 -0
  71. package/es/Map/BasicMap/index.less +29 -0
  72. package/es/Map/ClusterLayer/demo.js +18 -0
  73. package/es/Map/ClusterLayer/hook.js +123 -0
  74. package/es/Map/ClusterLayer/index.js +28 -0
  75. package/es/Map/ClusterLayer/index.less +29 -0
  76. package/es/Map/ClusterLayer/props.d.ts +8 -0
  77. package/es/Map/Config/index.js +48 -0
  78. package/es/Map/Config/utils.js +65 -0
  79. package/es/Map/Context/index.js +51 -0
  80. package/es/Map/FindPio/index.js +13 -0
  81. package/es/Map/FindPio/index.less +7 -0
  82. package/es/Map/InfoWindow/MakerLikeWindow.js +108 -0
  83. package/es/Map/InfoWindow/demo.js +70 -0
  84. package/es/Map/InfoWindow/index.js +62 -0
  85. package/es/Map/LevelCenter/DragMarker/index.js +42 -0
  86. package/es/Map/LevelCenter/demo.js +38 -0
  87. package/es/Map/LevelCenter/index.js +66 -0
  88. package/es/Map/LoaderMap/index.js +62 -0
  89. package/es/Map/MapDrawSelect/demo.js +71 -0
  90. package/es/Map/MapDrawSelect/index.js +56 -0
  91. package/es/Map/MouseTool/index.js +40 -0
  92. package/es/Map/MouseTool/useMouseTools.js +83 -0
  93. package/es/Map/ResetTools/index.js +57 -0
  94. package/es/Map/ResetTools/index.less +39 -0
  95. package/es/Map/SinglePoint/demo.js +14 -0
  96. package/es/Map/SinglePoint/index.js +52 -0
  97. package/es/Map/SinglePoint/index.less +41 -0
  98. package/es/Map/hook/useMapEvent.js +19 -0
  99. package/es/Map/hook/useMapType.js +12 -0
  100. package/es/Map/icon.js +10 -0
  101. package/es/Map/index.js +25 -0
  102. package/es/Map/interface.d.ts +74 -0
  103. package/es/Map/points.js +1 -0
  104. package/es/Map/useMarker/index.js +71 -0
  105. package/es/Map/withMap/index.js +10 -0
  106. package/es/Picture/component/DefaultRects/RectInfo.js +80 -0
  107. package/es/Picture/component/DefaultRects/index.js +52 -0
  108. package/es/Picture/component/DefaultRects/index.less +211 -0
  109. package/es/Picture/component/DefaultRects/utils.js +11 -0
  110. package/es/Picture/component/DrawRect/index.js +46 -0
  111. package/es/Picture/component/DrawRect/index.less +8 -0
  112. package/es/Picture/component/RectMenu/index.js +76 -0
  113. package/es/Picture/component/RectMenu/index.less +36 -0
  114. package/es/Picture/component/RectMenu/utils.js +19 -0
  115. package/es/Picture/component/Tools/index.js +73 -0
  116. package/es/Picture/component/Tools/index.less +49 -0
  117. package/es/Picture/component/WheelScale/index.js +27 -0
  118. package/es/Picture/demo.js +105 -0
  119. package/es/Picture/index.js +341 -0
  120. package/es/Picture/index.less +20 -0
  121. package/es/Picture/interface.d.ts +196 -0
  122. package/es/Picture/loadCaptureRectImage.js +99 -0
  123. package/es/Picture/useDraw.js +103 -0
  124. package/es/Picture/utils.js +143 -0
  125. package/es/Player/api/index.js +309 -0
  126. package/es/Player/context.js +24 -0
  127. package/es/Player/contraller_bar/bar.js +20 -0
  128. package/es/Player/contraller_bar/contraller_event.js +48 -0
  129. package/es/Player/contraller_bar/index.js +27 -0
  130. package/es/Player/contraller_bar/left_bar.js +83 -0
  131. package/es/Player/contraller_bar/right_bar.js +32 -0
  132. package/es/Player/contraller_bar/time.js +19 -0
  133. package/es/Player/contraller_bar/useBarStatus.js +43 -0
  134. package/es/Player/contraller_bar/volume.js +62 -0
  135. package/es/Player/demo.js +266 -0
  136. package/es/Player/empty.js +4 -0
  137. package/es/Player/event/errorEvent.js +88 -0
  138. package/es/Player/event/eventName.js +29 -0
  139. package/es/Player/event/index.js +205 -0
  140. package/es/Player/fps_play.js +83 -0
  141. package/es/Player/frontend_player.js +64 -0
  142. package/es/Player/frontend_timeline.js +132 -0
  143. package/es/Player/iconfont.js +16 -0
  144. package/es/Player/index.js +2 -0
  145. package/es/Player/live_heart.js +45 -0
  146. package/es/Player/message.js +133 -0
  147. package/es/Player/player.d.ts +233 -0
  148. package/es/Player/segment_player.js +228 -0
  149. package/es/Player/segment_timeline.js +173 -0
  150. package/es/Player/single_player.js +262 -0
  151. package/es/Player/style/bar.less +43 -0
  152. package/es/Player/style/iconfont.js +43 -0
  153. package/es/Player/style/index.less +34 -0
  154. package/es/Player/style/message.less +56 -0
  155. package/es/Player/style/slider.less +106 -0
  156. package/es/Player/style/timeline.less +117 -0
  157. package/es/Player/style/volume.less +24 -0
  158. package/es/Player/timeline.js +95 -0
  159. package/es/Player/util.js +189 -0
  160. package/es/PlayerExt/demo.js +154 -0
  161. package/es/PlayerExt/index.js +188 -0
  162. package/es/PlayerExt/index.less +10 -0
  163. package/es/Progress/index.d.ts +9 -0
  164. package/es/Progress/index.js +53 -0
  165. package/es/Progress/index.less +21 -0
  166. package/es/ROI/demo.js +16 -0
  167. package/es/ROI/index.js +54 -0
  168. package/es/ROI/index.less +33 -0
  169. package/es/RefDrawer/Footer.js +22 -0
  170. package/es/RefDrawer/demo.js +18 -0
  171. package/es/RefDrawer/index.js +71 -0
  172. package/es/RefModal/demo.js +18 -0
  173. package/es/RefModal/index.js +70 -0
  174. package/es/ScreenPlayer/Live.js +212 -0
  175. package/es/ScreenPlayer/LiveTools.js +151 -0
  176. package/es/ScreenPlayer/PlayerWithExt.js +231 -0
  177. package/es/ScreenPlayer/RatePick.js +29 -0
  178. package/es/ScreenPlayer/Record.js +442 -0
  179. package/es/ScreenPlayer/RecordTools.js +169 -0
  180. package/es/ScreenPlayer/ScreenSelect.js +46 -0
  181. package/es/ScreenPlayer/SegmentTimeLine.js +36 -0
  182. package/es/ScreenPlayer/TimeMode.js +26 -0
  183. package/es/ScreenPlayer/TimeSelect.js +88 -0
  184. package/es/ScreenPlayer/demo.js +21 -0
  185. package/es/ScreenPlayer/demo2.js +194 -0
  186. package/es/ScreenPlayer/index.js +9 -0
  187. package/es/ScreenPlayer/index.less +335 -0
  188. package/es/ScreenPlayer/interface.d.ts +216 -0
  189. package/es/ScreenPlayer/useTimeSlider.js +456 -0
  190. package/es/ScreenPlayer/useVideoFit.js +35 -0
  191. package/es/ScreenPlayer/utils.js +85 -0
  192. package/es/SegmentPlayer/index.js +2 -0
  193. package/es/Service/http.js +133 -0
  194. package/es/Service/index.js +11 -0
  195. package/es/Service/interface.d.ts +23 -0
  196. package/es/Service/middleware.js +22 -0
  197. package/es/SocketEmitter/eventEmitter.js +88 -0
  198. package/es/SocketEmitter/index.js +125 -0
  199. package/es/SocketEmitter/interface.d.ts +4 -0
  200. package/es/TableLayout/index.js +27 -0
  201. package/es/TableLayout/index.less +4 -0
  202. package/es/ThemeAntd/demo.js +81 -0
  203. package/es/ThemeAntd/demo.less +20 -0
  204. package/es/ThemeAntd/index.js +21 -0
  205. package/es/ThemeAntd/index.less +4 -0
  206. package/es/Timeout/index.js +65 -0
  207. package/es/bigNumberTransformCN/index.js +58 -0
  208. package/es/cache/index.js +94 -0
  209. package/es/copy/index.js +9 -0
  210. package/es/core.d.ts +0 -0
  211. package/es/getThemeStyle/index.js +5 -0
  212. package/es/index.js +62 -0
  213. package/es/likeGo/index.js +31 -0
  214. package/es/likeGoSync/index.js +10 -0
  215. package/es/logger/index.js +30 -0
  216. package/es/nextTick/index.js +3 -0
  217. package/es/recorder/demo.js +181 -0
  218. package/es/recorder/index.js +992 -0
  219. package/es/submidstr/index.js +14 -0
  220. package/es/treeHelper/index.js +188 -0
  221. package/es/typings.d.ts +2 -0
  222. package/es/useDrawROI/index.js +318 -0
  223. package/es/useEventEmitterHandle/index.js +17 -0
  224. package/es/useFullscreen/demo.js +43 -0
  225. package/es/useFullscreen/index.js +76 -0
  226. package/es/useHistory/index.js +9 -0
  227. package/es/useHistory/interface.d.ts +3 -0
  228. package/es/useInfiniteScroll/index.js +102 -0
  229. package/es/useRafInterval/index.js +70 -0
  230. package/es/useSimpleState/index.js +35 -0
  231. package/es/useVirtualList/index.js +136 -0
  232. package/es/utils.js +46 -0
  233. package/es/uuid/index.js +19 -0
  234. package/package.json +2 -3
@@ -0,0 +1,117 @@
1
+ .player-timeline-layout {
2
+ position: absolute;
3
+ bottom: 28px;
4
+ left: 0;
5
+ z-index: 9;
6
+ display: flex;
7
+ width: 100%;
8
+ height: 12px;
9
+ cursor: pointer;
10
+ background: rgb(0 0 0 / 100%);
11
+ opacity: .8;
12
+ justify-content: center;
13
+ align-items: center;
14
+ transition: all .1s;
15
+
16
+ &.hide-time-line {
17
+ bottom: 0;
18
+ height: 4px;
19
+ }
20
+
21
+ .buffer-line {
22
+ position: absolute;
23
+ top: 0;
24
+ left: 0;
25
+ height: 100%;
26
+ max-width: 100%;
27
+ pointer-events: none;
28
+ background-color: rgb(103 103 103);
29
+ }
30
+
31
+ .current-line {
32
+ position: absolute;
33
+ top: 0;
34
+ left: 0;
35
+ height: 100%;
36
+ max-width: 100%;
37
+ overflow: hidden;
38
+ pointer-events: none;
39
+ background-color: rgb(70 97 255 / 100%);
40
+ }
41
+
42
+ &.player-segment-timeline-layout {
43
+ background: transparent;
44
+
45
+ .segment-line-box {
46
+ display: flex;
47
+ width: 100%;
48
+ height: 100%;
49
+
50
+ .segment-line-item {
51
+ position: relative;
52
+ background: rgb(0 0 0 / 100%);
53
+ box-sizing: border-box;
54
+
55
+ &:hover {
56
+ &::after {
57
+ box-sizing: border-box;
58
+ position: absolute;
59
+ top: 0;
60
+ left: 0;
61
+ z-index: 6;
62
+ width: 100%;
63
+ height: 100%;
64
+ border: 1px solid #fff;
65
+ content: ' ';
66
+ }
67
+ }
68
+
69
+ &.segment-line-item-none {
70
+ z-index: 6;
71
+ cursor: not-allowed;
72
+ background: rgb(222 14 14 / 100%);
73
+ }
74
+ }
75
+ }
76
+
77
+ .segment-line-mark {
78
+ position: absolute;
79
+ width: 2px;
80
+ height: 100%;
81
+ pointer-events: none;
82
+ background-color: #fff;
83
+ }
84
+ }
85
+
86
+ &.frontend-player-timeline-layout {
87
+ .frontend-line-mark {
88
+ position: absolute;
89
+ width: 2px;
90
+ height: 100%;
91
+ pointer-events: none;
92
+ background-color: #fff;
93
+ }
94
+
95
+ .frontend-line-tip-box {
96
+ position: absolute;
97
+ top: -130px;
98
+ width: max-content;
99
+ padding: 10px;
100
+ margin-left: -81px;
101
+ font-size: 12px;
102
+ line-height: 20px;
103
+ color: #fff;
104
+ background-color: rgb(0 0 0 / 65%);
105
+ border-radius: 3px;
106
+ }
107
+ }
108
+ }
109
+
110
+ .segment-line-tip-box {
111
+ font-size: 12px;
112
+
113
+ div {
114
+ padding: 2px 0;
115
+ margin: 0;
116
+ }
117
+ }
@@ -0,0 +1,24 @@
1
+ .lm-player-volume-popup {
2
+ .cloudapp-tooltip-inner {
3
+ display: flex;
4
+ width: 30px;
5
+ height: 130px;
6
+ padding: 12px 6px;
7
+ text-align: center;
8
+ border-radius: 15px;
9
+ justify-content: center;
10
+ }
11
+
12
+ .cloudapp-slider-vertical {
13
+ margin: 0;
14
+ }
15
+
16
+ .cloudapp-slider-track {
17
+ background-color: var(--primary);
18
+ }
19
+
20
+ .cloudapp-slider-handle {
21
+ background-color: var(--primary);
22
+ border-color: var(--gray1);
23
+ }
24
+ }
@@ -0,0 +1,95 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
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(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
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(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
12
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
+ import React, { useContext, useMemo, useState } from 'react';
14
+ import { Context } from "./context";
15
+ import useBarStatus from "./contraller_bar/useBarStatus";
16
+ import { useVideoEvent } from "./event";
17
+ import "./style/timeline.less";
18
+ export function useTimes() {
19
+ var _useContext = useContext(Context),
20
+ api = _useContext.api,
21
+ isFpsPlay = _useContext.isFpsPlay;
22
+ var _useState = useState({
23
+ currentTime: 0,
24
+ buffered: 0
25
+ }),
26
+ _useState2 = _slicedToArray(_useState, 2),
27
+ state = _useState2[0],
28
+ setState = _useState2[1];
29
+ var getCurrentTime = function getCurrentTime() {
30
+ return setState(function (old) {
31
+ var _api$getCurrentTime, _api$getSecondsLoaded;
32
+ return _objectSpread(_objectSpread({}, old), {}, {
33
+ currentTime: (_api$getCurrentTime = api === null || api === void 0 ? void 0 : api.getCurrentTime()) !== null && _api$getCurrentTime !== void 0 ? _api$getCurrentTime : 0,
34
+ buffered: (_api$getSecondsLoaded = api === null || api === void 0 ? void 0 : api.getSecondsLoaded()) !== null && _api$getSecondsLoaded !== void 0 ? _api$getSecondsLoaded : 0
35
+ });
36
+ });
37
+ };
38
+ var getBuffered = function getBuffered() {
39
+ return setState(function (old) {
40
+ var _api$getSecondsLoaded2;
41
+ return _objectSpread(_objectSpread({}, old), {}, {
42
+ buffered: (_api$getSecondsLoaded2 = api === null || api === void 0 ? void 0 : api.getSecondsLoaded()) !== null && _api$getSecondsLoaded2 !== void 0 ? _api$getSecondsLoaded2 : 0
43
+ });
44
+ });
45
+ };
46
+ var seekendPlay = function seekendPlay() {
47
+ return !isFpsPlay && (api === null || api === void 0 ? void 0 : api.play());
48
+ };
49
+ useVideoEvent('timeupdate', getCurrentTime);
50
+ useVideoEvent('progress', getBuffered);
51
+ useVideoEvent('suspend', getBuffered);
52
+ useVideoEvent('seeked', seekendPlay);
53
+ return useMemo(function () {
54
+ var _api$getDuration;
55
+ return [state.currentTime, state.buffered, (_api$getDuration = api === null || api === void 0 ? void 0 : api.getDuration()) !== null && _api$getDuration !== void 0 ? _api$getDuration : 0];
56
+ }, [state.currentTime, state.buffered, api]);
57
+ }
58
+ function TimeLine() {
59
+ var _useContext2 = useContext(Context),
60
+ api = _useContext2.api;
61
+ var status = useBarStatus();
62
+ var _useTimes = useTimes(),
63
+ _useTimes2 = _slicedToArray(_useTimes, 3),
64
+ currentTime = _useTimes2[0],
65
+ buffered = _useTimes2[1],
66
+ duration = _useTimes2[2];
67
+ var playPercent = useMemo(function () {
68
+ return currentTime / duration * 100;
69
+ }, [currentTime, duration]);
70
+ var bufferedPercent = useMemo(function () {
71
+ return buffered / duration * 100;
72
+ }, [buffered, duration]);
73
+ var seekWithLine = function seekWithLine(e) {
74
+ var _api$getDuration2;
75
+ var rect = e.currentTarget.getBoundingClientRect();
76
+ var current = e.pageX - rect.left;
77
+ var cTime = current / rect.width * ((_api$getDuration2 = api === null || api === void 0 ? void 0 : api.getDuration()) !== null && _api$getDuration2 !== void 0 ? _api$getDuration2 : 0);
78
+ api === null || api === void 0 || api.seekTo(cTime);
79
+ };
80
+ return /*#__PURE__*/React.createElement("div", {
81
+ className: "player-timeline-layout ".concat(status === 0 ? 'hide-time-line' : ''),
82
+ onClick: seekWithLine
83
+ }, /*#__PURE__*/React.createElement("div", {
84
+ className: "buffer-line",
85
+ style: {
86
+ width: "".concat(bufferedPercent, "%")
87
+ }
88
+ }), /*#__PURE__*/React.createElement("div", {
89
+ className: "current-line",
90
+ style: {
91
+ width: "".concat(playPercent, "%")
92
+ }
93
+ }));
94
+ }
95
+ export default TimeLine;
@@ -0,0 +1,189 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
3
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
4
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
5
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
6
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
7
+ 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; }
8
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
9
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
10
+ import Flvjs from '@cloud-app-dev/mpegts.js';
11
+ import Hls from 'hls.js';
12
+ import { likeGo } from "../utils";
13
+ import Events from "./event/eventName";
14
+ /**
15
+ * 创建HLS对象
16
+ * @param {HTMLVideoElement} video
17
+ * @param {string} url
18
+ */
19
+ export function createHlsPlayer(video, url, isLive, hlsConfig) {
20
+ if (!Hls.isSupported() || !url) {
21
+ return undefined;
22
+ }
23
+ var player = new Hls(_objectSpread({
24
+ liveDurationInfinity: isLive,
25
+ enableWorker: true
26
+ }, hlsConfig));
27
+ player.loadSource(url);
28
+ player.attachMedia(video);
29
+ return player;
30
+ }
31
+
32
+ /**
33
+ * 创建FLV对象
34
+ * @param {*} video
35
+ * @param {*} options
36
+ */
37
+ export function createFlvPlayer(video, url, isLive, flvConfig) {
38
+ if (!Flvjs.isSupported() || !url) {
39
+ return undefined;
40
+ }
41
+ Flvjs.LoggingControl.enableDebug = false;
42
+ Flvjs.LoggingControl.enableVerbose = false;
43
+ Flvjs.LoggingControl.enableWarn = false;
44
+ var mediaDataSource = _objectSpread({
45
+ type: 'flv',
46
+ url: url
47
+ }, flvConfig === null || flvConfig === void 0 ? void 0 : flvConfig.mediaDataSource);
48
+ var config = _objectSpread({
49
+ enableWorker: true,
50
+ isLive: isLive !== null && isLive !== void 0 ? isLive : true,
51
+ enableStashBuffer: !isLive
52
+ }, flvConfig === null || flvConfig === void 0 ? void 0 : flvConfig.config);
53
+ var player = Flvjs.createPlayer(mediaDataSource, config);
54
+ player.attachMediaElement(video);
55
+ player.load();
56
+ return player;
57
+ }
58
+
59
+ /**
60
+ * video unload
61
+ * @param video
62
+ * @param flv
63
+ * @param hls
64
+ * @returns
65
+ */
66
+ export var playUnload = function playUnload(video, flv, hls) {
67
+ if (!video) {
68
+ return;
69
+ }
70
+ video.pause();
71
+ if (flv) {
72
+ flv.unload();
73
+ return;
74
+ }
75
+ if (hls) {
76
+ hls.stopLoad();
77
+ return;
78
+ }
79
+ video.removeAttribute('src');
80
+ };
81
+
82
+ /**
83
+ * reload
84
+ * @param video
85
+ * @param event
86
+ * @param flv
87
+ * @param hls
88
+ * @param url
89
+ */
90
+ export var playReload = function playReload(video, event, flv, hls, url) {
91
+ if (!video || !event) {
92
+ return undefined;
93
+ }
94
+ playUnload(video, flv, hls);
95
+ if (flv) {
96
+ likeGo( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
97
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
98
+ while (1) switch (_context.prev = _context.next) {
99
+ case 0:
100
+ flv.load();
101
+ flv.play();
102
+ case 2:
103
+ case "end":
104
+ return _context.stop();
105
+ }
106
+ }, _callee);
107
+ })));
108
+ }
109
+ if (hls && url) {
110
+ likeGo( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
111
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
112
+ while (1) switch (_context2.prev = _context2.next) {
113
+ case 0:
114
+ hls.swapAudioCodec();
115
+ hls.recoverMediaError();
116
+ hls.startLoad();
117
+ hls.loadSource(url);
118
+ video.play();
119
+ case 5:
120
+ case "end":
121
+ return _context2.stop();
122
+ }
123
+ }, _callee2);
124
+ })));
125
+ }
126
+ if (!flv && !hls && url) {
127
+ video.setAttribute('src', url);
128
+ likeGo( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
129
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
130
+ while (1) switch (_context3.prev = _context3.next) {
131
+ case 0:
132
+ return _context3.abrupt("return", video.play());
133
+ case 1:
134
+ case "end":
135
+ return _context3.stop();
136
+ }
137
+ }, _callee3);
138
+ })));
139
+ }
140
+ event.emit(Events.RELOAD);
141
+ };
142
+
143
+ /**
144
+ * 获取播放文件类型
145
+ * @param {*} url
146
+ */
147
+ export function getVideoType(url) {
148
+ if (!url) {
149
+ return 'native';
150
+ }
151
+ return url.indexOf('.flv') > -1 ? 'flv' : url.indexOf('.m3u8') > -1 ? 'hls' : 'native';
152
+ }
153
+ export function timeStamp(second) {
154
+ // 转换为式分秒
155
+ var h = Math.round(second / 60 / 60 % 24);
156
+ var m = second < 60 ? 0 : Math.round(second / 60 % 60);
157
+ var s = Math.round(second % 60);
158
+ if (h === 0) {
159
+ return "".concat(m < 10 ? '0' + m : m, ":").concat(s < 10 ? '0' + s : s);
160
+ }
161
+ return "".concat(h < 10 ? '0' + h : h, ":").concat(m < 10 ? '0' + m : m, ":").concat(s < 10 ? '0' + s : s);
162
+ }
163
+ export function getRandom() {
164
+ return Math.random().toString(36).substring(2);
165
+ }
166
+ export var FMT = 'YYYY-MM-DD HH:mm:ss';
167
+ export function getDomStyleValue(dom, styleKey) {
168
+ if (!dom) {
169
+ return '';
170
+ }
171
+ return window.getComputedStyle(dom).getPropertyValue(styleKey);
172
+ }
173
+ export function createProxy(obj, getObj) {
174
+ var handler = {
175
+ get: function get(target, key, recevier) {
176
+ if (_typeof(target[key]) === 'object') {
177
+ createProxy(target[key]);
178
+ }
179
+ if (getObj && getObj[key]) {
180
+ return Reflect.get(getObj, key);
181
+ }
182
+ return Reflect.get(target, key, recevier);
183
+ },
184
+ set: function set(target, key, value) {
185
+ return Reflect.set(target, key, value);
186
+ }
187
+ };
188
+ return new Proxy(obj, handler);
189
+ }
@@ -0,0 +1,154 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
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(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
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(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
12
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
+ import { Button, ConfigProvider, Input, Select } from 'antd';
14
+ import React, { useState } from 'react';
15
+ import Player from "../Player/single_player";
16
+ import ExtModel from "./index";
17
+ var options = [{
18
+ value: '',
19
+ label: '自动'
20
+ }, {
21
+ value: 'flv',
22
+ label: 'FLV'
23
+ }, {
24
+ value: 'hls',
25
+ label: 'HLS'
26
+ }];
27
+ var options2 = [{
28
+ value: 1,
29
+ label: '直播'
30
+ }, {
31
+ value: 0,
32
+ label: '录像'
33
+ }];
34
+ //http://192.168.101.162:14088/flv/live/1853e2a5c3308bd62/2.flv?device_id=&channel_id=1853e2a5c3308bd62&stream_index=2&ip=0
35
+ function Demo() {
36
+ var _useState = useState({
37
+ type: undefined,
38
+ isLive: 1,
39
+ url: '',
40
+ tempUrl: '',
41
+ mode: 1
42
+ }),
43
+ _useState2 = _slicedToArray(_useState, 2),
44
+ state = _useState2[0],
45
+ setState = _useState2[1];
46
+ return /*#__PURE__*/React.createElement("div", {
47
+ style: {
48
+ width: '100%',
49
+ height: 800
50
+ }
51
+ }, /*#__PURE__*/React.createElement("h3", null, "\u63D2\u4EF6\u89C6\u9891\u64AD\u653E"), /*#__PURE__*/React.createElement("div", {
52
+ style: {
53
+ marginBottom: 10,
54
+ display: 'flex'
55
+ }
56
+ }, /*#__PURE__*/React.createElement(Select, {
57
+ value: state.type || '',
58
+ onChange: function onChange(val) {
59
+ return setState(function (old) {
60
+ return _objectSpread(_objectSpread({}, old), {}, {
61
+ type: val
62
+ });
63
+ });
64
+ }
65
+ }, options.map(function (v) {
66
+ return /*#__PURE__*/React.createElement(Select.Option, {
67
+ key: v.label,
68
+ value: v.value
69
+ }, v.label);
70
+ })), /*#__PURE__*/React.createElement(Input, {
71
+ style: {
72
+ flex: 1,
73
+ height: 32
74
+ },
75
+ type: "text",
76
+ placeholder: "\u8BF7\u8F93\u5165\u89C6\u9891\u5730\u5740",
77
+ onChange: function onChange(e) {
78
+ return setState(function (old) {
79
+ return _objectSpread(_objectSpread({}, old), {}, {
80
+ tempUrl: e.target.value
81
+ });
82
+ });
83
+ }
84
+ }), /*#__PURE__*/React.createElement(Select, {
85
+ value: state.isLive,
86
+ onChange: function onChange(val) {
87
+ return setState(function (old) {
88
+ return _objectSpread(_objectSpread({}, old), {}, {
89
+ isLive: val
90
+ });
91
+ });
92
+ }
93
+ }, options2.map(function (v) {
94
+ return /*#__PURE__*/React.createElement(Select.Option, {
95
+ key: v.label,
96
+ value: v.value
97
+ }, v.label);
98
+ })), /*#__PURE__*/React.createElement(Select, {
99
+ value: state.mode,
100
+ onChange: function onChange(val) {
101
+ return setState(function (old) {
102
+ return _objectSpread(_objectSpread({}, old), {}, {
103
+ mode: val
104
+ });
105
+ });
106
+ }
107
+ }, /*#__PURE__*/React.createElement(Select.Option, {
108
+ value: 1
109
+ }, "\u6D4F\u89C8\u5668\u6A21\u5F0F"), /*#__PURE__*/React.createElement(Select.Option, {
110
+ value: 2
111
+ }, "\u63D2\u4EF6\u6A21\u5F0F")), /*#__PURE__*/React.createElement(Button, {
112
+ style: {
113
+ width: 60,
114
+ height: 32
115
+ },
116
+ onClick: function onClick() {
117
+ return setState(function (old) {
118
+ return _objectSpread(_objectSpread({}, old), {}, {
119
+ url: ''
120
+ });
121
+ });
122
+ }
123
+ }, "\u5173\u95ED"), /*#__PURE__*/React.createElement(Button, {
124
+ style: {
125
+ width: 60,
126
+ height: 32
127
+ },
128
+ onClick: function onClick() {
129
+ return setState(function (old) {
130
+ return _objectSpread(_objectSpread({}, old), {}, {
131
+ url: state.tempUrl
132
+ });
133
+ });
134
+ }
135
+ }, "\u64AD\u653E")), /*#__PURE__*/React.createElement("div", {
136
+ style: {
137
+ height: 600
138
+ }
139
+ }, /*#__PURE__*/React.createElement(ExtModel, {
140
+ url: state.url,
141
+ mode: state.mode,
142
+ pluginDownloadUrl: "http://192.168.101.162:19999/plugins/ZVPlayer.exe"
143
+ }, /*#__PURE__*/React.createElement(Player, {
144
+ type: state.type,
145
+ url: state.url,
146
+ isLive: !!state.isLive
147
+ }))));
148
+ }
149
+ var App = function App() {
150
+ return /*#__PURE__*/React.createElement(ConfigProvider, {
151
+ prefixCls: "cloudapp"
152
+ }, /*#__PURE__*/React.createElement(Demo, null));
153
+ };
154
+ export default App;