@cloud-app-dev/vidc 3.1.16 → 3.1.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (153) hide show
  1. package/es/Api/index.js +0 -23
  2. package/es/AppContext/Sync.js +1 -15
  3. package/es/AppContext/index.js +21 -52
  4. package/es/AppContext/static.js +0 -7
  5. package/es/Auth/index.js +2 -5
  6. package/es/AutoExit/index.js +1 -5
  7. package/es/Box/BetweenBox/index.js +6 -8
  8. package/es/Box/InfoBox/index.js +6 -8
  9. package/es/Box/TwoColumnBox/index.js +8 -18
  10. package/es/Box/deps/grid-factory.js +0 -12
  11. package/es/Box/index.js +4 -6
  12. package/es/CheckGroupFixed/index.js +19 -34
  13. package/es/Config/index.js +0 -4
  14. package/es/Config/utils.js +3 -18
  15. package/es/ConfigContext/index.js +1 -3
  16. package/es/CustomRenderSelect/index.js +13 -29
  17. package/es/DisableMark/index.js +2 -2
  18. package/es/DomMove/index.js +24 -37
  19. package/es/DomMove/utils.js +3 -8
  20. package/es/Drag/DragAndDropItem.js +19 -37
  21. package/es/Drag/DropItem.js +5 -15
  22. package/es/Drawer/Demo.js +3 -17
  23. package/es/Drawer/Footer.js +3 -5
  24. package/es/Drawer/index.js +28 -50
  25. package/es/ErrorFallback/index.js +1 -3
  26. package/es/FullScreen/index.js +8 -18
  27. package/es/HightLevel/index.js +1 -5
  28. package/es/IconFont/index.js +5 -11
  29. package/es/ImageView/index.js +8 -20
  30. package/es/Input/index.js +14 -27
  31. package/es/InstanceHistory/index.js +0 -2
  32. package/es/LabelValue/index.js +8 -10
  33. package/es/List/DynamicGridList/Demo.js +0 -11
  34. package/es/List/DynamicGridList/index.js +16 -25
  35. package/es/List/DynamicList/index.js +23 -38
  36. package/es/List/GridList/Demo.js +3 -16
  37. package/es/List/GridList/hook.js +34 -65
  38. package/es/List/GridList/utils.js +0 -1
  39. package/es/List/VList/index.js +10 -20
  40. package/es/List/VList/utils.js +2 -3
  41. package/es/List/index.js +5 -7
  42. package/es/LoaderApp/index.js +5 -22
  43. package/es/LoaderApp/loader.js +5 -13
  44. package/es/LoaderApp/sandbox.back.js +16 -81
  45. package/es/LoaderApp/sandbox.js +8 -22
  46. package/es/LoaderApp/utils.js +20 -49
  47. package/es/LoaderScript/index.js +8 -19
  48. package/es/LoaderScript/utils.js +0 -51
  49. package/es/Map/BasicMap/AMapInstance.js +0 -10
  50. package/es/Map/BasicMap/LeafletInstance.js +11 -20
  51. package/es/Map/BasicMap/index.js +6 -28
  52. package/es/Map/ClusterLayer/hook.js +10 -32
  53. package/es/Map/ClusterLayer/index.js +2 -6
  54. package/es/Map/Config/index.js +8 -21
  55. package/es/Map/Config/utils.js +0 -6
  56. package/es/Map/Context/index.js +2 -22
  57. package/es/Map/FindPio/index.js +0 -2
  58. package/es/Map/InfoWindow/MakerLikeWindow.js +9 -28
  59. package/es/Map/InfoWindow/demo.js +5 -22
  60. package/es/Map/InfoWindow/index.js +13 -29
  61. package/es/Map/LevelCenter/DragMarker/index.js +5 -9
  62. package/es/Map/LevelCenter/demo.js +6 -16
  63. package/es/Map/LevelCenter/index.js +8 -15
  64. package/es/Map/LoaderMap/index.js +10 -10
  65. package/es/Map/MapDrawSelect/demo.js +12 -23
  66. package/es/Map/MapDrawSelect/index.js +14 -21
  67. package/es/Map/MouseTool/index.js +16 -26
  68. package/es/Map/MouseTool/useMouseTools.js +6 -29
  69. package/es/Map/ResetTools/index.js +4 -8
  70. package/es/Map/SinglePoint/index.js +6 -13
  71. package/es/Map/hook/useMapEvent.js +3 -7
  72. package/es/Map/hook/useMapType.js +1 -2
  73. package/es/Map/useMarker/index.js +10 -24
  74. package/es/Map/withMap/index.js +0 -2
  75. package/es/Modal/index.d.ts +1 -1
  76. package/es/Modal/index.js +29 -50
  77. package/es/Picture/component/DefaultRects/RectInfo.js +11 -25
  78. package/es/Picture/component/DefaultRects/index.js +3 -5
  79. package/es/Picture/component/DrawRect/index.js +6 -8
  80. package/es/Picture/component/RectMenu/index.js +10 -16
  81. package/es/Picture/component/RectMenu/utils.js +3 -6
  82. package/es/Picture/component/Tools/index.js +6 -8
  83. package/es/Picture/component/WheelScale/index.js +3 -6
  84. package/es/Picture/dragBound.js +4 -17
  85. package/es/Picture/index.js +46 -87
  86. package/es/Picture/loadCaptureRectImage.js +10 -26
  87. package/es/Picture/useDraw.js +20 -39
  88. package/es/Picture/utils.js +2 -11
  89. package/es/Player/api/index.js +14 -78
  90. package/es/Player/context.js +1 -2
  91. package/es/Player/contraller_bar/bar.js +5 -9
  92. package/es/Player/contraller_bar/contraller_event.js +5 -23
  93. package/es/Player/contraller_bar/index.js +7 -9
  94. package/es/Player/contraller_bar/left_bar.js +15 -27
  95. package/es/Player/contraller_bar/right_bar.js +7 -18
  96. package/es/Player/contraller_bar/time.js +6 -16
  97. package/es/Player/contraller_bar/useBarStatus.js +5 -16
  98. package/es/Player/contraller_bar/volume.js +6 -26
  99. package/es/Player/demo.js +59 -75
  100. package/es/Player/event/errorEvent.js +14 -39
  101. package/es/Player/event/eventName.js +1 -1
  102. package/es/Player/event/index.js +19 -53
  103. package/es/Player/fps_play.js +10 -27
  104. package/es/Player/frontend_player.js +10 -19
  105. package/es/Player/frontend_timeline.js +25 -47
  106. package/es/Player/iconfont.js +2 -5
  107. package/es/Player/live_heart.js +2 -14
  108. package/es/Player/message.js +9 -29
  109. package/es/Player/segment_player.js +39 -77
  110. package/es/Player/segment_timeline.js +42 -68
  111. package/es/Player/single_player.js +64 -87
  112. package/es/Player/style/iconfont.js +10 -17
  113. package/es/Player/timeline.js +11 -28
  114. package/es/Player/util.js +0 -21
  115. package/es/PlayerExt/demo.js +11 -21
  116. package/es/PlayerExt/index.js +18 -43
  117. package/es/Progress/index.js +3 -15
  118. package/es/ROI/demo.js +0 -2
  119. package/es/ROI/index.js +15 -22
  120. package/es/ScreenPlayer/Live.js +34 -67
  121. package/es/ScreenPlayer/LiveTools.js +21 -38
  122. package/es/ScreenPlayer/PlayerWithExt.js +43 -78
  123. package/es/ScreenPlayer/RatePick.js +1 -3
  124. package/es/ScreenPlayer/Record.js +50 -121
  125. package/es/ScreenPlayer/RecordTools.js +32 -54
  126. package/es/ScreenPlayer/ScreenSelect.js +1 -3
  127. package/es/ScreenPlayer/SegmentTimeLine.js +8 -12
  128. package/es/ScreenPlayer/TimeMode.js +1 -3
  129. package/es/ScreenPlayer/TimeSelect.js +11 -26
  130. package/es/ScreenPlayer/demo.js +3 -1
  131. package/es/ScreenPlayer/demo2.js +9 -24
  132. package/es/ScreenPlayer/useRecordList.js +7 -72
  133. package/es/ScreenPlayer/useTimeSlider.js +40 -132
  134. package/es/ScreenPlayer/useVideoFit.js +5 -18
  135. package/es/ScreenPlayer/utils.js +0 -8
  136. package/es/Service/fetch-adapter.js +2 -37
  137. package/es/Service/http.js +8 -27
  138. package/es/TableLayout/index.js +3 -7
  139. package/es/ThemeAntd/demo.js +0 -2
  140. package/es/Timeout/index.js +10 -26
  141. package/es/Tree/demo.js +0 -2
  142. package/es/Tree/index.js +14 -21
  143. package/es/useDrawROI/index.js +51 -105
  144. package/es/useEventEmitterHandle/index.js +2 -6
  145. package/es/useFullscreen/demo.js +6 -16
  146. package/es/useFullscreen/index.js +5 -25
  147. package/es/useHistory/index.js +0 -2
  148. package/es/useInfiniteScroll/index.js +14 -39
  149. package/es/useRafInterval/index.js +2 -26
  150. package/es/useSimpleState/index.js +5 -16
  151. package/es/useVirtualList/index.js +19 -57
  152. package/es/utils.js +0 -28
  153. package/package.json +1 -1
package/es/Player/util.js CHANGED
@@ -1,7 +1,5 @@
1
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
-
3
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 exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
4
-
5
3
  import { __awaiter } from "tslib";
6
4
  import Flvjs from '@cloud-app-dev/flv.js';
7
5
  import Hls from 'hls.js';
@@ -11,12 +9,10 @@ import Events from './event/eventName';
11
9
  * @param {*} video
12
10
  * @param {*} URL
13
11
  */
14
-
15
12
  export function createHlsPlayer(video, url, isLive, hlsConfig) {
16
13
  if (!Hls.isSupported()) {
17
14
  return undefined;
18
15
  }
19
-
20
16
  var player = new Hls(Object.assign({
21
17
  liveDurationInfinity: isLive,
22
18
  enableWorker: true
@@ -30,12 +26,10 @@ export function createHlsPlayer(video, url, isLive, hlsConfig) {
30
26
  * @param {*} video
31
27
  * @param {*} options
32
28
  */
33
-
34
29
  export function createFlvPlayer(video, url, isLive, flvConfig) {
35
30
  if (!Flvjs.isSupported()) {
36
31
  return undefined;
37
32
  }
38
-
39
33
  Flvjs.LoggingControl.enableDebug = false;
40
34
  Flvjs.LoggingControl.enableVerbose = false;
41
35
  Flvjs.LoggingControl.enableWarn = false;
@@ -56,7 +50,6 @@ export function createFlvPlayer(video, url, isLive, flvConfig) {
56
50
  export var playReload = function playReload(video, event, flv, hls, url) {
57
51
  video.pause();
58
52
  video.removeAttribute('src');
59
-
60
53
  if (flv) {
61
54
  tryCatch(function () {
62
55
  flv.unload();
@@ -64,7 +57,6 @@ export var playReload = function playReload(video, event, flv, hls, url) {
64
57
  flv.play();
65
58
  });
66
59
  }
67
-
68
60
  if (hls) {
69
61
  tryCatch(function () {
70
62
  hls.swapAudioCodec();
@@ -75,41 +67,34 @@ export var playReload = function playReload(video, event, flv, hls, url) {
75
67
  video.play();
76
68
  });
77
69
  }
78
-
79
70
  if (!flv && !hls) {
80
71
  video.setAttribute('src', url);
81
72
  tryCatch(function () {
82
73
  return video.play();
83
74
  });
84
75
  }
85
-
86
76
  event.emit(Events.RELOAD);
87
77
  };
88
78
  export var playUnload = function playUnload(video, flv, hls) {
89
79
  video.pause();
90
-
91
80
  if (flv) {
92
81
  flv.unload();
93
82
  return;
94
83
  }
95
-
96
84
  if (hls) {
97
85
  hls.stopLoad();
98
86
  return;
99
87
  }
100
-
101
88
  video.removeAttribute('src');
102
89
  };
103
90
  /**
104
91
  * 获取播放文件类型
105
92
  * @param {*} url
106
93
  */
107
-
108
94
  export function getVideoType(url) {
109
95
  if (!url) {
110
96
  return 'native';
111
97
  }
112
-
113
98
  return url.indexOf('.flv') > -1 ? 'flv' : url.indexOf('.m3u8') > -1 ? 'hls' : 'native';
114
99
  }
115
100
  export function timeStamp(second) {
@@ -117,11 +102,9 @@ export function timeStamp(second) {
117
102
  var h = Math.round(second / 60 / 60 % 24);
118
103
  var m = Math.round(second / 60 % 60);
119
104
  var s = Math.round(second % 60);
120
-
121
105
  if (h === 0) {
122
106
  return "".concat(m < 10 ? '0' + m : m, ":").concat(s < 10 ? '0' + s : s);
123
107
  }
124
-
125
108
  return "".concat(h < 10 ? '0' + h : h, ":").concat(m < 10 ? '0' + m : m, ":").concat(s < 10 ? '0' + s : s);
126
109
  }
127
110
  export function getRandom() {
@@ -136,15 +119,12 @@ export function tryCatch(fn) {
136
119
  _context.prev = 0;
137
120
  _context.next = 3;
138
121
  return fn();
139
-
140
122
  case 3:
141
123
  _context.next = 7;
142
124
  break;
143
-
144
125
  case 5:
145
126
  _context.prev = 5;
146
127
  _context.t0 = _context["catch"](0);
147
-
148
128
  case 7:
149
129
  case "end":
150
130
  return _context.stop();
@@ -158,6 +138,5 @@ export function getDomStyleValue(dom, styleKey) {
158
138
  if (!dom) {
159
139
  return '';
160
140
  }
161
-
162
141
  return window.getComputedStyle(dom).getPropertyValue(styleKey);
163
142
  }
@@ -6,19 +6,12 @@ import "antd/lib/input/style";
6
6
  import _Input from "antd/lib/input";
7
7
  import "antd/lib/select/style";
8
8
  import _Select from "antd/lib/select";
9
-
10
9
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
11
-
12
10
  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."); }
13
-
14
11
  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); }
15
-
16
12
  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; }
17
-
18
13
  function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
19
-
20
14
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
21
-
22
15
  import React, { useState } from 'react';
23
16
  import Player from '../Player/single_player';
24
17
  import ExtModel from './index';
@@ -38,20 +31,19 @@ var options2 = [{
38
31
  }, {
39
32
  value: 0,
40
33
  label: '录像'
41
- }]; //http://192.168.101.162:14088/flv/live/1853e2a5c3308bd62/2.flv?device_id=&channel_id=1853e2a5c3308bd62&stream_index=2&ip=0
42
-
34
+ }];
35
+ //http://192.168.101.162:14088/flv/live/1853e2a5c3308bd62/2.flv?device_id=&channel_id=1853e2a5c3308bd62&stream_index=2&ip=0
43
36
  function Demo() {
44
37
  var _useState = useState({
45
- type: undefined,
46
- isLive: 1,
47
- url: '',
48
- tempUrl: '',
49
- mode: 1
50
- }),
51
- _useState2 = _slicedToArray(_useState, 2),
52
- state = _useState2[0],
53
- setState = _useState2[1];
54
-
38
+ type: undefined,
39
+ isLive: 1,
40
+ url: '',
41
+ tempUrl: '',
42
+ mode: 1
43
+ }),
44
+ _useState2 = _slicedToArray(_useState, 2),
45
+ state = _useState2[0],
46
+ setState = _useState2[1];
55
47
  return /*#__PURE__*/React.createElement("div", {
56
48
  style: {
57
49
  width: '100%',
@@ -155,11 +147,9 @@ function Demo() {
155
147
  isLive: !!state.isLive
156
148
  }))));
157
149
  }
158
-
159
150
  var App = function App() {
160
151
  return /*#__PURE__*/React.createElement(_ConfigProvider, {
161
152
  prefixCls: "cloudapp"
162
153
  }, /*#__PURE__*/React.createElement(Demo, null));
163
154
  };
164
-
165
155
  export default App;
@@ -1,15 +1,9 @@
1
1
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
-
3
2
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
-
5
3
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
6
-
7
4
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
8
-
9
5
  function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
10
-
11
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
-
13
7
  /* eslint-disable jsx-a11y/anchor-is-valid */
14
8
  import React, { useEffect, useMemo, useState } from 'react';
15
9
  import IconFont from '../Player/iconfont';
@@ -17,13 +11,11 @@ import "./index.css";
17
11
  /**
18
12
  * 客户端插件模式,随机端口
19
13
  */
20
-
21
14
  export var LOCAL_PORT = ['15080', '15081', '15082', '15083', '15084', '15085', '15086', '15087', '15088', '15089'];
22
15
  /**
23
16
  * 随机获取端口号
24
17
  * @returns
25
18
  */
26
-
27
19
  export function getLocalPort() {
28
20
  return LOCAL_PORT[Math.floor(Math.random() * LOCAL_PORT.length)];
29
21
  }
@@ -33,7 +25,6 @@ export function getLocalPort() {
33
25
  * @param params
34
26
  * @returns
35
27
  */
36
-
37
28
  export function getLocalPlayPath(url) {
38
29
  var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
39
30
  var URL_TEMPLATE = "http://127.0.0.1:<port>/video/v1/transcoding?uri=<pull_uri>";
@@ -43,26 +34,22 @@ export function getLocalPlayPath(url) {
43
34
  }
44
35
  export function usePlugin(mode, key) {
45
36
  var _useState = useState({
46
- installed: false
47
- }),
48
- _useState2 = _slicedToArray(_useState, 2),
49
- state = _useState2[0],
50
- setState = _useState2[1];
51
-
37
+ installed: false
38
+ }),
39
+ _useState2 = _slicedToArray(_useState, 2),
40
+ state = _useState2[0],
41
+ setState = _useState2[1];
52
42
  useEffect(function () {
53
43
  if (mode !== 2) {
54
44
  return undefined;
55
45
  }
56
-
57
46
  var port = getLocalPort();
58
47
  var url = "http://127.0.0.1:".concat(port, "/video/v1/state");
59
-
60
48
  var thenFn = function thenFn(res) {
61
49
  return res.status === 200 ? setState({
62
50
  installed: true
63
51
  }) : undefined;
64
52
  };
65
-
66
53
  fetch(url).then(thenFn).catch(function (e) {
67
54
  return console.error('插件未安装', e);
68
55
  });
@@ -73,10 +60,9 @@ export function usePlugin(mode, key) {
73
60
  }, [state.installed, mode])
74
61
  };
75
62
  }
76
-
77
63
  function NeedInstallPlugin(_ref) {
78
64
  var pluginDownloadUrl = _ref.pluginDownloadUrl,
79
- retry = _ref.retry;
65
+ retry = _ref.retry;
80
66
  return /*#__PURE__*/React.createElement("div", {
81
67
  className: "lm-player-ext-layout"
82
68
  }, /*#__PURE__*/React.createElement("div", {
@@ -105,7 +91,6 @@ function NeedInstallPlugin(_ref) {
105
91
  onClick: retry
106
92
  }, "\u91CD\u8BD5")))));
107
93
  }
108
-
109
94
  function Loading() {
110
95
  return /*#__PURE__*/React.createElement("div", {
111
96
  className: "lm-player-ext-layout"
@@ -121,7 +106,6 @@ function Loading() {
121
106
  }
122
107
  })), /*#__PURE__*/React.createElement("div", null, "\u6B63\u5728\u83B7\u53D6\u89C6\u9891\u6570\u636E\uFF0C\u8BF7\u7A0D\u7B49...")));
123
108
  }
124
-
125
109
  function Empty() {
126
110
  return /*#__PURE__*/React.createElement("div", {
127
111
  className: "lm-player-ext-layout"
@@ -132,34 +116,28 @@ function Empty() {
132
116
  }
133
117
  }));
134
118
  }
135
-
136
119
  export function ExtModel(_ref2) {
137
120
  var url = _ref2.url,
138
- children = _ref2.children,
139
- mode = _ref2.mode,
140
- pluginDownloadUrl = _ref2.pluginDownloadUrl,
141
- pluginParams = _ref2.pluginParams,
142
- loading = _ref2.loading;
143
-
121
+ children = _ref2.children,
122
+ mode = _ref2.mode,
123
+ pluginDownloadUrl = _ref2.pluginDownloadUrl,
124
+ pluginParams = _ref2.pluginParams,
125
+ loading = _ref2.loading;
144
126
  var _useState3 = useState({
145
- forceKey: Date.now()
146
- }),
147
- _useState4 = _slicedToArray(_useState3, 2),
148
- state = _useState4[0],
149
- setState = _useState4[1];
150
-
127
+ forceKey: Date.now()
128
+ }),
129
+ _useState4 = _slicedToArray(_useState3, 2),
130
+ state = _useState4[0],
131
+ setState = _useState4[1];
151
132
  var hasUrl = useMemo(function () {
152
133
  return !!url;
153
134
  }, [url]);
154
-
155
135
  var _usePlugin = usePlugin(mode, state.forceKey),
156
- needInstall = _usePlugin.needInstall; // eslint-disable-next-line react-hooks/exhaustive-deps
157
-
158
-
136
+ needInstall = _usePlugin.needInstall;
137
+ // eslint-disable-next-line react-hooks/exhaustive-deps
159
138
  var playUrl = useMemo(function () {
160
139
  return mode === 2 && url ? getLocalPlayPath(url, pluginParams) : url;
161
140
  }, [url, mode]);
162
-
163
141
  if (needInstall) {
164
142
  return /*#__PURE__*/React.createElement(NeedInstallPlugin, {
165
143
  pluginDownloadUrl: pluginDownloadUrl,
@@ -172,15 +150,12 @@ export function ExtModel(_ref2) {
172
150
  }
173
151
  });
174
152
  }
175
-
176
153
  if (loading) {
177
154
  return /*#__PURE__*/React.createElement(Loading, null);
178
155
  }
179
-
180
156
  if (!hasUrl) {
181
157
  return /*#__PURE__*/React.createElement(Empty, null);
182
158
  }
183
-
184
159
  return /*#__PURE__*/React.createElement("div", {
185
160
  className: "lm-player-ext-layout"
186
161
  }, /*#__PURE__*/React.cloneElement(children, {
@@ -1,31 +1,21 @@
1
1
  import "antd/lib/progress/style";
2
2
  import _Progress from "antd/lib/progress";
3
-
4
3
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
5
-
6
4
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
7
-
8
5
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
9
-
10
6
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
11
-
12
7
  function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
13
-
14
8
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
15
-
16
9
  import React, { useState, useEffect, useMemo, useRef } from 'react';
17
10
  import "./index.css";
18
-
19
11
  function ProgressComponent(_ref) {
20
12
  var status = _ref.status;
21
13
  var timer = useRef(null);
22
14
  var currentStatus = useRef('loading');
23
-
24
15
  var _useState = useState(0),
25
- _useState2 = _slicedToArray(_useState, 2),
26
- percent = _useState2[0],
27
- setPersent = _useState2[1];
28
-
16
+ _useState2 = _slicedToArray(_useState, 2),
17
+ percent = _useState2[0],
18
+ setPersent = _useState2[1];
29
19
  var isHide = useMemo(function () {
30
20
  return percent === 100;
31
21
  }, [percent]);
@@ -33,7 +23,6 @@ function ProgressComponent(_ref) {
33
23
  if ((status === 'over' || status === 'error') && percent === 0) {
34
24
  return;
35
25
  }
36
-
37
26
  if (percent <= 90 && currentStatus.current === 'loading') {
38
27
  var num = percent + 20;
39
28
  timer.current = setTimeout(function () {
@@ -61,7 +50,6 @@ function ProgressComponent(_ref) {
61
50
  className: "lm-c-loading-progress ".concat(isHide ? 'lm-c-loading-progress-over' : '')
62
51
  });
63
52
  }
64
-
65
53
  ProgressComponent.defaultProps = {
66
54
  status: 'loading'
67
55
  };
package/es/ROI/demo.js CHANGED
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
2
  import ROI from './index';
3
-
4
3
  var App = function App() {
5
4
  return /*#__PURE__*/React.createElement("div", {
6
5
  style: {
@@ -14,5 +13,4 @@ var App = function App() {
14
13
  onChange: console.log
15
14
  }));
16
15
  };
17
-
18
16
  export default App;
package/es/ROI/index.js CHANGED
@@ -2,40 +2,34 @@ import _useUpdateEffect from "ahooks/es/useUpdateEffect";
2
2
  import React, { useEffect, useRef } from 'react';
3
3
  import useDrawROI from '../useDrawROI';
4
4
  import "./index.css";
5
-
6
5
  function RIO(_ref) {
7
6
  var children = _ref.children,
8
- debug = _ref.debug,
9
- renderKey = _ref.renderKey,
10
- onChange = _ref.onChange,
11
- isOpen = _ref.isOpen,
12
- row = _ref.row,
13
- rowItems = _ref.rowItems;
7
+ debug = _ref.debug,
8
+ renderKey = _ref.renderKey,
9
+ onChange = _ref.onChange,
10
+ isOpen = _ref.isOpen,
11
+ row = _ref.row,
12
+ rowItems = _ref.rowItems;
14
13
  var ref = useRef(null);
15
-
16
14
  var _useDrawROI = useDrawROI(ref, {
17
- row: row,
18
- rowItems: rowItems
19
- }),
20
- open = _useDrawROI.open,
21
- close = _useDrawROI.close,
22
- clear = _useDrawROI.clear,
23
- rio = _useDrawROI.rio,
24
- areas = _useDrawROI.areas; // eslint-disable-next-line react-hooks/exhaustive-deps
25
-
26
-
15
+ row: row,
16
+ rowItems: rowItems
17
+ }),
18
+ open = _useDrawROI.open,
19
+ close = _useDrawROI.close,
20
+ clear = _useDrawROI.clear,
21
+ rio = _useDrawROI.rio,
22
+ areas = _useDrawROI.areas;
23
+ // eslint-disable-next-line react-hooks/exhaustive-deps
27
24
  useEffect(function () {
28
25
  return isOpen ? open() : close();
29
26
  }, [isOpen]);
30
-
31
27
  _useUpdateEffect(function () {
32
28
  return clear();
33
29
  }, [renderKey]);
34
-
35
30
  _useUpdateEffect(function () {
36
31
  return onChange === null || onChange === void 0 ? void 0 : onChange(rio, areas);
37
32
  }, [rio]);
38
-
39
33
  return /*#__PURE__*/React.createElement("div", {
40
34
  className: "rio-layout"
41
35
  }, children, debug && /*#__PURE__*/React.createElement("div", {
@@ -55,7 +49,6 @@ function RIO(_ref) {
55
49
  ref: ref
56
50
  }));
57
51
  }
58
-
59
52
  RIO.defaultProps = {
60
53
  row: 18,
61
54
  rowItems: 32