@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.
- package/README.md +2 -2
- package/lib/api/fetch.js +62 -91
- package/lib/api/fetch.js.map +1 -1
- package/lib/api/index.js +18 -63
- package/lib/api/index.js.map +1 -1
- package/lib/api/types.d.ts +5 -5
- package/lib/bd/PlayerManager.js +38 -68
- package/lib/bd/PlayerManager.js.map +1 -1
- package/lib/bill-player/index.d.ts +1 -1
- package/lib/bill-player/index.js +66 -121
- package/lib/bill-player/index.js.map +1 -1
- package/lib/bill-player/style/css.js +0 -9
- package/lib/bill-player/style/css.js.map +1 -1
- package/lib/bill-player/style/index.js +0 -9
- package/lib/bill-player/style/index.js.map +1 -1
- package/lib/bill-player/style/index.less +297 -297
- package/lib/components/set-tag-video/index.js +6 -34
- package/lib/components/set-tag-video/index.js.map +1 -1
- package/lib/components/set-tag-video/style/css.js.map +1 -1
- package/lib/components/set-tag-video/style/index.js.map +1 -1
- package/lib/components/set-tag-video/style/index.less +125 -125
- package/lib/components/split-screen/index.d.ts +1 -1
- package/lib/components/split-screen/index.js +3 -14
- package/lib/components/split-screen/index.js.map +1 -1
- package/lib/components/split-screen/style/css.js.map +1 -1
- package/lib/components/split-screen/style/index.js.map +1 -1
- package/lib/components/tag-video/index.js +10 -38
- package/lib/components/tag-video/index.js.map +1 -1
- package/lib/components/tag-video/style/css.js.map +1 -1
- package/lib/components/tag-video/style/index.js.map +1 -1
- package/lib/components/tag-video/style/index.less +69 -69
- package/lib/components/video-scale/index.d.ts +1 -1
- package/lib/components/video-scale/index.js +2 -9
- package/lib/components/video-scale/index.js.map +1 -1
- package/lib/components/video-scale/style/css.js.map +1 -1
- package/lib/components/video-scale/style/index.js.map +1 -1
- package/lib/context/index.js +0 -4
- package/lib/context/index.js.map +1 -1
- package/lib/controls/index.d.ts +11 -11
- package/lib/controls/index.js +34 -99
- package/lib/controls/index.js.map +1 -1
- package/lib/controls/style/css.js +0 -5
- package/lib/controls/style/css.js.map +1 -1
- package/lib/controls/style/index.js +0 -5
- package/lib/controls/style/index.js.map +1 -1
- package/lib/controls/style/index.less +188 -188
- package/lib/h264/PlayerManager.js +18 -27
- package/lib/h264/PlayerManager.js.map +1 -1
- package/lib/history-control/index.d.ts +2 -2
- package/lib/history-control/index.js +61 -121
- package/lib/history-control/index.js.map +1 -1
- package/lib/history-control/style/css.js +0 -6
- package/lib/history-control/style/css.js.map +1 -1
- package/lib/history-control/style/index.js +0 -6
- package/lib/history-control/style/index.js.map +1 -1
- package/lib/history-control/style/index.less +252 -252
- package/lib/history-control-v2/components/grid-item/index.js +38 -77
- package/lib/history-control-v2/components/grid-item/index.js.map +1 -1
- package/lib/history-control-v2/components/panel/index.js +44 -114
- package/lib/history-control-v2/components/panel/index.js.map +1 -1
- package/lib/history-control-v2/context.js +0 -2
- package/lib/history-control-v2/context.js.map +1 -1
- package/lib/history-control-v2/index.d.ts +4 -4
- package/lib/history-control-v2/index.js +97 -166
- package/lib/history-control-v2/index.js.map +1 -1
- package/lib/history-control-v2/style/css.js +0 -10
- package/lib/history-control-v2/style/css.js.map +1 -1
- package/lib/history-control-v2/style/index.js +0 -10
- package/lib/history-control-v2/style/index.js.map +1 -1
- package/lib/history-control-v2/style/index.less +437 -437
- package/lib/history-control-v2/utils.js +1 -21
- package/lib/history-control-v2/utils.js.map +1 -1
- package/lib/history-player/index.d.ts +1 -1
- package/lib/history-player/index.js +146 -205
- package/lib/history-player/index.js.map +1 -1
- package/lib/history-player/style/css.js +0 -3
- package/lib/history-player/style/css.js.map +1 -1
- package/lib/history-player/style/index.js +0 -3
- package/lib/history-player/style/index.js.map +1 -1
- package/lib/history-player/style/index.less +102 -102
- package/lib/hooks/useSettings.js +1 -6
- package/lib/hooks/useSettings.js.map +1 -1
- package/lib/icc/PlayerManager.js +26 -57
- package/lib/icc/PlayerManager.js.map +1 -1
- package/lib/icc/api.d.ts +0 -68
- package/lib/icc/api.js +2 -16
- package/lib/icc/api.js.map +1 -1
- package/lib/icons/index.d.ts +36 -36
- package/lib/icons/index.js +23 -171
- package/lib/icons/index.js.map +1 -1
- package/lib/icons/index.less +32 -32
- package/lib/index.js +0 -10
- package/lib/index.js.map +1 -1
- package/lib/live-channel-player/index.d.ts +1 -1
- package/lib/live-channel-player/index.js +31 -67
- package/lib/live-channel-player/index.js.map +1 -1
- package/lib/live-channel-player/style/css.js +0 -1
- package/lib/live-channel-player/style/css.js.map +1 -1
- package/lib/live-channel-player/style/index.js +0 -1
- package/lib/live-channel-player/style/index.js.map +1 -1
- package/lib/live-control/index.d.ts +2 -2
- package/lib/live-control/index.js +35 -86
- package/lib/live-control/index.js.map +1 -1
- package/lib/live-control/style/css.js +0 -4
- package/lib/live-control/style/css.js.map +1 -1
- package/lib/live-control/style/index.js +0 -4
- package/lib/live-control/style/index.js.map +1 -1
- package/lib/live-control/style/index.less +99 -99
- package/lib/live-control-v2/index.d.ts +3 -3
- package/lib/live-control-v2/index.js +108 -141
- package/lib/live-control-v2/index.js.map +1 -1
- package/lib/live-control-v2/style/css.js +0 -7
- package/lib/live-control-v2/style/css.js.map +1 -1
- package/lib/live-control-v2/style/index.js +0 -7
- package/lib/live-control-v2/style/index.js.map +1 -1
- package/lib/live-control-v2/style/index.less +192 -192
- package/lib/live-player/index.js +95 -136
- package/lib/live-player/index.js.map +1 -1
- package/lib/live-player/style/css.js +0 -2
- package/lib/live-player/style/css.js.map +1 -1
- package/lib/live-player/style/index.js +0 -2
- package/lib/live-player/style/index.js.map +1 -1
- package/lib/live-player/style/index.less +75 -75
- package/lib/player/index.d.ts +1 -1
- package/lib/player/index.js +79 -244
- package/lib/player/index.js.map +1 -1
- package/lib/rsl/PlayerManager.js +18 -64
- package/lib/rsl/PlayerManager.js.map +1 -1
- package/lib/typings/@vtx/utils/index.d.ts +28 -28
- package/lib/typings/h5player.d.ts +146 -146
- package/lib/typings/webrtcplayer.d.ts +56 -56
- package/lib/typings/wsplayer.d.ts +99 -99
- package/lib/utils/index.d.ts +1 -1
- package/lib/utils/index.js +12 -91
- package/lib/utils/index.js.map +1 -1
- package/lib/vite-env.d.ts +1 -1
- package/lib/vtxHls/PlayerManager.js +6 -20
- package/lib/vtxHls/PlayerManager.js.map +1 -1
- package/lib/vtxHls/WhepManager.js +9 -72
- package/lib/vtxHls/WhepManager.js.map +1 -1
- package/lib/webrtc/PlayerManager.js +28 -41
- package/lib/webrtc/PlayerManager.js.map +1 -1
- package/package.json +125 -125
|
@@ -1,57 +1,35 @@
|
|
|
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.HistoryPlayer = void 0;
|
|
9
|
-
|
|
10
8
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
-
|
|
12
9
|
var _react = require("react");
|
|
13
|
-
|
|
14
10
|
var _controls = require("../controls");
|
|
15
|
-
|
|
16
11
|
var _api = _interopRequireDefault(require("../icc/api"));
|
|
17
|
-
|
|
18
12
|
var _icons = require("../icons");
|
|
19
|
-
|
|
20
13
|
var _player = _interopRequireDefault(require("../player"));
|
|
21
|
-
|
|
22
14
|
var _utils = require("../utils");
|
|
23
|
-
|
|
24
15
|
var _ahooks = require("ahooks");
|
|
25
|
-
|
|
26
16
|
var _slider = _interopRequireDefault(require("antd/lib/slider"));
|
|
27
|
-
|
|
28
17
|
var _space = _interopRequireDefault(require("antd/lib/space"));
|
|
29
|
-
|
|
30
18
|
var _moment = _interopRequireDefault(require("moment"));
|
|
31
|
-
|
|
32
19
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
33
|
-
|
|
34
|
-
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; }
|
|
35
|
-
|
|
20
|
+
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; }
|
|
36
21
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
37
|
-
|
|
38
22
|
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."); }
|
|
39
|
-
|
|
40
23
|
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); }
|
|
41
|
-
|
|
42
|
-
function
|
|
43
|
-
|
|
44
|
-
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; }
|
|
45
|
-
|
|
24
|
+
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; }
|
|
25
|
+
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; } }
|
|
46
26
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
47
|
-
|
|
48
27
|
var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
|
|
49
28
|
function adopt(value) {
|
|
50
29
|
return value instanceof P ? value : new P(function (resolve) {
|
|
51
30
|
resolve(value);
|
|
52
31
|
});
|
|
53
32
|
}
|
|
54
|
-
|
|
55
33
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
56
34
|
function fulfilled(value) {
|
|
57
35
|
try {
|
|
@@ -60,7 +38,6 @@ var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P
|
|
|
60
38
|
reject(e);
|
|
61
39
|
}
|
|
62
40
|
}
|
|
63
|
-
|
|
64
41
|
function rejected(value) {
|
|
65
42
|
try {
|
|
66
43
|
step(generator["throw"](value));
|
|
@@ -68,79 +45,75 @@ var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P
|
|
|
68
45
|
reject(e);
|
|
69
46
|
}
|
|
70
47
|
}
|
|
71
|
-
|
|
72
48
|
function step(result) {
|
|
73
49
|
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
74
50
|
}
|
|
75
|
-
|
|
76
51
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
77
52
|
});
|
|
78
53
|
};
|
|
79
54
|
|
|
55
|
+
// import { Slider, Space } from 'antd';
|
|
56
|
+
|
|
80
57
|
var HistoryPlayer = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
81
58
|
var url = props.url,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
59
|
+
deviceId = props.deviceId,
|
|
60
|
+
deviceIp = props.deviceIp,
|
|
61
|
+
devicePort = props.devicePort,
|
|
62
|
+
channelNum = props.channelNum,
|
|
63
|
+
deviceCode = props.deviceCode,
|
|
64
|
+
streamType = props.streamType,
|
|
65
|
+
type = props.type,
|
|
66
|
+
enableAgent = props.enableAgent,
|
|
67
|
+
_props$width = props.width,
|
|
68
|
+
width = _props$width === void 0 ? '100%' : _props$width,
|
|
69
|
+
_props$height = props.height,
|
|
70
|
+
height = _props$height === void 0 ? '100%' : _props$height,
|
|
71
|
+
captureName = props.captureName,
|
|
72
|
+
_props$controlBottom = props.controlBottom,
|
|
73
|
+
controlBottom = _props$controlBottom === void 0 ? 0 : _props$controlBottom,
|
|
74
|
+
startTime = props.startTime,
|
|
75
|
+
endTime = props.endTime,
|
|
76
|
+
onTimeChange = props.onTimeChange,
|
|
77
|
+
screenshot = props.screenshot,
|
|
78
|
+
_props$showInfo = props.showInfo,
|
|
79
|
+
showInfo = _props$showInfo === void 0 ? false : _props$showInfo,
|
|
80
|
+
_props$info = props.info,
|
|
81
|
+
info = _props$info === void 0 ? [] : _props$info,
|
|
82
|
+
extraButton = props.extraButton,
|
|
83
|
+
_props$controlVisible = props.controlVisible,
|
|
84
|
+
controlVisible = _props$controlVisible === void 0 ? undefined : _props$controlVisible;
|
|
108
85
|
var vRef = (0, _react.useRef)(null);
|
|
109
86
|
var totalTime = (0, _moment["default"])(endTime).diff((0, _moment["default"])(startTime), 'seconds');
|
|
110
87
|
var containerRef = (0, _react.useRef)(null);
|
|
111
88
|
var wrapRef = (0, _react.useRef)(null);
|
|
112
89
|
var controlsRef = (0, _react.useRef)(null);
|
|
113
90
|
var playerRef = (0, _react.useRef)();
|
|
114
|
-
|
|
115
91
|
var _useFullscreen = (0, _ahooks.useFullscreen)(wrapRef),
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
92
|
+
_useFullscreen2 = _slicedToArray(_useFullscreen, 2),
|
|
93
|
+
isFullscreen = _useFullscreen2[0],
|
|
94
|
+
toggleFullscreen = _useFullscreen2[1].toggleFullscreen;
|
|
120
95
|
var _useSetState = (0, _ahooks.useSetState)({
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
96
|
+
play: false,
|
|
97
|
+
error: false,
|
|
98
|
+
loading: false,
|
|
99
|
+
id: 'vtx_hk_player_' + (0, _utils.guidGenerator)(),
|
|
100
|
+
volume: 0,
|
|
101
|
+
currentTime: '',
|
|
102
|
+
progress: 0,
|
|
103
|
+
progress2: 0,
|
|
104
|
+
controls: {
|
|
105
|
+
progress: true
|
|
106
|
+
},
|
|
107
|
+
progressVisible: true,
|
|
108
|
+
speedVisible: true
|
|
109
|
+
}),
|
|
110
|
+
_useSetState2 = _slicedToArray(_useSetState, 2),
|
|
111
|
+
state = _useSetState2[0],
|
|
112
|
+
setState = _useSetState2[1];
|
|
139
113
|
(0, _react.useImperativeHandle)(ref, function () {
|
|
140
114
|
return {
|
|
141
115
|
seekTo: function seekTo(time) {
|
|
142
116
|
var player = playerRef.current;
|
|
143
|
-
|
|
144
117
|
if (player) {
|
|
145
118
|
var currentTime = (0, _moment["default"])(time).diff((0, _moment["default"])(startTime), 'seconds');
|
|
146
119
|
return player.seekTo(currentTime);
|
|
@@ -152,137 +125,122 @@ var HistoryPlayer = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
152
125
|
});
|
|
153
126
|
(0, _react.useEffect)(function () {
|
|
154
127
|
var container = containerRef.current;
|
|
155
|
-
|
|
156
128
|
if (vRef.current) {
|
|
157
129
|
clearInterval(vRef.current);
|
|
158
130
|
vRef.current = null;
|
|
159
131
|
}
|
|
160
|
-
|
|
161
132
|
if (!url || !container) return;
|
|
162
133
|
var player = null;
|
|
163
|
-
|
|
164
134
|
(function () {
|
|
165
135
|
return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
166
136
|
var token;
|
|
167
137
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
168
|
-
while (1) {
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
if (!(type === 'bd')) {
|
|
172
|
-
_context.next = 3;
|
|
173
|
-
break;
|
|
174
|
-
}
|
|
175
|
-
|
|
138
|
+
while (1) switch (_context.prev = _context.next) {
|
|
139
|
+
case 0:
|
|
140
|
+
if (!(type === 'bd')) {
|
|
176
141
|
_context.next = 3;
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
progress:
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
142
|
+
break;
|
|
143
|
+
}
|
|
144
|
+
_context.next = 3;
|
|
145
|
+
return new Promise(function (resolve) {
|
|
146
|
+
setTimeout(function () {
|
|
147
|
+
return resolve('');
|
|
148
|
+
}, 2000);
|
|
149
|
+
});
|
|
150
|
+
case 3:
|
|
151
|
+
if (!(type === 'icc_ws')) {
|
|
152
|
+
_context.next = 8;
|
|
153
|
+
break;
|
|
154
|
+
}
|
|
155
|
+
_context.next = 6;
|
|
156
|
+
return _api["default"].getToken({
|
|
157
|
+
deviceId: deviceId
|
|
158
|
+
});
|
|
159
|
+
case 6:
|
|
160
|
+
token = _context.sent;
|
|
161
|
+
localStorage.setItem('accessToken', token);
|
|
162
|
+
case 8:
|
|
163
|
+
_context.next = 10;
|
|
164
|
+
return new _player["default"]({
|
|
165
|
+
url: url,
|
|
166
|
+
devicePort: devicePort,
|
|
167
|
+
deviceIp: deviceIp,
|
|
168
|
+
channelNum: channelNum,
|
|
169
|
+
deviceCode: deviceCode,
|
|
170
|
+
deviceId: deviceId,
|
|
171
|
+
streamType: streamType,
|
|
172
|
+
enableAgent: enableAgent,
|
|
173
|
+
container: container,
|
|
174
|
+
live: false,
|
|
175
|
+
startTime: startTime,
|
|
176
|
+
endTime: endTime,
|
|
177
|
+
type: type
|
|
178
|
+
});
|
|
179
|
+
case 10:
|
|
180
|
+
player = _context.sent;
|
|
181
|
+
playerRef.current = player;
|
|
182
|
+
_context.next = 14;
|
|
183
|
+
return setState({
|
|
184
|
+
loading: true,
|
|
185
|
+
error: false,
|
|
186
|
+
progress: 0,
|
|
187
|
+
controls: {
|
|
188
|
+
progress: player.type === 'hk_ws' || player.type === 'hkcar_ws'
|
|
189
|
+
},
|
|
190
|
+
progressVisible: player.type !== 'bd',
|
|
191
|
+
speedVisible: player.type !== 'bd'
|
|
192
|
+
});
|
|
193
|
+
case 14:
|
|
194
|
+
player.playBack().then(function () {
|
|
195
|
+
setState({
|
|
196
|
+
play: true,
|
|
197
|
+
currentTime: (0, _moment["default"])(startTime).format(_utils.TimeFormat.params)
|
|
229
198
|
});
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
199
|
+
var i = 1;
|
|
200
|
+
vRef.current = setInterval(function () {
|
|
201
|
+
// 当时间大于等于结束时间时重置
|
|
202
|
+
if ((0, _moment["default"])(startTime).add(i, 's').unix() >= (0, _moment["default"])(endTime).unix()) {
|
|
203
|
+
clearInterval(vRef.current);
|
|
204
|
+
vRef.current = null;
|
|
205
|
+
setState({
|
|
206
|
+
currentTime: '',
|
|
207
|
+
progress: 0
|
|
208
|
+
});
|
|
209
|
+
} else {
|
|
210
|
+
i++;
|
|
211
|
+
if (!state.loading) {
|
|
243
212
|
setState({
|
|
244
|
-
currentTime: '',
|
|
245
|
-
progress:
|
|
213
|
+
currentTime: (0, _moment["default"])(startTime).add(i, 's').format(_utils.TimeFormat.params),
|
|
214
|
+
progress: Math.floor(i * 100 / totalTime)
|
|
246
215
|
});
|
|
247
|
-
} else {
|
|
248
|
-
i++;
|
|
249
|
-
|
|
250
|
-
if (!state.loading) {
|
|
251
|
-
setState({
|
|
252
|
-
currentTime: (0, _moment["default"])(startTime).add(i, 's').format(_utils.TimeFormat.params),
|
|
253
|
-
progress: Math.floor(i * 100 / totalTime)
|
|
254
|
-
});
|
|
255
|
-
}
|
|
256
216
|
}
|
|
257
|
-
}, 1000);
|
|
258
|
-
})["catch"](function () {
|
|
259
|
-
return setState({
|
|
260
|
-
error: true
|
|
261
|
-
});
|
|
262
|
-
})["finally"](function () {
|
|
263
|
-
return setState({
|
|
264
|
-
loading: false
|
|
265
|
-
});
|
|
266
|
-
});
|
|
267
|
-
player.onTimeUpdate(function (_currentTime, speed) {
|
|
268
|
-
if (!state.loading) {
|
|
269
|
-
setState({
|
|
270
|
-
// currentTime: Math.floor(_currentTime),
|
|
271
|
-
// progress: Math.floor((_currentTime / totalTime) * 100),
|
|
272
|
-
speed: speed
|
|
273
|
-
});
|
|
274
217
|
}
|
|
218
|
+
}, 1000);
|
|
219
|
+
})["catch"](function () {
|
|
220
|
+
return setState({
|
|
221
|
+
error: true
|
|
275
222
|
});
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
223
|
+
})["finally"](function () {
|
|
224
|
+
return setState({
|
|
225
|
+
loading: false
|
|
226
|
+
});
|
|
227
|
+
});
|
|
228
|
+
player.onTimeUpdate(function (_currentTime, speed) {
|
|
229
|
+
if (!state.loading) {
|
|
230
|
+
setState({
|
|
231
|
+
// currentTime: Math.floor(_currentTime),
|
|
232
|
+
// progress: Math.floor((_currentTime / totalTime) * 100),
|
|
233
|
+
speed: speed
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
case 16:
|
|
238
|
+
case "end":
|
|
239
|
+
return _context.stop();
|
|
281
240
|
}
|
|
282
241
|
}, _callee);
|
|
283
242
|
}));
|
|
284
243
|
})();
|
|
285
|
-
|
|
286
244
|
return function () {
|
|
287
245
|
player.destroy();
|
|
288
246
|
setState({
|
|
@@ -290,7 +248,6 @@ var HistoryPlayer = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
290
248
|
loading: false,
|
|
291
249
|
play: false
|
|
292
250
|
});
|
|
293
|
-
|
|
294
251
|
if (vRef.current) {
|
|
295
252
|
clearInterval(vRef.current);
|
|
296
253
|
vRef.current = null;
|
|
@@ -314,15 +271,12 @@ var HistoryPlayer = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
314
271
|
});
|
|
315
272
|
}, [endProgress]);
|
|
316
273
|
/** 截图方法 */
|
|
317
|
-
|
|
318
274
|
var handleCapture = function handleCapture(e) {
|
|
319
275
|
var player = playerRef.current;
|
|
320
276
|
player && player.capture(captureName, screenshot);
|
|
321
277
|
e.stopPropagation();
|
|
322
278
|
};
|
|
323
279
|
/** 全屏方法 */
|
|
324
|
-
|
|
325
|
-
|
|
326
280
|
var handleFullScreen = function handleFullScreen(e) {
|
|
327
281
|
toggleFullscreen();
|
|
328
282
|
var player = playerRef.current;
|
|
@@ -330,14 +284,11 @@ var HistoryPlayer = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
330
284
|
e.stopPropagation();
|
|
331
285
|
};
|
|
332
286
|
/** 进度条控制器 */
|
|
333
|
-
|
|
334
|
-
|
|
335
287
|
var handleSlider = function handleSlider(value) {
|
|
336
288
|
if (vRef.current) {
|
|
337
289
|
clearInterval(vRef.current);
|
|
338
290
|
vRef.current = null;
|
|
339
291
|
}
|
|
340
|
-
|
|
341
292
|
var currentTime = Math.floor(totalTime * value / 100);
|
|
342
293
|
setState({
|
|
343
294
|
progress2: value,
|
|
@@ -362,8 +313,6 @@ var HistoryPlayer = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
362
313
|
}, 1000);
|
|
363
314
|
};
|
|
364
315
|
/** 暂停方法 */
|
|
365
|
-
|
|
366
|
-
|
|
367
316
|
var handlePause = function handlePause() {
|
|
368
317
|
var player = playerRef.current;
|
|
369
318
|
player === null || player === void 0 ? void 0 : player.pause(function () {
|
|
@@ -371,15 +320,12 @@ var HistoryPlayer = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
371
320
|
play: false
|
|
372
321
|
});
|
|
373
322
|
});
|
|
374
|
-
|
|
375
323
|
if (vRef.current) {
|
|
376
324
|
clearInterval(vRef.current);
|
|
377
325
|
vRef.current = null;
|
|
378
326
|
}
|
|
379
327
|
};
|
|
380
328
|
/** 恢复播放方法 */
|
|
381
|
-
|
|
382
|
-
|
|
383
329
|
var handleResume = function handleResume() {
|
|
384
330
|
var player = playerRef.current;
|
|
385
331
|
player === null || player === void 0 ? void 0 : player.resume(function () {
|
|
@@ -387,16 +333,13 @@ var HistoryPlayer = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
387
333
|
play: true
|
|
388
334
|
});
|
|
389
335
|
});
|
|
390
|
-
|
|
391
336
|
if (vRef.current) {
|
|
392
337
|
clearInterval(vRef.current);
|
|
393
338
|
vRef.current = null;
|
|
394
339
|
}
|
|
395
|
-
|
|
396
340
|
if (type === 'bd') {
|
|
397
341
|
return;
|
|
398
342
|
}
|
|
399
|
-
|
|
400
343
|
var i = 2;
|
|
401
344
|
vRef.current = setInterval(function () {
|
|
402
345
|
if ((0, _moment["default"])(state.currentTime).unix() + i >= (0, _moment["default"])(endTime).unix()) {
|
|
@@ -407,7 +350,6 @@ var HistoryPlayer = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
407
350
|
progress: 0
|
|
408
351
|
});
|
|
409
352
|
}
|
|
410
|
-
|
|
411
353
|
if (!state.loading) {
|
|
412
354
|
setState({
|
|
413
355
|
currentTime: (0, _moment["default"])(state.currentTime).add(i, 's').format(_utils.TimeFormat.params),
|
|
@@ -417,7 +359,6 @@ var HistoryPlayer = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
417
359
|
}
|
|
418
360
|
}, 1000);
|
|
419
361
|
};
|
|
420
|
-
|
|
421
362
|
return (0, _jsxRuntime.jsxs)("div", Object.assign({
|
|
422
363
|
className: "vtx-history-player",
|
|
423
364
|
ref: wrapRef,
|