@cloud-app-dev/vidc 3.2.38 → 4.0.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 (121) hide show
  1. package/.dumirc.ts +7 -11
  2. package/.fatherrc.ts +0 -1
  3. package/es/CheckGroupFixed/demo.js +2 -3
  4. package/es/CheckGroupFixed/index.js +4 -7
  5. package/es/Config/index.js +10 -9
  6. package/es/Config/interface.d.ts +2 -3
  7. package/es/CustomRenderSelect/index.js +2 -3
  8. package/es/DynamicList/demo.js +3 -4
  9. package/es/DynamicList/index.js +2 -3
  10. package/es/ErrorFallback/index.js +3 -6
  11. package/es/FrontendPlayer/index.d.ts +4 -2
  12. package/es/List/index.d.ts +0 -13
  13. package/es/List/index.js +1 -19
  14. package/es/LoaderScript/utils.d.ts +0 -1
  15. package/es/LoaderScript/utils.js +1 -36
  16. package/es/Map/FindPio/index.js +2 -3
  17. package/es/Map/LevelCenter/demo.js +2 -4
  18. package/es/Map/ResetTools/index.js +4 -5
  19. package/es/Picture/component/Tools/index.js +6 -7
  20. package/es/Picture/demo.js +9 -13
  21. package/es/Picture/index.js +55 -64
  22. package/es/Picture/utils.js +0 -1
  23. package/es/Player/api/index.js +2 -1
  24. package/es/Player/contraller_bar/volume.js +3 -6
  25. package/es/Player/demo.js +28 -58
  26. package/es/Player/frontend_timeline.js +1 -1
  27. package/es/Player/segment_timeline.js +3 -5
  28. package/es/Player/single_player.js +1 -1
  29. package/es/Player/util.d.ts +0 -1
  30. package/es/Player/util.js +2 -40
  31. package/es/PlayerExt/demo.js +12 -20
  32. package/es/Progress/index.js +4 -6
  33. package/es/RefDrawer/Footer.d.ts +9 -0
  34. package/es/{Drawer → RefDrawer}/Footer.js +3 -5
  35. package/es/{Drawer/Demo.d.ts → RefDrawer/demo.d.ts} +0 -0
  36. package/es/RefDrawer/demo.js +35 -0
  37. package/es/RefDrawer/index.d.ts +26 -0
  38. package/es/{Input → RefDrawer}/index.js +54 -58
  39. package/es/{Input → RefModal}/demo.d.ts +0 -0
  40. package/es/RefModal/demo.js +35 -0
  41. package/es/RefModal/index.d.ts +17 -0
  42. package/es/RefModal/index.js +71 -0
  43. package/es/ScreenPlayer/PlayerWithExt.js +1 -1
  44. package/es/ScreenPlayer/RatePick.js +8 -9
  45. package/es/ScreenPlayer/ScreenSelect.js +2 -3
  46. package/es/ScreenPlayer/SegmentTimeLine.js +3 -11
  47. package/es/ScreenPlayer/TimeMode.js +3 -4
  48. package/es/ScreenPlayer/TimeSelect.js +14 -39
  49. package/es/ScreenPlayer/demo.js +2 -3
  50. package/es/ScreenPlayer/demo2.js +8 -28
  51. package/es/ScreenPlayer/useTimeSlider.js +1 -1
  52. package/es/Service/http.js +6 -8
  53. package/es/TableLayout/index.d.ts +0 -3
  54. package/es/TableLayout/index.js +8 -10
  55. package/es/ThemeAntd/demo.js +21 -40
  56. package/es/ThemeAntd/index.js +16 -2
  57. package/es/ThemeAntd/index.less +0 -12
  58. package/es/Timeout/index.js +2 -2
  59. package/es/core.d.ts +0 -149
  60. package/es/index.d.ts +2 -6
  61. package/es/index.js +2 -6
  62. package/es/useDrawROI/index.js +4 -4
  63. package/es/utils.d.ts +1 -12
  64. package/es/utils.js +0 -56
  65. package/package.json +24 -24
  66. package/theme-config.ts +3 -1
  67. package/typings/global.d.ts +4 -4
  68. package/es/Api/index.d.ts +0 -12
  69. package/es/Api/index.js +0 -267
  70. package/es/Box/BetweenBox/index.d.ts +0 -12
  71. package/es/Box/BetweenBox/index.js +0 -31
  72. package/es/Box/BetweenBox/index.less +0 -5
  73. package/es/Box/InfoBox/index.d.ts +0 -12
  74. package/es/Box/InfoBox/index.js +0 -30
  75. package/es/Box/InfoBox/index.less +0 -24
  76. package/es/Box/TwoColumnBox/index.d.ts +0 -10
  77. package/es/Box/TwoColumnBox/index.js +0 -54
  78. package/es/Box/TwoColumnBox/index.less +0 -80
  79. package/es/Box/deps/content-grid.d.ts +0 -9
  80. package/es/Box/deps/content-grid.js +0 -9
  81. package/es/Box/deps/grid-factory.d.ts +0 -10
  82. package/es/Box/deps/grid-factory.js +0 -72
  83. package/es/Box/deps/simple-grid.d.ts +0 -9
  84. package/es/Box/deps/simple-grid.js +0 -8
  85. package/es/Box/index.d.ts +0 -14
  86. package/es/Box/index.js +0 -39
  87. package/es/Box/index.less +0 -10
  88. package/es/Drawer/Demo.js +0 -109
  89. package/es/Drawer/Footer.d.ts +0 -5
  90. package/es/Drawer/index.d.ts +0 -38
  91. package/es/Drawer/index.js +0 -207
  92. package/es/Drawer/index.less +0 -42
  93. package/es/Drawer/interface.d.ts +0 -22
  94. package/es/Input/demo.js +0 -16
  95. package/es/Input/index.d.ts +0 -19
  96. package/es/Input/index.less +0 -12
  97. package/es/Modal/demo.d.ts +0 -3
  98. package/es/Modal/demo.js +0 -106
  99. package/es/Modal/index.d.ts +0 -44
  100. package/es/Modal/index.js +0 -197
  101. package/es/Modal/index.less +0 -44
  102. package/es/Modal/interface.d.ts +0 -23
  103. package/es/Service/fetch-adapter.d.ts +0 -12
  104. package/es/Service/fetch-adapter.js +0 -203
  105. package/es/ThemeAntd/style/button.less +0 -67
  106. package/es/ThemeAntd/style/checkbox.less +0 -72
  107. package/es/ThemeAntd/style/form.less +0 -12
  108. package/es/ThemeAntd/style/input.less +0 -83
  109. package/es/ThemeAntd/style/pagination.less +0 -96
  110. package/es/ThemeAntd/style/picker.less +0 -106
  111. package/es/ThemeAntd/style/popover.less +0 -5
  112. package/es/ThemeAntd/style/radio.less +0 -87
  113. package/es/ThemeAntd/style/scrollbar.less +0 -23
  114. package/es/ThemeAntd/style/select.less +0 -81
  115. package/es/ThemeAntd/style/table.less +0 -57
  116. package/es/ThemeAntd/style/tree.less +0 -18
  117. package/es/Tree/demo.d.ts +0 -3
  118. package/es/Tree/demo.js +0 -32
  119. package/es/Tree/index.d.ts +0 -24
  120. package/es/Tree/index.js +0 -100
  121. package/es/Tree/index.less +0 -60
@@ -1,23 +1,15 @@
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
1
  import _useUpdateEffect from "ahooks/es/useUpdateEffect";
4
- import _nextTick from "@cloud-app-dev/utils/es/nextTick";
2
+ import _useUpdateLayoutEffect from "ahooks/es/useUpdateLayoutEffect";
5
3
  import _useMemoizedFn from "ahooks/es/useMemoizedFn";
6
4
  import _useSize from "ahooks/es/useSize";
7
5
  var _excluded = ["className", "width", "height", "minHeight", "disabledDrag", "imagePath", "rects", "isOpenSelect", "disabledDrawMenu", "menus", "hasTool", "fullScreenEle"];
8
6
 
9
- 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; }
10
-
11
7
  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; }
12
8
 
13
9
  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; }
14
10
 
15
11
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
16
12
 
17
- 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); } }
18
-
19
- 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); }); }; }
20
-
21
13
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
22
14
 
23
15
  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."); }
@@ -81,6 +73,7 @@ function Picture(_ref) {
81
73
  scale: 1,
82
74
  baseXOrY: 'x',
83
75
  forceUpdateKey: Date.now(),
76
+ loadedTime: 0,
84
77
  fullScreenStatus: false,
85
78
  localUrl: '',
86
79
  offset: [0, 0],
@@ -124,55 +117,46 @@ function Picture(_ref) {
124
117
  isEnd = _useDraw2[1]; // init loaded
125
118
 
126
119
 
127
- var loadImageSuccess = _useMemoizedFn( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
128
- var _getImgSize, x, y, size, baseXOrY, moveObj;
129
-
130
- return _regeneratorRuntime().wrap(function _callee$(_context) {
131
- while (1) {
132
- switch (_context.prev = _context.next) {
133
- case 0:
134
- if (!(!state.localUrl || !layoutRef.current || !domImgRef.current)) {
135
- _context.next = 2;
136
- break;
137
- }
138
-
139
- return _context.abrupt("return");
140
-
141
- case 2:
142
- _getImgSize = getImgSize(layoutRef.current, domImgRef.current), x = _getImgSize.x, y = _getImgSize.y, size = _getImgSize.size, baseXOrY = _getImgSize.baseXOrY;
143
- moveObj = moveActionRef.current;
144
- moveObj.updatePosition({
145
- x: x,
146
- y: y
147
- });
148
- setState(function (old) {
149
- return _objectSpread(_objectSpread({}, old), {}, {
150
- x: x,
151
- y: y,
152
- offset: [x, y],
153
- baseXOrY: baseXOrY,
154
- size: size
155
- });
156
- }); // 异步触发rects重新计算
157
-
158
- _nextTick(function () {
159
- return updateState({
160
- forceUpdateKey: Date.now()
161
- });
162
- }, 'setTimeout');
163
-
164
- case 7:
165
- case "end":
166
- return _context.stop();
167
- }
168
- }
169
- }, _callee);
170
- }))); // 更新重绘
120
+ var loadImageSuccess = _useMemoizedFn(function () {
121
+ if (!state.localUrl || !layoutRef.current || !domImgRef.current) {
122
+ return;
123
+ }
171
124
 
125
+ var _getImgSize = getImgSize(layoutRef.current, domImgRef.current),
126
+ x = _getImgSize.x,
127
+ y = _getImgSize.y,
128
+ size = _getImgSize.size,
129
+ baseXOrY = _getImgSize.baseXOrY;
172
130
 
173
- _useUpdateEffect(function () {
131
+ var moveObj = moveActionRef.current;
132
+ moveObj.updatePosition({
133
+ x: x,
134
+ y: y
135
+ });
136
+ setState(function (old) {
137
+ return _objectSpread(_objectSpread({}, old), {}, {
138
+ x: x,
139
+ y: y,
140
+ offset: [x, y],
141
+ baseXOrY: baseXOrY,
142
+ size: size,
143
+ loadedTime: Date.now()
144
+ });
145
+ });
146
+ }); // 更新重绘
147
+
148
+
149
+ _useUpdateLayoutEffect(function () {
174
150
  loadImageSuccess();
175
- }, [size]);
151
+ }, [size]); // 更新重绘
152
+
153
+
154
+ _useUpdateLayoutEffect(function () {
155
+ // Rects重新计算
156
+ updateState({
157
+ forceUpdateKey: Date.now()
158
+ });
159
+ }, [state.loadedTime]);
176
160
  /**
177
161
  * 设置图片缩放
178
162
  */
@@ -242,9 +226,9 @@ function Picture(_ref) {
242
226
  */
243
227
 
244
228
 
245
- var onDragChange = _useMemoizedFn(function (_ref3) {
246
- var x = _ref3.x,
247
- y = _ref3.y;
229
+ var onDragChange = _useMemoizedFn(function (_ref2) {
230
+ var x = _ref2.x,
231
+ y = _ref2.y;
248
232
  return setState(function (old) {
249
233
  return _objectSpread(_objectSpread({}, old), {}, {
250
234
  x: x,
@@ -262,12 +246,12 @@ function Picture(_ref) {
262
246
  return undefined;
263
247
  }
264
248
 
265
- var _ref4 = size || {
249
+ var _ref3 = size || {
266
250
  width: 0,
267
251
  height: 0
268
252
  },
269
- width = _ref4.width,
270
- height = _ref4.height;
253
+ width = _ref3.width,
254
+ height = _ref3.height;
271
255
 
272
256
  var imgw = domImgRef.current.width * state.scale;
273
257
  var imgh = domImgRef.current.height * state.scale;
@@ -312,8 +296,14 @@ function Picture(_ref) {
312
296
  getRectImage: getRectImage,
313
297
  containerEle: layoutRef.current
314
298
  };
315
- useEffect(function () {
316
- if (isOpenSelect && (state.rotate !== 0 || state.scale !== 1)) {
299
+
300
+ _useUpdateEffect(function () {
301
+ if (isOpenSelect) {
302
+ var moveObj = moveActionRef.current;
303
+ moveObj.updatePosition({
304
+ x: state.offset[0],
305
+ y: state.offset[1]
306
+ });
317
307
  updateState({
318
308
  scale: 1,
319
309
  rotate: 0,
@@ -321,7 +311,8 @@ function Picture(_ref) {
321
311
  y: state.offset[1]
322
312
  });
323
313
  }
324
- }, [isOpenSelect, state.rotate, state.scale]);
314
+ }, [isOpenSelect]);
315
+
325
316
  return /*#__PURE__*/_jsxs(_Fragment, {
326
317
  children: [/*#__PURE__*/_jsxs("div", {
327
318
  className: "picture-view-layout ".concat(className),
@@ -81,7 +81,6 @@ export function computedRectScale(_ref) {
81
81
  width = _domImg$getBoundingCl.width,
82
82
  height = _domImg$getBoundingCl.height;
83
83
 
84
- console.log(width, height, domImg.naturalWidth, domImg.naturalHeight);
85
84
  var scaleOptions = {
86
85
  scaleX: (_ref2 = width / domImg.naturalWidth) !== null && _ref2 !== void 0 ? _ref2 : 1,
87
86
  scaleY: (_ref3 = height / domImg.naturalHeight) !== null && _ref3 !== void 0 ? _ref3 : 1
@@ -21,7 +21,8 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
21
21
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
22
22
 
23
23
  import { useEffect, useState } from 'react';
24
- import { createFlvPlayer, createHlsPlayer, tryCatch } from "../util";
24
+ import { tryCatch } from "../../utils";
25
+ import { createFlvPlayer, createHlsPlayer } from "../util";
25
26
 
26
27
  var Api = /*#__PURE__*/function () {
27
28
  function Api(container) {
@@ -1,7 +1,3 @@
1
- import "antd/lib/tooltip/style";
2
- import _Tooltip from "antd/lib/tooltip";
3
- import "antd/lib/slider/style";
4
- import _Slider from "antd/lib/slider";
5
1
  import _useUpdateEffect from "ahooks/es/useUpdateEffect";
6
2
  import _useUpdate from "ahooks/es/useUpdate";
7
3
 
@@ -17,6 +13,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
17
13
 
18
14
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
19
15
 
16
+ import { Slider, Tooltip } from 'antd';
20
17
  import React, { useMemo, useState } from 'react';
21
18
  import IconFont from "../iconfont";
22
19
  import "../style/volume.less";
@@ -69,10 +66,10 @@ function Volume(_ref) {
69
66
  return api === null || api === void 0 ? void 0 : api.setVolume(val / 100);
70
67
  }, [val]);
71
68
 
72
- return /*#__PURE__*/_jsx(_Tooltip, {
69
+ return /*#__PURE__*/_jsx(Tooltip, {
73
70
  showArrow: false,
74
71
  overlayClassName: "lm-player-volume-popup",
75
- title: /*#__PURE__*/_jsx(_Slider, {
72
+ title: /*#__PURE__*/_jsx(Slider, {
76
73
  onChange: onChange,
77
74
  vertical: true,
78
75
  value: val
package/es/Player/demo.js CHANGED
@@ -1,12 +1,3 @@
1
- import "antd/lib/config-provider/style";
2
- import _ConfigProvider from "antd/lib/config-provider";
3
- import "antd/lib/button/style";
4
- import _Button from "antd/lib/button";
5
- import "antd/lib/input/style";
6
- import _Input from "antd/lib/input";
7
- import "antd/lib/select/style";
8
- import _Select from "antd/lib/select";
9
-
10
1
  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; }
11
2
 
12
3
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
@@ -25,11 +16,12 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
25
16
 
26
17
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
27
18
 
19
+ import { Button, ConfigProvider, Input, Select } from 'antd';
20
+ import moment from 'dayjs';
28
21
  import React, { useState } from 'react';
29
- import Player from "./single_player";
30
- import SegmentPlayer from "./segment_player";
31
22
  import FrontendPlayer from "./frontend_player";
32
- import moment from 'moment';
23
+ import SegmentPlayer from "./segment_player";
24
+ import Player from "./single_player";
33
25
  import { jsx as _jsx } from "react/jsx-runtime";
34
26
  import { jsxs as _jsxs } from "react/jsx-runtime";
35
27
  import { Fragment as _Fragment } from "react/jsx-runtime";
@@ -73,7 +65,7 @@ function Demo1() {
73
65
  marginBottom: 10,
74
66
  display: 'flex'
75
67
  },
76
- children: [/*#__PURE__*/_jsx(_Select, {
68
+ children: [/*#__PURE__*/_jsx(Select, {
77
69
  value: state.type || '',
78
70
  onChange: function onChange(val) {
79
71
  return setState(function (old) {
@@ -83,12 +75,12 @@ function Demo1() {
83
75
  });
84
76
  },
85
77
  children: options.map(function (v) {
86
- return /*#__PURE__*/_jsx(_Select.Option, {
78
+ return /*#__PURE__*/_jsx(Select.Option, {
87
79
  value: v.value,
88
80
  children: v.label
89
81
  }, v.label);
90
82
  })
91
- }), /*#__PURE__*/_jsx(_Input, {
83
+ }), /*#__PURE__*/_jsx(Input, {
92
84
  style: {
93
85
  flex: 1,
94
86
  height: 32
@@ -102,7 +94,7 @@ function Demo1() {
102
94
  });
103
95
  });
104
96
  }
105
- }), /*#__PURE__*/_jsx(_Select, {
97
+ }), /*#__PURE__*/_jsx(Select, {
106
98
  value: state.isLive,
107
99
  onChange: function onChange(val) {
108
100
  return setState(function (old) {
@@ -112,17 +104,17 @@ function Demo1() {
112
104
  });
113
105
  },
114
106
  children: options2.map(function (v) {
115
- return /*#__PURE__*/_jsx(_Select.Option, {
107
+ return /*#__PURE__*/_jsx(Select.Option, {
116
108
  value: v.value,
117
109
  children: v.label
118
110
  }, v.label);
119
111
  })
120
- }), /*#__PURE__*/_jsx(_Button, {
112
+ }), /*#__PURE__*/_jsx(Button, {
121
113
  style: {
122
114
  width: 60,
123
115
  height: 32
124
116
  },
125
- onClick: function onClick(e) {
117
+ onClick: function onClick() {
126
118
  return setState(function (old) {
127
119
  return _objectSpread(_objectSpread({}, old), {}, {
128
120
  url: state.tempUrl
@@ -142,11 +134,7 @@ function Demo1() {
142
134
  });
143
135
  }
144
136
 
145
- var mm = moment().set({
146
- hours: 0,
147
- minutes: 0,
148
- seconds: 0
149
- });
137
+ var mm = moment().set('hours', 0).set('minutes', 0).set('seconds', 0);
150
138
  var m = mm.clone();
151
139
 
152
140
  function Demo2() {
@@ -154,39 +142,21 @@ function Demo2() {
154
142
  isLive: 1,
155
143
  segments: [{
156
144
  beginTime: m.valueOf(),
157
- endTime: m.set({
158
- minutes: 1
159
- }).valueOf(),
145
+ endTime: m.set('minutes', 1).valueOf(),
160
146
  url: 'http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4'
161
147
  }, {
162
- beginTime: m.set({
163
- minutes: 1
164
- }).valueOf(),
165
- endTime: m.set({
166
- minutes: 2
167
- }).valueOf()
148
+ beginTime: m.set('minutes', 1).valueOf(),
149
+ endTime: m.set('minutes', 2).valueOf()
168
150
  }, {
169
- beginTime: m.set({
170
- minutes: 2
171
- }).valueOf(),
172
- endTime: m.set({
173
- minutes: 3
174
- }).valueOf(),
151
+ beginTime: m.set('minutes', 2).valueOf(),
152
+ endTime: m.set('minutes', 3).valueOf(),
175
153
  url: 'http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4?date=1'
176
154
  }, {
177
- beginTime: m.set({
178
- minutes: 3
179
- }).valueOf(),
180
- endTime: m.set({
181
- minutes: 4
182
- }).valueOf()
155
+ beginTime: m.set('minutes', 3).valueOf(),
156
+ endTime: m.set('minutes', 4).valueOf()
183
157
  }, {
184
- beginTime: m.set({
185
- minutes: 4
186
- }).valueOf(),
187
- endTime: m.set({
188
- minutes: 5
189
- }).valueOf(),
158
+ beginTime: m.set('minutes', 4).valueOf(),
159
+ endTime: m.set('minutes', 5).valueOf(),
190
160
  url: 'http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4?date=2'
191
161
  }],
192
162
  tempUrl: ''
@@ -207,7 +177,7 @@ function Demo2() {
207
177
  marginBottom: 10,
208
178
  display: 'flex'
209
179
  },
210
- children: [/*#__PURE__*/_jsx(_Input, {
180
+ children: [/*#__PURE__*/_jsx(Input, {
211
181
  style: {
212
182
  flex: 1,
213
183
  height: 32
@@ -221,12 +191,12 @@ function Demo2() {
221
191
  });
222
192
  });
223
193
  }
224
- }), /*#__PURE__*/_jsx(_Button, {
194
+ }), /*#__PURE__*/_jsx(Button, {
225
195
  style: {
226
196
  width: 60,
227
197
  height: 32
228
198
  },
229
- onClick: function onClick(e) {
199
+ onClick: function onClick() {
230
200
  return setState(function (old) {
231
201
  return _objectSpread(_objectSpread({}, old), {}, {
232
202
  segments: JSON.parse(state.tempUrl)
@@ -268,7 +238,7 @@ function Demo3() {
268
238
  marginBottom: 10,
269
239
  display: 'flex'
270
240
  },
271
- children: [/*#__PURE__*/_jsx(_Input, {
241
+ children: [/*#__PURE__*/_jsx(Input, {
272
242
  style: {
273
243
  flex: 1,
274
244
  height: 32
@@ -282,12 +252,12 @@ function Demo3() {
282
252
  });
283
253
  });
284
254
  }
285
- }), /*#__PURE__*/_jsx(_Button, {
255
+ }), /*#__PURE__*/_jsx(Button, {
286
256
  style: {
287
257
  width: 60,
288
258
  height: 32
289
259
  },
290
- onClick: function onClick(e) {
260
+ onClick: function onClick() {
291
261
  return setState(function (old) {
292
262
  return _objectSpread(_objectSpread({}, old), {}, {
293
263
  url: state.tempUrl
@@ -313,7 +283,7 @@ function Demo3() {
313
283
  }
314
284
 
315
285
  var App = function App() {
316
- return /*#__PURE__*/_jsxs(_ConfigProvider, {
286
+ return /*#__PURE__*/_jsxs(ConfigProvider, {
317
287
  prefixCls: "cloudapp",
318
288
  children: [/*#__PURE__*/_jsx(Demo1, {}), /*#__PURE__*/_jsx(Demo2, {}), /*#__PURE__*/_jsx(Demo3, {})]
319
289
  });
@@ -18,7 +18,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
18
18
 
19
19
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
20
20
 
21
- import moment from 'moment';
21
+ import moment from 'dayjs';
22
22
  import React, { startTransition, useMemo, useState } from 'react';
23
23
  import useBarStatus from "./contraller_bar/useBarStatus";
24
24
  import "./style/timeline.less";
@@ -1,6 +1,3 @@
1
- import "antd/lib/tooltip/style";
2
- import _Tooltip from "antd/lib/tooltip";
3
-
4
1
  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; }
5
2
 
6
3
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
@@ -19,7 +16,8 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
19
16
 
20
17
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
21
18
 
22
- import moment from 'moment';
19
+ import { Tooltip } from 'antd';
20
+ import moment from 'dayjs';
23
21
  import React, { startTransition, useMemo, useState } from 'react';
24
22
  import useBarStatus from "./contraller_bar/useBarStatus";
25
23
  import "./style/timeline.less";
@@ -175,7 +173,7 @@ function SegmentTimeLine(_ref2) {
175
173
  children: /*#__PURE__*/_jsxs("div", {
176
174
  className: "segment-line-box",
177
175
  children: [segments.map(function (v, i) {
178
- return /*#__PURE__*/_jsx(_Tooltip, {
176
+ return /*#__PURE__*/_jsx(Tooltip, {
179
177
  title: /*#__PURE__*/_jsx(TipTitle, {
180
178
  segments: segments,
181
179
  index: i,
@@ -42,7 +42,7 @@ import { getVideoType, playReload, playUnload } from "./util";
42
42
  import "./style/index.less";
43
43
  import { jsx as _jsx } from "react/jsx-runtime";
44
44
  import { jsxs as _jsxs } from "react/jsx-runtime";
45
- var SinglePlayer = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
45
+ var SinglePlayer = /*#__PURE__*/React.forwardRef(function SinglePlayer(_ref, ref) {
46
46
  var _props$reload;
47
47
 
48
48
  var className = _ref.className,
@@ -2,7 +2,6 @@ import Flvjs from '@cloud-app-dev/flv.js';
2
2
  import Hls, { HlsConfig } from 'hls.js';
3
3
  import type VideoEventInstance from './event';
4
4
  import type { FlvPlayerConfig } from './player';
5
- export declare function tryCatch(fn: () => void | Promise<any>): Promise<void>;
6
5
  /**
7
6
  * 创建HLS对象
8
7
  * @param {*} video
package/es/Player/util.js CHANGED
@@ -1,57 +1,19 @@
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
- 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
1
  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; }
6
2
 
7
3
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
8
4
 
9
5
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
10
6
 
11
- 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); } }
12
-
13
- 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); }); }; }
14
-
15
7
  import Flvjs from '@cloud-app-dev/flv.js';
16
8
  import Hls from 'hls.js';
9
+ import { tryCatch } from "../utils";
17
10
  import Events from "./event/eventName";
18
- export function tryCatch(_x) {
19
- return _tryCatch.apply(this, arguments);
20
- }
11
+
21
12
  /**
22
13
  * 创建HLS对象
23
14
  * @param {*} video
24
15
  * @param {*} URL
25
16
  */
26
-
27
- function _tryCatch() {
28
- _tryCatch = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(fn) {
29
- return _regeneratorRuntime().wrap(function _callee$(_context) {
30
- while (1) {
31
- switch (_context.prev = _context.next) {
32
- case 0:
33
- _context.prev = 0;
34
- _context.next = 3;
35
- return fn();
36
-
37
- case 3:
38
- _context.next = 7;
39
- break;
40
-
41
- case 5:
42
- _context.prev = 5;
43
- _context.t0 = _context["catch"](0);
44
-
45
- case 7:
46
- case "end":
47
- return _context.stop();
48
- }
49
- }
50
- }, _callee, null, [[0, 5]]);
51
- }));
52
- return _tryCatch.apply(this, arguments);
53
- }
54
-
55
17
  export function createHlsPlayer(video, url, isLive, hlsConfig) {
56
18
  if (!Hls.isSupported() || !url) {
57
19
  return undefined;