@vtx/player 1.7.13 → 1.7.14

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 (143) hide show
  1. package/README.md +2 -2
  2. package/lib/api/fetch.js +62 -91
  3. package/lib/api/fetch.js.map +1 -1
  4. package/lib/api/index.js +18 -63
  5. package/lib/api/index.js.map +1 -1
  6. package/lib/api/types.d.ts +5 -5
  7. package/lib/bd/PlayerManager.js +38 -68
  8. package/lib/bd/PlayerManager.js.map +1 -1
  9. package/lib/bill-player/index.d.ts +1 -1
  10. package/lib/bill-player/index.js +66 -121
  11. package/lib/bill-player/index.js.map +1 -1
  12. package/lib/bill-player/style/css.js +0 -9
  13. package/lib/bill-player/style/css.js.map +1 -1
  14. package/lib/bill-player/style/index.js +0 -9
  15. package/lib/bill-player/style/index.js.map +1 -1
  16. package/lib/bill-player/style/index.less +297 -297
  17. package/lib/components/set-tag-video/index.js +6 -34
  18. package/lib/components/set-tag-video/index.js.map +1 -1
  19. package/lib/components/set-tag-video/style/css.js.map +1 -1
  20. package/lib/components/set-tag-video/style/index.js.map +1 -1
  21. package/lib/components/set-tag-video/style/index.less +125 -125
  22. package/lib/components/split-screen/index.d.ts +1 -1
  23. package/lib/components/split-screen/index.js +3 -14
  24. package/lib/components/split-screen/index.js.map +1 -1
  25. package/lib/components/split-screen/style/css.js.map +1 -1
  26. package/lib/components/split-screen/style/index.js.map +1 -1
  27. package/lib/components/tag-video/index.js +10 -38
  28. package/lib/components/tag-video/index.js.map +1 -1
  29. package/lib/components/tag-video/style/css.js.map +1 -1
  30. package/lib/components/tag-video/style/index.js.map +1 -1
  31. package/lib/components/tag-video/style/index.less +69 -69
  32. package/lib/components/video-scale/index.d.ts +1 -1
  33. package/lib/components/video-scale/index.js +2 -9
  34. package/lib/components/video-scale/index.js.map +1 -1
  35. package/lib/components/video-scale/style/css.js.map +1 -1
  36. package/lib/components/video-scale/style/index.js.map +1 -1
  37. package/lib/context/index.js +0 -4
  38. package/lib/context/index.js.map +1 -1
  39. package/lib/controls/index.d.ts +11 -11
  40. package/lib/controls/index.js +34 -99
  41. package/lib/controls/index.js.map +1 -1
  42. package/lib/controls/style/css.js +0 -5
  43. package/lib/controls/style/css.js.map +1 -1
  44. package/lib/controls/style/index.js +0 -5
  45. package/lib/controls/style/index.js.map +1 -1
  46. package/lib/controls/style/index.less +188 -188
  47. package/lib/h264/PlayerManager.js +18 -27
  48. package/lib/h264/PlayerManager.js.map +1 -1
  49. package/lib/history-control/index.d.ts +2 -2
  50. package/lib/history-control/index.js +61 -121
  51. package/lib/history-control/index.js.map +1 -1
  52. package/lib/history-control/style/css.js +0 -6
  53. package/lib/history-control/style/css.js.map +1 -1
  54. package/lib/history-control/style/index.js +0 -6
  55. package/lib/history-control/style/index.js.map +1 -1
  56. package/lib/history-control/style/index.less +252 -252
  57. package/lib/history-control-v2/components/grid-item/index.js +38 -77
  58. package/lib/history-control-v2/components/grid-item/index.js.map +1 -1
  59. package/lib/history-control-v2/components/panel/index.js +44 -114
  60. package/lib/history-control-v2/components/panel/index.js.map +1 -1
  61. package/lib/history-control-v2/context.js +0 -2
  62. package/lib/history-control-v2/context.js.map +1 -1
  63. package/lib/history-control-v2/index.d.ts +4 -4
  64. package/lib/history-control-v2/index.js +97 -166
  65. package/lib/history-control-v2/index.js.map +1 -1
  66. package/lib/history-control-v2/style/css.js +0 -10
  67. package/lib/history-control-v2/style/css.js.map +1 -1
  68. package/lib/history-control-v2/style/index.js +0 -10
  69. package/lib/history-control-v2/style/index.js.map +1 -1
  70. package/lib/history-control-v2/style/index.less +437 -437
  71. package/lib/history-control-v2/utils.js +1 -21
  72. package/lib/history-control-v2/utils.js.map +1 -1
  73. package/lib/history-player/index.d.ts +1 -1
  74. package/lib/history-player/index.js +146 -205
  75. package/lib/history-player/index.js.map +1 -1
  76. package/lib/history-player/style/css.js +0 -3
  77. package/lib/history-player/style/css.js.map +1 -1
  78. package/lib/history-player/style/index.js +0 -3
  79. package/lib/history-player/style/index.js.map +1 -1
  80. package/lib/history-player/style/index.less +102 -102
  81. package/lib/hooks/useSettings.js +1 -6
  82. package/lib/hooks/useSettings.js.map +1 -1
  83. package/lib/icc/PlayerManager.js +26 -57
  84. package/lib/icc/PlayerManager.js.map +1 -1
  85. package/lib/icc/api.d.ts +0 -68
  86. package/lib/icc/api.js +2 -16
  87. package/lib/icc/api.js.map +1 -1
  88. package/lib/icons/index.d.ts +36 -36
  89. package/lib/icons/index.js +23 -171
  90. package/lib/icons/index.js.map +1 -1
  91. package/lib/icons/index.less +32 -32
  92. package/lib/index.js +0 -10
  93. package/lib/index.js.map +1 -1
  94. package/lib/live-channel-player/index.d.ts +1 -1
  95. package/lib/live-channel-player/index.js +31 -67
  96. package/lib/live-channel-player/index.js.map +1 -1
  97. package/lib/live-channel-player/style/css.js +0 -1
  98. package/lib/live-channel-player/style/css.js.map +1 -1
  99. package/lib/live-channel-player/style/index.js +0 -1
  100. package/lib/live-channel-player/style/index.js.map +1 -1
  101. package/lib/live-control/index.d.ts +2 -2
  102. package/lib/live-control/index.js +35 -86
  103. package/lib/live-control/index.js.map +1 -1
  104. package/lib/live-control/style/css.js +0 -4
  105. package/lib/live-control/style/css.js.map +1 -1
  106. package/lib/live-control/style/index.js +0 -4
  107. package/lib/live-control/style/index.js.map +1 -1
  108. package/lib/live-control/style/index.less +99 -99
  109. package/lib/live-control-v2/index.d.ts +3 -3
  110. package/lib/live-control-v2/index.js +108 -141
  111. package/lib/live-control-v2/index.js.map +1 -1
  112. package/lib/live-control-v2/style/css.js +0 -7
  113. package/lib/live-control-v2/style/css.js.map +1 -1
  114. package/lib/live-control-v2/style/index.js +0 -7
  115. package/lib/live-control-v2/style/index.js.map +1 -1
  116. package/lib/live-control-v2/style/index.less +192 -192
  117. package/lib/live-player/index.js +95 -136
  118. package/lib/live-player/index.js.map +1 -1
  119. package/lib/live-player/style/css.js +0 -2
  120. package/lib/live-player/style/css.js.map +1 -1
  121. package/lib/live-player/style/index.js +0 -2
  122. package/lib/live-player/style/index.js.map +1 -1
  123. package/lib/live-player/style/index.less +75 -75
  124. package/lib/player/index.d.ts +1 -1
  125. package/lib/player/index.js +79 -244
  126. package/lib/player/index.js.map +1 -1
  127. package/lib/rsl/PlayerManager.js +18 -64
  128. package/lib/rsl/PlayerManager.js.map +1 -1
  129. package/lib/typings/@vtx/utils/index.d.ts +28 -28
  130. package/lib/typings/h5player.d.ts +146 -146
  131. package/lib/typings/webrtcplayer.d.ts +56 -56
  132. package/lib/typings/wsplayer.d.ts +99 -99
  133. package/lib/utils/index.d.ts +1 -1
  134. package/lib/utils/index.js +12 -91
  135. package/lib/utils/index.js.map +1 -1
  136. package/lib/vite-env.d.ts +1 -1
  137. package/lib/vtxHls/PlayerManager.js +6 -20
  138. package/lib/vtxHls/PlayerManager.js.map +1 -1
  139. package/lib/vtxHls/WhepManager.js +9 -72
  140. package/lib/vtxHls/WhepManager.js.map +1 -1
  141. package/lib/webrtc/PlayerManager.js +28 -41
  142. package/lib/webrtc/PlayerManager.js.map +1 -1
  143. package/package.json +125 -125
@@ -1,9 +1,9 @@
1
1
  /// <reference types="react" />
2
2
  import { IChannel, IGetHistoryUrlParams, IHistoryControlProps, IHistoryControlV2Handle, IHistoryPlayInfoParams } from './interface';
3
- export declare type HistoryControlV2Handle = IHistoryControlV2Handle;
4
- export declare type HistoryPlayInfoParams = IHistoryPlayInfoParams;
5
- export declare type GetHistoryUrlParams = IGetHistoryUrlParams;
6
- export declare type Channel = IChannel;
3
+ export type HistoryControlV2Handle = IHistoryControlV2Handle;
4
+ export type HistoryPlayInfoParams = IHistoryPlayInfoParams;
5
+ export type GetHistoryUrlParams = IGetHistoryUrlParams;
6
+ export type Channel = IChannel;
7
7
  /**
8
8
  * 历史视频控制器
9
9
  */
@@ -1,77 +1,45 @@
1
1
  "use strict";
2
2
 
3
3
  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); }
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports["default"] = exports.HistoryControlV2 = void 0;
9
-
10
8
  var _jsxRuntime = require("react/jsx-runtime");
11
-
12
9
  var _react = require("react");
13
-
14
10
  var _api = require("../api");
15
-
16
11
  var _splitScreen = _interopRequireWildcard(require("../components/split-screen"));
17
-
18
12
  var _videoScale = _interopRequireDefault(require("../components/video-scale"));
19
-
20
13
  var _icons = require("../icons");
21
-
22
14
  var _utils = require("../utils");
23
-
24
15
  var _icons2 = require("@ant-design/icons");
25
-
26
16
  var _ahooks = require("ahooks");
27
-
28
17
  var _space = _interopRequireDefault(require("antd/lib/space"));
29
-
30
18
  var _spin = _interopRequireDefault(require("antd/lib/spin"));
31
-
32
19
  var _gridItem = _interopRequireDefault(require("./components/grid-item"));
33
-
34
20
  var _panel = _interopRequireDefault(require("./components/panel"));
35
-
36
21
  var _context2 = require("./context");
37
-
38
22
  var _utils2 = require("./utils");
39
-
40
23
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
41
-
42
24
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
43
-
44
25
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
45
-
46
- 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; }
47
-
26
+ 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, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $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 defineProperty(generator, "_invoke", { value: makeInvokeMethod(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; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(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); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), 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, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), 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 (val) { var object = Object(val), 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; }
48
27
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
49
-
50
28
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
51
-
52
29
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
53
-
54
30
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
55
-
56
31
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
57
-
58
32
  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."); }
59
-
60
33
  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); }
61
-
62
- 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; }
63
-
64
- 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; }
65
-
34
+ 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; }
35
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
66
36
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
67
-
68
37
  var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
69
38
  function adopt(value) {
70
39
  return value instanceof P ? value : new P(function (resolve) {
71
40
  resolve(value);
72
41
  });
73
42
  }
74
-
75
43
  return new (P || (P = Promise))(function (resolve, reject) {
76
44
  function fulfilled(value) {
77
45
  try {
@@ -80,7 +48,6 @@ var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P
80
48
  reject(e);
81
49
  }
82
50
  }
83
-
84
51
  function rejected(value) {
85
52
  try {
86
53
  step(generator["throw"](value));
@@ -88,79 +55,66 @@ var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P
88
55
  reject(e);
89
56
  }
90
57
  }
91
-
92
58
  function step(result) {
93
59
  result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
94
60
  }
95
-
96
61
  step((generator = generator.apply(thisArg, _arguments || [])).next());
97
62
  });
98
63
  };
99
-
100
64
  /**
101
65
  * 历史视频控制器
102
66
  */
103
67
  var HistoryControlV2 = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
104
68
  var _props$width = props.width,
105
- width = _props$width === void 0 ? '100%' : _props$width,
106
- _props$height = props.height,
107
- height = _props$height === void 0 ? '100%' : _props$height,
108
- defaultGrid = props.defaultGrid,
109
- onExpandChange = props.onExpandChange,
110
- _onVideoClose = props.onVideoClose,
111
- onVideoCloseAll = props.onVideoCloseAll,
112
- _onScreenshot = props.onScreenshot,
113
- onPlayingChannelChange = props.onPlayingChannelChange,
114
- onTimeChange = props.onTimeChange;
115
-
69
+ width = _props$width === void 0 ? '100%' : _props$width,
70
+ _props$height = props.height,
71
+ height = _props$height === void 0 ? '100%' : _props$height,
72
+ defaultGrid = props.defaultGrid,
73
+ onExpandChange = props.onExpandChange,
74
+ _onVideoClose = props.onVideoClose,
75
+ onVideoCloseAll = props.onVideoCloseAll,
76
+ _onScreenshot = props.onScreenshot,
77
+ onPlayingChannelChange = props.onPlayingChannelChange,
78
+ onTimeChange = props.onTimeChange;
116
79
  var _useSetState = (0, _ahooks.useSetState)({
117
- expand: true,
118
- grid: defaultGrid || _utils2.DEFAULT_GRID,
119
- scale: '100%'
120
- }),
121
- _useSetState2 = _slicedToArray(_useSetState, 2),
122
- state = _useSetState2[0],
123
- setState = _useSetState2[1];
124
-
80
+ expand: true,
81
+ grid: defaultGrid || _utils2.DEFAULT_GRID,
82
+ scale: '100%'
83
+ }),
84
+ _useSetState2 = _slicedToArray(_useSetState, 2),
85
+ state = _useSetState2[0],
86
+ setState = _useSetState2[1];
125
87
  var _useState = (0, _react.useState)(_utils2.DEFAULT_CHANNELS),
126
- _useState2 = _slicedToArray(_useState, 2),
127
- channels = _useState2[0],
128
- setChannels = _useState2[1];
129
-
88
+ _useState2 = _slicedToArray(_useState, 2),
89
+ channels = _useState2[0],
90
+ setChannels = _useState2[1];
130
91
  var _useState3 = (0, _react.useState)(false),
131
- _useState4 = _slicedToArray(_useState3, 2),
132
- loading = _useState4[0],
133
- setLoading = _useState4[1];
134
-
92
+ _useState4 = _slicedToArray(_useState3, 2),
93
+ loading = _useState4[0],
94
+ setLoading = _useState4[1];
135
95
  var _useState5 = (0, _react.useState)(_utils2.DEFAULT_ACTIVE),
136
- _useState6 = _slicedToArray(_useState5, 2),
137
- activeIndex = _useState6[0],
138
- setActiveIndex = _useState6[1];
139
-
96
+ _useState6 = _slicedToArray(_useState5, 2),
97
+ activeIndex = _useState6[0],
98
+ setActiveIndex = _useState6[1];
140
99
  var _useState7 = (0, _react.useState)(-1),
141
- _useState8 = _slicedToArray(_useState7, 2),
142
- timeLinePosition = _useState8[0],
143
- setTimeLinePosition = _useState8[1];
144
-
145
- var panelRef = (0, _react.useRef)(); // 全屏方法
146
-
100
+ _useState8 = _slicedToArray(_useState7, 2),
101
+ timeLinePosition = _useState8[0],
102
+ setTimeLinePosition = _useState8[1];
103
+ var panelRef = (0, _react.useRef)();
104
+ // 全屏方法
147
105
  var wrapRef = (0, _react.useRef)(null);
148
-
149
106
  var _useFullscreen = (0, _ahooks.useFullscreen)(wrapRef),
150
- _useFullscreen2 = _slicedToArray(_useFullscreen, 2),
151
- isFullscreen = _useFullscreen2[0],
152
- toggleFullscreen = _useFullscreen2[1].toggleFullscreen;
153
-
107
+ _useFullscreen2 = _slicedToArray(_useFullscreen, 2),
108
+ isFullscreen = _useFullscreen2[0],
109
+ toggleFullscreen = _useFullscreen2[1].toggleFullscreen;
154
110
  var _useRequest = (0, _ahooks.useRequest)(_api.getHistoryUrl, {
155
- manual: true
156
- }),
157
- runAsync = _useRequest.runAsync;
158
-
111
+ manual: true
112
+ }),
113
+ runAsync = _useRequest.runAsync;
159
114
  var _useRequest2 = (0, _ahooks.useRequest)(_api.getVideoLabelById, {
160
- manual: true
161
- }),
162
- getVideoLabelByIdAsync = _useRequest2.runAsync;
163
-
115
+ manual: true
116
+ }),
117
+ getVideoLabelByIdAsync = _useRequest2.runAsync;
164
118
  (0, _react.useImperativeHandle)(ref, function () {
165
119
  return {
166
120
  load: function load(channel) {
@@ -169,75 +123,63 @@ var HistoryControlV2 = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
169
123
  start: function start(playInfo) {
170
124
  return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
171
125
  var _a, _b, _c, result, labelRes, res, newChannels, resultChannel, channelIndex;
172
-
173
126
  return _regeneratorRuntime().wrap(function _callee$(_context) {
174
- while (1) {
175
- switch (_context.prev = _context.next) {
176
- case 0:
177
- setLoading(true);
178
- result = playInfo;
179
-
180
- if (!playInfo.tagId) {
181
- _context.next = 10;
182
- break;
183
- }
184
-
185
- _context.next = 5;
186
- return getVideoLabelByIdAsync({
187
- id: playInfo.tagId
127
+ while (1) switch (_context.prev = _context.next) {
128
+ case 0:
129
+ setLoading(true);
130
+ result = playInfo;
131
+ if (!playInfo.tagId) {
132
+ _context.next = 10;
133
+ break;
134
+ }
135
+ _context.next = 5;
136
+ return getVideoLabelByIdAsync({
137
+ id: playInfo.tagId
138
+ });
139
+ case 5:
140
+ labelRes = _context.sent;
141
+ result.deviceId = labelRes.videoDeviceId || playInfo.deviceId;
142
+ result.channelNum = labelRes.videoChannelNum || playInfo.channelNum;
143
+ result.beginTime = labelRes.startTime || playInfo.beginTime;
144
+ result.endTime = labelRes.endTime || playInfo.endTime;
145
+ case 10:
146
+ _context.next = 12;
147
+ return runAsync({
148
+ deviceId: result.deviceId,
149
+ channelNum: result.channelNum,
150
+ beginTime: result.beginTime,
151
+ endTime: result.endTime,
152
+ protocol: result.protocol,
153
+ token: (0, _utils.getUrlParam)('token')
154
+ });
155
+ case 12:
156
+ res = _context.sent;
157
+ newChannels = _toConsumableArray(channels);
158
+ resultChannel = (_a = newChannels.filter(function (citem) {
159
+ return citem.deviceId === res.deviceId && citem.channelNum === res.channelNum;
160
+ })) === null || _a === void 0 ? void 0 : _a[0]; // 如果当前通道已经再里面了,则直接替换当前通道
161
+ if (resultChannel) {
162
+ newChannels[resultChannel.channelIndex] = Object.assign(Object.assign({}, newChannels[resultChannel.channelIndex]), {
163
+ // 有tagId 则为-1 不然维持原有的
164
+ index: playInfo.tagId ? -1 : newChannels[resultChannel.channelIndex].index,
165
+ tagId: playInfo.tagId || '',
166
+ startTime: result.beginTime,
167
+ endTime: result.endTime
188
168
  });
189
-
190
- case 5:
191
- labelRes = _context.sent;
192
- result.deviceId = labelRes.videoDeviceId || playInfo.deviceId;
193
- result.channelNum = labelRes.videoChannelNum || playInfo.channelNum;
194
- result.beginTime = labelRes.startTime || playInfo.beginTime;
195
- result.endTime = labelRes.endTime || playInfo.endTime;
196
-
197
- case 10:
198
- _context.next = 12;
199
- return runAsync({
200
- deviceId: result.deviceId,
201
- channelNum: result.channelNum,
202
- beginTime: result.beginTime,
203
- endTime: result.endTime,
204
- protocol: result.protocol,
205
- token: (0, _utils.getUrlParam)('token')
206
- });
207
-
208
- case 12:
209
- res = _context.sent;
210
- newChannels = _toConsumableArray(channels);
211
- resultChannel = (_a = newChannels.filter(function (citem) {
212
- return citem.deviceId === res.deviceId && citem.channelNum === res.channelNum;
213
- })) === null || _a === void 0 ? void 0 : _a[0]; // 如果当前通道已经再里面了,则直接替换当前通道
214
-
215
- if (resultChannel) {
216
- newChannels[resultChannel.channelIndex] = Object.assign(Object.assign({}, newChannels[resultChannel.channelIndex]), {
217
- // 有tagId 则为-1 不然维持原有的
218
- index: playInfo.tagId ? -1 : newChannels[resultChannel.channelIndex].index,
219
- tagId: playInfo.tagId || '',
220
- startTime: result.beginTime,
221
- endTime: result.endTime
222
- });
223
- } else {
224
- // 如果当前通道不在里面 则找到第一个channelNum为''的替换
225
- channelIndex = (_c = (_b = newChannels.filter(function (item) {
226
- return item.channelNum === '';
227
- })) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.channelIndex;
228
-
229
- if (typeof channelIndex == 'number') {
230
- newChannels[channelIndex] = Object.assign(Object.assign({}, newChannels[channelIndex]), (0, _utils2.getChannelData)(res, result));
231
- }
169
+ } else {
170
+ // 如果当前通道不在里面 则找到第一个channelNum为''的替换
171
+ channelIndex = (_c = (_b = newChannels.filter(function (item) {
172
+ return item.channelNum === '';
173
+ })) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.channelIndex;
174
+ if (typeof channelIndex == 'number') {
175
+ newChannels[channelIndex] = Object.assign(Object.assign({}, newChannels[channelIndex]), (0, _utils2.getChannelData)(res, result));
232
176
  }
233
-
234
- setChannels(newChannels);
235
- setLoading(false);
236
-
237
- case 18:
238
- case "end":
239
- return _context.stop();
240
- }
177
+ }
178
+ setChannels(newChannels);
179
+ setLoading(false);
180
+ case 18:
181
+ case "end":
182
+ return _context.stop();
241
183
  }
242
184
  }, _callee);
243
185
  }));
@@ -245,14 +187,12 @@ var HistoryControlV2 = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
245
187
  unLoadAll: handleCloseAll
246
188
  };
247
189
  });
248
-
249
190
  var handleExpand = function handleExpand() {
250
191
  onExpandChange && onExpandChange(!state.expand);
251
192
  setState({
252
193
  expand: !state.expand
253
194
  });
254
195
  };
255
-
256
196
  var handleCloseAll = function handleCloseAll() {
257
197
  // const realChannels = channels.filter((item) => item.channelNum !== '');
258
198
  // realChannels.map((item) => {
@@ -261,10 +201,8 @@ var HistoryControlV2 = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
261
201
  onVideoCloseAll();
262
202
  setChannels(_utils2.DEFAULT_CHANNELS);
263
203
  };
264
-
265
204
  var getGridItems = function getGridItems() {
266
205
  var items = [];
267
-
268
206
  var _loop = function _loop(i) {
269
207
  var element = (0, _jsxRuntime.jsx)(_gridItem["default"], {
270
208
  active: activeIndex === i,
@@ -276,9 +214,7 @@ var HistoryControlV2 = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
276
214
  channel: channels[i],
277
215
  onClose: function onClose() {
278
216
  var _a;
279
-
280
217
  var newChannels = _toConsumableArray(channels);
281
-
282
218
  newChannels[i].index = -1;
283
219
  newChannels[i].deviceName = '';
284
220
  newChannels[i].deviceId = '';
@@ -304,14 +240,11 @@ var HistoryControlV2 = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
304
240
  }, i);
305
241
  items.push(element);
306
242
  };
307
-
308
243
  for (var i = 0; i < Number(state.grid); i++) {
309
244
  _loop(i);
310
245
  }
311
-
312
246
  return items;
313
247
  };
314
-
315
248
  var store = {
316
249
  channels: channels,
317
250
  setChannels: setChannels,
@@ -332,11 +265,9 @@ var HistoryControlV2 = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
332
265
  }).length) || 1
333
266
  });
334
267
  }
335
-
336
268
  var realChannels = channels.filter(function (item) {
337
269
  return item.channelNum !== '';
338
270
  });
339
-
340
271
  if (typeof onPlayingChannelChange === 'function') {
341
272
  onPlayingChannelChange(realChannels);
342
273
  }