@cloud-app-dev/vidc 4.0.17 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.dumirc.ts +1 -1
- package/.eslintrc.js +3 -0
- package/.fatherrc.ts +0 -6
- package/es/AppContext/Sync.d.ts +7 -0
- package/es/AppContext/Sync.js +44 -0
- package/es/AppContext/index.d.ts +17 -0
- package/es/AppContext/index.js +154 -0
- package/es/AppContext/interface.d.ts +42 -0
- package/es/AppContext/static.d.ts +8 -0
- package/es/AppContext/static.js +9 -0
- package/es/CheckGroupFixed/demo.d.ts +2 -0
- package/es/CheckGroupFixed/demo.js +20 -0
- package/es/CheckGroupFixed/index.d.ts +22 -0
- package/es/CheckGroupFixed/index.js +150 -0
- package/es/CheckGroupFixed/style.d.ts +6 -0
- package/es/CheckGroupFixed/style.js +9 -0
- package/es/Config/index.d.ts +4 -0
- package/es/Config/index.js +77 -0
- package/es/Config/interface.d.ts +65 -0
- package/es/Config/utils.d.ts +4 -0
- package/es/Config/utils.js +33 -0
- package/es/CustomRenderSelect/index.d.ts +13 -0
- package/es/CustomRenderSelect/index.js +86 -0
- package/es/DBTools/index.d.ts +25 -0
- package/es/DBTools/index.js +336 -0
- package/es/DisableMark/index.d.ts +8 -0
- package/es/DisableMark/index.js +25 -0
- package/es/DomMove/demo.d.ts +1 -0
- package/es/DomMove/demo.js +19 -0
- package/es/DomMove/index.d.ts +16 -0
- package/es/DomMove/index.js +148 -0
- package/es/DomMove/utils.d.ts +8 -0
- package/es/DomMove/utils.js +33 -0
- package/es/Drag/DragAndDropItem.d.ts +4 -0
- package/es/Drag/DragAndDropItem.js +133 -0
- package/es/Drag/DropItem.d.ts +4 -0
- package/es/Drag/DropItem.js +50 -0
- package/es/Drag/index.d.ts +7 -0
- package/es/Drag/index.js +7 -0
- package/es/Drag/interface.d.ts +16 -0
- package/es/DynamicGridList/demo.d.ts +2 -0
- package/es/DynamicGridList/demo.js +86 -0
- package/es/DynamicGridList/index.d.ts +27 -0
- package/es/DynamicGridList/index.js +71 -0
- package/es/DynamicList/demo.d.ts +1 -0
- package/es/DynamicList/demo.js +45 -0
- package/es/DynamicList/index.d.ts +30 -0
- package/es/DynamicList/index.js +98 -0
- package/es/DynamicList/interface.d.ts +19 -0
- package/es/DynamicList/utils.d.ts +4 -0
- package/es/DynamicList/utils.js +6 -0
- package/es/ErrorFallback/index.d.ts +8 -0
- package/es/ErrorFallback/index.js +38 -0
- package/es/ErrorFallback/inerface.d.ts +48 -0
- package/es/EventTools/index.d.ts +3 -0
- package/es/EventTools/index.js +12 -0
- package/es/FrontendPlayer/index.d.ts +4 -0
- package/es/FrontendPlayer/index.js +2 -0
- package/es/GridList/data.d.ts +16 -0
- package/es/GridList/data.js +609 -0
- package/es/GridList/demo.d.ts +2 -0
- package/es/GridList/demo.js +89 -0
- package/es/GridList/hook.d.ts +13 -0
- package/es/GridList/hook.js +270 -0
- package/es/GridList/index.d.ts +14 -0
- package/es/GridList/index.js +51 -0
- package/es/GridList/interface.d.ts +59 -0
- package/es/GridList/utils.d.ts +9 -0
- package/es/GridList/utils.js +42 -0
- package/es/HightLevel/index.d.ts +8 -0
- package/es/HightLevel/index.js +20 -0
- package/es/IconFont/index.d.ts +12 -0
- package/es/IconFont/index.js +63 -0
- package/es/InstanceHistory/index.d.ts +3 -0
- package/es/InstanceHistory/index.js +7 -0
- package/es/LabelValue/index.d.ts +14 -0
- package/es/LabelValue/index.js +35 -0
- package/es/List/demo.d.ts +2 -0
- package/es/List/demo.js +25 -0
- package/es/List/index.d.ts +27 -0
- package/es/List/index.js +38 -0
- package/es/ListWithSizeAnimate/demo.d.ts +1 -0
- package/es/ListWithSizeAnimate/demo.js +128 -0
- package/es/ListWithSizeAnimate/index.d.ts +13 -0
- package/es/ListWithSizeAnimate/index.js +106 -0
- package/es/LoaderScript/index.d.ts +47 -0
- package/es/LoaderScript/index.js +38 -0
- package/es/LoaderScript/utils.d.ts +13 -0
- package/es/LoaderScript/utils.js +179 -0
- package/es/Picture/component/DefaultRects/RectInfo.d.ts +7 -0
- package/es/Picture/component/DefaultRects/RectInfo.js +90 -0
- package/es/Picture/component/DefaultRects/index.d.ts +11 -0
- package/es/Picture/component/DefaultRects/index.js +58 -0
- package/es/Picture/component/DefaultRects/style.d.ts +10 -0
- package/es/Picture/component/DefaultRects/style.js +28 -0
- package/es/Picture/component/DefaultRects/utils.d.ts +2 -0
- package/es/Picture/component/DefaultRects/utils.js +11 -0
- package/es/Picture/component/DrawRect/index.d.ts +11 -0
- package/es/Picture/component/DrawRect/index.js +54 -0
- package/es/Picture/component/RectMenu/index.d.ts +10 -0
- package/es/Picture/component/RectMenu/index.js +84 -0
- package/es/Picture/component/RectMenu/utils.d.ts +12 -0
- package/es/Picture/component/RectMenu/utils.js +19 -0
- package/es/Picture/component/Tools/index.d.ts +11 -0
- package/es/Picture/component/Tools/index.js +105 -0
- package/es/Picture/component/Tools/style.d.ts +2 -0
- package/es/Picture/component/Tools/style.js +5 -0
- package/es/Picture/component/WheelScale/index.d.ts +6 -0
- package/es/Picture/component/WheelScale/index.js +29 -0
- package/es/Picture/demo.d.ts +1 -0
- package/es/Picture/demo.js +114 -0
- package/es/Picture/index.d.ts +17 -0
- package/es/Picture/index.js +356 -0
- package/es/Picture/interface.d.ts +196 -0
- package/es/Picture/loadCaptureRectImage.d.ts +3 -0
- package/es/Picture/loadCaptureRectImage.js +99 -0
- package/es/Picture/useDraw.d.ts +1 -0
- package/es/Picture/useDraw.js +103 -0
- package/es/Picture/utils.d.ts +26 -0
- package/es/Picture/utils.js +143 -0
- package/es/Player/api/index.d.ts +68 -0
- package/es/Player/api/index.js +309 -0
- package/es/Player/context.d.ts +21 -0
- package/es/Player/context.js +25 -0
- package/es/Player/contraller_bar/bar.d.ts +8 -0
- package/es/Player/contraller_bar/bar.js +32 -0
- package/es/Player/contraller_bar/contraller_event.d.ts +6 -0
- package/es/Player/contraller_bar/contraller_event.js +52 -0
- package/es/Player/contraller_bar/index.d.ts +13 -0
- package/es/Player/contraller_bar/index.js +39 -0
- package/es/Player/contraller_bar/left_bar.d.ts +10 -0
- package/es/Player/contraller_bar/left_bar.js +97 -0
- package/es/Player/contraller_bar/right_bar.d.ts +8 -0
- package/es/Player/contraller_bar/right_bar.js +36 -0
- package/es/Player/contraller_bar/time.d.ts +2 -0
- package/es/Player/contraller_bar/time.js +24 -0
- package/es/Player/contraller_bar/useBarStatus.d.ts +2 -0
- package/es/Player/contraller_bar/useBarStatus.js +43 -0
- package/es/Player/contraller_bar/volume.d.ts +8 -0
- package/es/Player/contraller_bar/volume.js +70 -0
- package/es/Player/demo.d.ts +2 -0
- package/es/Player/demo.js +289 -0
- package/es/Player/empty.d.ts +1 -0
- package/es/Player/empty.js +5 -0
- package/es/Player/event/errorEvent.d.ts +14 -0
- package/es/Player/event/errorEvent.js +88 -0
- package/es/Player/event/eventName.d.ts +18 -0
- package/es/Player/event/eventName.js +30 -0
- package/es/Player/event/index.d.ts +24 -0
- package/es/Player/event/index.js +205 -0
- package/es/Player/fps_play.d.ts +10 -0
- package/es/Player/fps_play.js +88 -0
- package/es/Player/frontend_player.d.ts +7 -0
- package/es/Player/frontend_player.js +71 -0
- package/es/Player/frontend_timeline.d.ts +8 -0
- package/es/Player/frontend_timeline.js +153 -0
- package/es/Player/iconfont.d.ts +4 -0
- package/es/Player/iconfont.js +21 -0
- package/es/Player/index.d.ts +2 -0
- package/es/Player/index.js +2 -0
- package/es/Player/live_heart.d.ts +8 -0
- package/es/Player/live_heart.js +45 -0
- package/es/Player/message.d.ts +3 -0
- package/es/Player/message.js +147 -0
- package/es/Player/player.d.ts +233 -0
- package/es/Player/segment_player.d.ts +8 -0
- package/es/Player/segment_player.js +229 -0
- package/es/Player/segment_timeline.d.ts +10 -0
- package/es/Player/segment_timeline.js +200 -0
- package/es/Player/single_player.d.ts +4 -0
- package/es/Player/single_player.js +278 -0
- package/es/Player/style/iconfont.js +43 -0
- package/es/Player/timeline.d.ts +7 -0
- package/es/Player/timeline.js +104 -0
- package/es/Player/util.d.ts +43 -0
- package/es/Player/util.js +189 -0
- package/es/PlayerExt/demo.d.ts +2 -0
- package/es/PlayerExt/demo.js +170 -0
- package/es/PlayerExt/index.d.ts +47 -0
- package/es/PlayerExt/index.js +212 -0
- package/es/Progress/index.d.ts +10 -0
- package/es/Progress/index.js +60 -0
- package/es/ROI/demo.d.ts +2 -0
- package/es/ROI/demo.js +17 -0
- package/es/ROI/index.d.ts +32 -0
- package/es/ROI/index.js +67 -0
- package/es/RefDrawer/Footer.d.ts +9 -0
- package/es/RefDrawer/Footer.js +27 -0
- package/es/RefDrawer/demo.d.ts +3 -0
- package/es/RefDrawer/demo.js +32 -0
- package/es/RefDrawer/index.d.ts +26 -0
- package/es/RefDrawer/index.js +73 -0
- package/es/RefModal/demo.d.ts +2 -0
- package/es/RefModal/demo.js +32 -0
- package/es/RefModal/index.d.ts +17 -0
- package/es/RefModal/index.js +71 -0
- package/es/ScreenPlayer/Live.d.ts +8 -0
- package/es/ScreenPlayer/Live.js +219 -0
- package/es/ScreenPlayer/LiveTools.d.ts +33 -0
- package/es/ScreenPlayer/LiveTools.js +172 -0
- package/es/ScreenPlayer/PlayerWithExt.d.ts +34 -0
- package/es/ScreenPlayer/PlayerWithExt.js +241 -0
- package/es/ScreenPlayer/RatePick.d.ts +7 -0
- package/es/ScreenPlayer/RatePick.js +35 -0
- package/es/ScreenPlayer/Record.d.ts +8 -0
- package/es/ScreenPlayer/Record.js +452 -0
- package/es/ScreenPlayer/RecordTools.d.ts +38 -0
- package/es/ScreenPlayer/RecordTools.js +214 -0
- package/es/ScreenPlayer/ScreenSelect.d.ts +6 -0
- package/es/ScreenPlayer/ScreenSelect.js +59 -0
- package/es/ScreenPlayer/SegmentTimeLine.d.ts +16 -0
- package/es/ScreenPlayer/SegmentTimeLine.js +44 -0
- package/es/ScreenPlayer/TimeMode.d.ts +6 -0
- package/es/ScreenPlayer/TimeMode.js +34 -0
- package/es/ScreenPlayer/TimeSelect.d.ts +6 -0
- package/es/ScreenPlayer/TimeSelect.js +99 -0
- package/es/ScreenPlayer/containerStyle.d.ts +13 -0
- package/es/ScreenPlayer/containerStyle.js +32 -0
- package/es/ScreenPlayer/demo.d.ts +1 -0
- package/es/ScreenPlayer/demo.js +19 -0
- package/es/ScreenPlayer/demo2.d.ts +1 -0
- package/es/ScreenPlayer/demo2.js +196 -0
- package/es/ScreenPlayer/index.d.ts +6 -0
- package/es/ScreenPlayer/index.js +9 -0
- package/es/ScreenPlayer/interface.d.ts +216 -0
- package/es/ScreenPlayer/useTimeSlider.d.ts +25 -0
- package/es/ScreenPlayer/useTimeSlider.js +451 -0
- package/es/ScreenPlayer/useVideoFit.d.ts +5 -0
- package/es/ScreenPlayer/useVideoFit.js +35 -0
- package/es/ScreenPlayer/utils.d.ts +17 -0
- package/es/ScreenPlayer/utils.js +85 -0
- package/es/SegmentPlayer/index.d.ts +2 -0
- package/es/SegmentPlayer/index.js +2 -0
- package/es/Service/http.d.ts +6 -0
- package/es/Service/http.js +125 -0
- package/es/Service/index.d.ts +3 -0
- package/es/Service/index.js +10 -0
- package/es/Service/interface.d.ts +22 -0
- package/es/Service/middleware.d.ts +5 -0
- package/es/Service/middleware.js +15 -0
- package/es/SocketEmitter/eventEmitter.d.ts +27 -0
- package/es/SocketEmitter/eventEmitter.js +88 -0
- package/es/SocketEmitter/index.d.ts +24 -0
- package/es/SocketEmitter/index.js +125 -0
- package/es/SocketEmitter/interface.d.ts +4 -0
- package/es/TableLayout/index.d.ts +9 -0
- package/es/TableLayout/index.js +32 -0
- package/es/Timeout/index.d.ts +31 -0
- package/es/Timeout/index.js +69 -0
- package/es/cache/index.d.ts +34 -0
- package/es/cache/index.js +94 -0
- package/es/copy/index.d.ts +1 -0
- package/es/copy/index.js +9 -0
- package/es/core.d.ts +0 -0
- package/es/getThemeStyle/index.d.ts +2 -0
- package/es/getThemeStyle/index.js +5 -0
- package/es/index.d.ts +52 -0
- package/es/index.js +52 -0
- package/es/likeGo/index.d.ts +2 -0
- package/es/likeGo/index.js +31 -0
- package/es/likeGoSync/index.d.ts +2 -0
- package/es/likeGoSync/index.js +10 -0
- package/es/logger/index.d.ts +7 -0
- package/es/logger/index.js +30 -0
- package/es/nextTick/index.d.ts +1 -0
- package/es/nextTick/index.js +3 -0
- package/es/recorder/demo.d.ts +2 -0
- package/es/recorder/demo.js +200 -0
- package/es/recorder/index.d.ts +294 -0
- package/es/recorder/index.js +991 -0
- package/es/submidstr/index.d.ts +5 -0
- package/es/submidstr/index.js +14 -0
- package/es/treeHelper/index.d.ts +11 -0
- package/es/treeHelper/index.js +189 -0
- package/es/typings.d.ts +2 -0
- package/es/useDrawROI/index.d.ts +16 -0
- package/es/useDrawROI/index.js +318 -0
- package/es/useEventEmitterHandle/index.d.ts +2 -0
- package/es/useEventEmitterHandle/index.js +17 -0
- package/es/useHistory/index.d.ts +3 -0
- package/es/useHistory/index.js +9 -0
- package/es/useHistory/interface.d.ts +3 -0
- package/es/useInfiniteScroll/index.d.ts +16 -0
- package/es/useInfiniteScroll/index.js +102 -0
- package/es/useRafInterval/index.d.ts +5 -0
- package/es/useRafInterval/index.js +70 -0
- package/es/useSimpleState/index.d.ts +3 -0
- package/es/useSimpleState/index.js +35 -0
- package/es/useVirtualList/index.d.ts +13 -0
- package/es/useVirtualList/index.js +136 -0
- package/es/utils.d.ts +14 -0
- package/es/utils.js +46 -0
- package/es/uuid/index.d.ts +5 -0
- package/es/uuid/index.js +6 -0
- package/package.json +16 -21
- package/release-build.sh +2 -0
- package/scripts/{entry.js → entry.mjs} +4 -6
- package/{icon-fix.js → scripts/icon-fix.mjs} +4 -3
- package/tsconfig.json +1 -1
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
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; }
|
|
3
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
4
|
+
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."); }
|
|
5
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
6
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
7
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
8
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
9
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
10
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
11
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
12
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
13
|
+
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; } }
|
|
14
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
15
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
16
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
17
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
18
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
19
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
20
|
+
import { DatePicker } from 'antd';
|
|
21
|
+
import moment from 'dayjs';
|
|
22
|
+
import { useMemo, useState } from 'react';
|
|
23
|
+
import Service from "../Service";
|
|
24
|
+
import RecordPlayer from "./Record";
|
|
25
|
+
import { completionSegments } from "./utils";
|
|
26
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
27
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
28
|
+
var token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjp7InBhc3N3b3JkIjpudWxsLCJ1c2VybmFtZSI6Inh1d2VpY2hhbzEiLCJhdXRob3JpdGllcyI6W3siYXV0aG9yaXR5IjoiMTU3MDk1Nzk5NTE2MzcxNyJ9XSwiYWNjb3VudE5vbkV4cGlyZWQiOnRydWUsImFjY291bnROb25Mb2NrZWQiOnRydWUsImNyZWRlbnRpYWxzTm9uRXhwaXJlZCI6dHJ1ZSwiZW5hYmxlZCI6dHJ1ZSwiYWNjb3VudElkIjoxNTcwOTU3OTk2MTc5NTI1LCJzaWduSW5UeXBlIjoic3lzdGVtX3VzZXIiLCJzeXN0ZW1JZCI6MTU3MDk1Nzk5NDA0OTYwNSwidXNlcklkIjoxNTcwOTU3OTk2NjIxODkzLCJ1c2VyVHlwZSI6Miwib3JnSWQiOiIxMDA5IiwidXNlckdyYWRlIjo5OX0sInVzZXJfbmFtZSI6Inh1d2VpY2hhbzEiLCJzY29wZSI6WyJzeXN0ZW1fdXNlcl9yb2xlIl0sImV4cCI6MTY4Nzk1ODcwNywiYXV0aG9yaXRpZXMiOlsiMTU3MDk1Nzk5NTE2MzcxNyJdLCJqdGkiOiJkYmZhM2FhNS04YzRhLTRhZGQtOGFjNS1iMWVlZjllMjcwODgiLCJjbGllbnRfaWQiOiJzeXN0ZW1fdXNlcjoxNTcwOTU3OTk2NjIxODkzIn0.m0vP-mkaDeeKXcBuFwRfCXEfHoRjvNiHmD0-OWVxBec";
|
|
29
|
+
var cids = ['100000020', '100000014'];
|
|
30
|
+
var query = function query(_ref) {
|
|
31
|
+
var cid = _ref.cid,
|
|
32
|
+
date = _ref.date;
|
|
33
|
+
var m = moment(date);
|
|
34
|
+
var beginTime = m.set('hours', 0).set('minutes', 0).set('seconds', 0).unix();
|
|
35
|
+
var endTime = m.set('hours', 23).set('minutes', 59).set('seconds', 59).unix();
|
|
36
|
+
var promise = Service.http({
|
|
37
|
+
method: 'post',
|
|
38
|
+
url: "/api/community-manage-server/baseDevice/video/v1/historyVideo?authorization=".concat(token),
|
|
39
|
+
data: {
|
|
40
|
+
cid: cid,
|
|
41
|
+
beginTime: beginTime,
|
|
42
|
+
endTime: endTime
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
return promise.then(function (res) {
|
|
46
|
+
return completionSegments(beginTime, endTime, res.data).map(function (v) {
|
|
47
|
+
return _objectSpread(_objectSpread({}, v), {}, {
|
|
48
|
+
beginTime: v.beginTime * 1000,
|
|
49
|
+
endTime: v.endTime * 1000
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
}).catch(function (e) {
|
|
53
|
+
console.error(e);
|
|
54
|
+
alert('未获取到录像');
|
|
55
|
+
return Promise.reject();
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
export default function App() {
|
|
59
|
+
var _useState = useState({
|
|
60
|
+
list: [],
|
|
61
|
+
idx: 0
|
|
62
|
+
}),
|
|
63
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
64
|
+
state = _useState2[0],
|
|
65
|
+
setState = _useState2[1];
|
|
66
|
+
var value = useMemo(function () {
|
|
67
|
+
var _state$list$state$idx;
|
|
68
|
+
return state.list[state.idx] ? moment((_state$list$state$idx = state.list[state.idx]) === null || _state$list$state$idx === void 0 ? void 0 : _state$list$state$idx.date).set('hours', 0).set('minutes', 0).set('seconds', 0) : undefined;
|
|
69
|
+
}, [state.list, state.idx]);
|
|
70
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
71
|
+
style: {
|
|
72
|
+
width: '100%'
|
|
73
|
+
},
|
|
74
|
+
children: [/*#__PURE__*/_jsx(DatePicker, {
|
|
75
|
+
value: value,
|
|
76
|
+
onChange: /*#__PURE__*/function () {
|
|
77
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(v) {
|
|
78
|
+
var list, flag, cid, date, item, segments;
|
|
79
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
80
|
+
while (1) switch (_context.prev = _context.next) {
|
|
81
|
+
case 0:
|
|
82
|
+
list = _toConsumableArray(state.list);
|
|
83
|
+
flag = state.idx % 2 === 0;
|
|
84
|
+
cid = flag ? cids[0] : cids[1];
|
|
85
|
+
date = v === null || v === void 0 ? void 0 : v.set('hours', 0).set('minutes', 0).set('seconds', 0).valueOf();
|
|
86
|
+
item = {
|
|
87
|
+
date: date,
|
|
88
|
+
cid: cid,
|
|
89
|
+
type: 'hls',
|
|
90
|
+
recordType: 1,
|
|
91
|
+
loading: true
|
|
92
|
+
};
|
|
93
|
+
list[state.idx] = item;
|
|
94
|
+
setState(function (old) {
|
|
95
|
+
return _objectSpread(_objectSpread({}, old), {}, {
|
|
96
|
+
list: list
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
_context.next = 9;
|
|
100
|
+
return query(item);
|
|
101
|
+
case 9:
|
|
102
|
+
segments = _context.sent;
|
|
103
|
+
item.loading = false;
|
|
104
|
+
item.segments = segments;
|
|
105
|
+
list[state.idx] = item;
|
|
106
|
+
setState(function (old) {
|
|
107
|
+
return _objectSpread(_objectSpread({}, old), {}, {
|
|
108
|
+
list: _toConsumableArray(list)
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
case 14:
|
|
112
|
+
case "end":
|
|
113
|
+
return _context.stop();
|
|
114
|
+
}
|
|
115
|
+
}, _callee);
|
|
116
|
+
}));
|
|
117
|
+
return function (_x2) {
|
|
118
|
+
return _ref2.apply(this, arguments);
|
|
119
|
+
};
|
|
120
|
+
}()
|
|
121
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
122
|
+
style: {
|
|
123
|
+
height: 600,
|
|
124
|
+
width: '100%'
|
|
125
|
+
},
|
|
126
|
+
children: /*#__PURE__*/_jsx(RecordPlayer, {
|
|
127
|
+
list: state.list,
|
|
128
|
+
onIndexChange: function onIndexChange(idx) {
|
|
129
|
+
return setState(function (old) {
|
|
130
|
+
return _objectSpread(_objectSpread({}, old), {}, {
|
|
131
|
+
idx: idx
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
},
|
|
135
|
+
onTimeLineChange: /*#__PURE__*/function () {
|
|
136
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(date) {
|
|
137
|
+
var item, _state$list$state$idx2, segments;
|
|
138
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
139
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
140
|
+
case 0:
|
|
141
|
+
item = state.list[state.idx];
|
|
142
|
+
if (!state.list[state.idx]) {
|
|
143
|
+
_context2.next = 10;
|
|
144
|
+
break;
|
|
145
|
+
}
|
|
146
|
+
state.list[state.idx].loading = true;
|
|
147
|
+
setState(function (old) {
|
|
148
|
+
return _objectSpread(_objectSpread({}, old), {}, {
|
|
149
|
+
list: _toConsumableArray(state.list)
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
_context2.next = 6;
|
|
153
|
+
return query({
|
|
154
|
+
cid: item.cid,
|
|
155
|
+
date: date,
|
|
156
|
+
recordType: 1
|
|
157
|
+
});
|
|
158
|
+
case 6:
|
|
159
|
+
segments = _context2.sent;
|
|
160
|
+
state.list[state.idx].loading = false;
|
|
161
|
+
state.list[state.idx].segments = [].concat(_toConsumableArray(segments), _toConsumableArray((_state$list$state$idx2 = state.list[state.idx].segments) !== null && _state$list$state$idx2 !== void 0 ? _state$list$state$idx2 : []));
|
|
162
|
+
setState(function (old) {
|
|
163
|
+
return _objectSpread(_objectSpread({}, old), {}, {
|
|
164
|
+
list: _toConsumableArray(state.list)
|
|
165
|
+
});
|
|
166
|
+
});
|
|
167
|
+
case 10:
|
|
168
|
+
case "end":
|
|
169
|
+
return _context2.stop();
|
|
170
|
+
}
|
|
171
|
+
}, _callee2);
|
|
172
|
+
}));
|
|
173
|
+
return function (_x3) {
|
|
174
|
+
return _ref3.apply(this, arguments);
|
|
175
|
+
};
|
|
176
|
+
}(),
|
|
177
|
+
onClose: function onClose() {
|
|
178
|
+
var list = state.list;
|
|
179
|
+
list[state.idx] = undefined;
|
|
180
|
+
setState(function (old) {
|
|
181
|
+
return _objectSpread(_objectSpread({}, old), {}, {
|
|
182
|
+
list: _toConsumableArray(list)
|
|
183
|
+
});
|
|
184
|
+
});
|
|
185
|
+
},
|
|
186
|
+
onCloseAll: function onCloseAll() {
|
|
187
|
+
return setState(function (old) {
|
|
188
|
+
return _objectSpread(_objectSpread({}, old), {}, {
|
|
189
|
+
list: []
|
|
190
|
+
});
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
})
|
|
194
|
+
})]
|
|
195
|
+
});
|
|
196
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const Sceenplayer: {
|
|
3
|
+
LivePlayer: import("react").ForwardRefExoticComponent<import("./interface").ILivePlayerProps & import("react").RefAttributes<any>>;
|
|
4
|
+
RecordPlayer: import("react").ForwardRefExoticComponent<import("./interface").IRecordPlayerProps & import("react").RefAttributes<any>>;
|
|
5
|
+
};
|
|
6
|
+
export default Sceenplayer;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { withErrorBoundary } from 'react-error-boundary';
|
|
2
|
+
import LivePlayer from "./Live";
|
|
3
|
+
import RecordPlayer from "./Record";
|
|
4
|
+
import { errorBoundaryOptions } from "../ErrorFallback";
|
|
5
|
+
var Sceenplayer = {
|
|
6
|
+
LivePlayer: withErrorBoundary(LivePlayer, errorBoundaryOptions),
|
|
7
|
+
RecordPlayer: withErrorBoundary(RecordPlayer, errorBoundaryOptions)
|
|
8
|
+
};
|
|
9
|
+
export default Sceenplayer;
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { ExportPlayerType, ISegmentType } from '../Player/player';
|
|
3
|
+
import type { PlayModeType } from '../PlayerExt';
|
|
4
|
+
|
|
5
|
+
export type RecordItem = {
|
|
6
|
+
type?: 'flv' | 'hls' | 'native';
|
|
7
|
+
date?: number; //视频窗口日期
|
|
8
|
+
endDate?: number;
|
|
9
|
+
cid?: string;
|
|
10
|
+
segments?: ISegmentType[];
|
|
11
|
+
url?: string;
|
|
12
|
+
recordType?: 1 | 2; //1云录像 2前端录像
|
|
13
|
+
mode?: PlayModeType;
|
|
14
|
+
loading?: boolean; // 录像获取状态
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export interface IRecordPlayerProps {
|
|
18
|
+
/**
|
|
19
|
+
* 播放对象
|
|
20
|
+
*/
|
|
21
|
+
list?: RecordItem[];
|
|
22
|
+
children?: JSX.Element;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* 窗口索引变化,后续基于索引传入播放必要数据
|
|
26
|
+
*/
|
|
27
|
+
onIndexChange?: (idx: number) => void;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* 关闭单个窗口
|
|
31
|
+
*/
|
|
32
|
+
onClose?: () => void;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* 关闭所有窗口
|
|
36
|
+
*/
|
|
37
|
+
onCloseAll?: () => void;
|
|
38
|
+
/**
|
|
39
|
+
* 录像下载回调
|
|
40
|
+
*/
|
|
41
|
+
download?: (segments: ISegmentType[]) => void;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* 截图
|
|
45
|
+
*/
|
|
46
|
+
snapshot?: (base64: string) => void;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* 窗口变化
|
|
50
|
+
*/
|
|
51
|
+
screenChange?: (num: number) => void;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* 默认窗口数量
|
|
55
|
+
*/
|
|
56
|
+
defaultScreen?: 1 | 4 | 6 | 9 | 16;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* 窗口数量,若有值数量将由外部控制
|
|
60
|
+
*/
|
|
61
|
+
screenNum?: 1 | 4 | 6 | 9 | 16;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* 默认选中窗口
|
|
65
|
+
* @default 0
|
|
66
|
+
*/
|
|
67
|
+
defaultSelectIndex?: number;
|
|
68
|
+
/**
|
|
69
|
+
* 单窗口拓展工具条,左侧
|
|
70
|
+
*/
|
|
71
|
+
oneWinExtTools?: JSX.Element;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* 全局窗口工具条,右侧
|
|
75
|
+
*/
|
|
76
|
+
allWinExtTools?: JSX.Element;
|
|
77
|
+
|
|
78
|
+
fpsDelay?: number;
|
|
79
|
+
fps?: number;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* 自定义合成前端录像
|
|
83
|
+
*/
|
|
84
|
+
getLocalRecordUrl?: (options: { url: URL; begin: number; end: number; screenIndex: number }) => Promise<string>;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* 插件下载地址
|
|
88
|
+
*/
|
|
89
|
+
pluginDownloadUrl?: string;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* 轴发生变化
|
|
93
|
+
*/
|
|
94
|
+
onTimeLineChange?: (time: number) => void;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* 用户控制seek频率
|
|
98
|
+
*/
|
|
99
|
+
seekLoading?: boolean;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* 控制播放倍数数组
|
|
103
|
+
*/
|
|
104
|
+
multipleList?: number[];
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export interface IRecordPlayerState {
|
|
108
|
+
/**
|
|
109
|
+
* 窗口数量
|
|
110
|
+
*/
|
|
111
|
+
screenNum: number;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* 当前窗口索引
|
|
115
|
+
*/
|
|
116
|
+
selectIndex: number;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* 插件OR浏览器
|
|
120
|
+
*/
|
|
121
|
+
modes: { [key: string]: PlayModeType };
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* 时间轴开始时间
|
|
125
|
+
*/
|
|
126
|
+
currentTimes: { [key: string]: number };
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
*
|
|
130
|
+
*/
|
|
131
|
+
begins: { [key: string]: number };
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* 需要seek的时间针对当前窗口,为0时忽略
|
|
135
|
+
*/
|
|
136
|
+
seekTo?: { [key: string]: number };
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* 录像时间轴单页绘制时长单位(hour)
|
|
140
|
+
*/
|
|
141
|
+
timeMode: number;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export type ScreenItemLivePlayerType = {
|
|
145
|
+
url?: string;
|
|
146
|
+
type?: 'flv' | 'hls' | 'native';
|
|
147
|
+
mode?: PlayModeType;
|
|
148
|
+
cid?: string;
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
export interface ILivePlayerProps {
|
|
152
|
+
list?: ScreenItemLivePlayerType[];
|
|
153
|
+
children?: JSX.Element;
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* 关闭单个窗口
|
|
157
|
+
*/
|
|
158
|
+
onClose?: () => void;
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* 关闭所有窗口
|
|
162
|
+
*/
|
|
163
|
+
onCloseAll?: () => void;
|
|
164
|
+
/**
|
|
165
|
+
* 窗口索引变化,后续基于索引传入播放必要数据
|
|
166
|
+
*/
|
|
167
|
+
onIndexChange?: (idx: number) => void;
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* 截图
|
|
171
|
+
*/
|
|
172
|
+
snapshot?: (base64: string) => void;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* 窗口变化
|
|
176
|
+
*/
|
|
177
|
+
screenChange?: (num: number) => void;
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* 默认窗口数量
|
|
181
|
+
*/
|
|
182
|
+
defaultScreen?: 1 | 4 | 6 | 9 | 16;
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* 窗口数量,若有值由外部来完全控制
|
|
186
|
+
*/
|
|
187
|
+
screenNum?: 1 | 4 | 6 | 9 | 16;
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* 默认选中窗口
|
|
191
|
+
* @default 0
|
|
192
|
+
*/
|
|
193
|
+
defaultSelectIndex?: number;
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* 单窗口拓展工具条,左侧
|
|
197
|
+
*/
|
|
198
|
+
oneWinExtTools?: JSX.Element;
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* 全局窗口工具条,右侧
|
|
202
|
+
*/
|
|
203
|
+
allWinExtTools?: JSX.Element;
|
|
204
|
+
|
|
205
|
+
pluginDownloadUrl?: string;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export interface ILivePlayerState {
|
|
209
|
+
screenNum: number;
|
|
210
|
+
selectIndex: number;
|
|
211
|
+
modes: { [key: string]: PlayModeType };
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
export const RecordPlayer: React.FC<IRecordPlayerProps>;
|
|
215
|
+
|
|
216
|
+
export type PlayItemMapType = { [key: string]: React.MutableRefObject<ExportPlayerType> };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { ISegmentType } from '../Player/player';
|
|
3
|
+
export interface ITimeSliderOptions {
|
|
4
|
+
hoursPer: number;
|
|
5
|
+
begin: number;
|
|
6
|
+
segments?: TimeCellItem[];
|
|
7
|
+
currentTime: number;
|
|
8
|
+
onTimeChange: (options: {
|
|
9
|
+
currentTime?: number;
|
|
10
|
+
begin?: number;
|
|
11
|
+
}, outTimeline?: boolean) => void;
|
|
12
|
+
onHoursPerChange: (hour: number) => void;
|
|
13
|
+
}
|
|
14
|
+
export type ITimeSliderState = {
|
|
15
|
+
hoursPer: number;
|
|
16
|
+
begin: number;
|
|
17
|
+
currentTime: number;
|
|
18
|
+
hover: {
|
|
19
|
+
x?: number;
|
|
20
|
+
time?: number;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export type TimeCellItem = ISegmentType;
|
|
24
|
+
declare function useTimeSlider(canvasRef: React.RefObject<HTMLCanvasElement>, { hoursPer, begin, currentTime, segments, onTimeChange, onHoursPerChange }: ITimeSliderOptions): void;
|
|
25
|
+
export default useTimeSlider;
|