@cloud-app-dev/vidc 3.0.5 → 3.0.8
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/es/DisableMark/index.css +9 -0
- package/es/DisableMark/index.d.ts +8 -0
- package/es/DisableMark/index.js +9 -0
- package/es/Player/live_heart.js +7 -32
- package/es/ScreenPlayer/Live.d.ts +1 -1
- package/es/ScreenPlayer/Live.js +13 -3
- package/es/ScreenPlayer/LiveTools.d.ts +3 -1
- package/es/ScreenPlayer/LiveTools.js +7 -3
- package/es/ScreenPlayer/Record.d.ts +1 -1
- package/es/ScreenPlayer/Record.js +42 -13
- package/es/ScreenPlayer/RecordTools.d.ts +6 -1
- package/es/ScreenPlayer/RecordTools.js +20 -5
- package/es/ScreenPlayer/SegmentTimeLine.d.ts +5 -2
- package/es/ScreenPlayer/SegmentTimeLine.js +29 -11
- package/es/ScreenPlayer/TimeMode.d.ts +7 -0
- package/es/ScreenPlayer/TimeMode.js +23 -0
- package/es/ScreenPlayer/TimeSelect.js +0 -1
- package/es/ScreenPlayer/TimeSlider.d.ts +3 -1
- package/es/ScreenPlayer/TimeSlider.js +35 -16
- package/es/ScreenPlayer/demo.js +2 -1
- package/es/ScreenPlayer/index.css +22 -4
- package/es/ScreenPlayer/interface.d.ts +33 -0
- package/es/ScreenPlayer/utils.d.ts +3 -0
- package/es/ScreenPlayer/utils.js +9 -0
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import "./index.css";
|
|
3
|
+
export default function DisableMark(_ref) {
|
|
4
|
+
var children = _ref.children,
|
|
5
|
+
disabled = _ref.disabled;
|
|
6
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, disabled ? /*#__PURE__*/React.createElement("div", {
|
|
7
|
+
className: "disable-mark"
|
|
8
|
+
}) : null, children);
|
|
9
|
+
}
|
package/es/Player/live_heart.js
CHANGED
|
@@ -1,28 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
|
-
|
|
5
|
-
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."); }
|
|
6
|
-
|
|
7
|
-
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); }
|
|
8
|
-
|
|
9
|
-
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; }
|
|
10
|
-
|
|
11
|
-
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; }
|
|
12
|
-
|
|
13
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
-
|
|
15
|
-
import React, { useEffect, useState } from 'react';
|
|
1
|
+
import _useRafInterval from "ahooks/es/useRafInterval";
|
|
2
|
+
import React, { useEffect } from 'react';
|
|
16
3
|
import BrowserTab from './event/browserTabEvent';
|
|
17
4
|
|
|
18
5
|
function LiveHeart(_ref) {
|
|
19
6
|
var api = _ref.api;
|
|
20
7
|
|
|
21
|
-
var _useState = useState(Date.now()),
|
|
22
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
23
|
-
runDep = _useState2[0],
|
|
24
|
-
setRundep = _useState2[1];
|
|
25
|
-
|
|
26
8
|
var run = function run() {
|
|
27
9
|
var current = api.getCurrentTime();
|
|
28
10
|
var buffered = api.getSecondsLoaded();
|
|
@@ -30,6 +12,7 @@ function LiveHeart(_ref) {
|
|
|
30
12
|
if (buffered - current > 5) {
|
|
31
13
|
console.debug("\u5F53\u524D\u5EF6\u65F6\u8FC7\u5927current->".concat(current, " buffered->").concat(buffered, ", \u57FA\u4E8E\u89C6\u9891\u5F53\u524D\u7F13\u5B58\u65F6\u95F4\u66F4\u65B0\u5F53\u524D\u64AD\u653E\u65F6\u95F4 updateTime -> ").concat(buffered - 2));
|
|
32
14
|
api.seekTo(buffered - 2 > 0 ? buffered - 2 : 0);
|
|
15
|
+
api.play();
|
|
33
16
|
}
|
|
34
17
|
};
|
|
35
18
|
|
|
@@ -41,21 +24,13 @@ function LiveHeart(_ref) {
|
|
|
41
24
|
BrowserTab.addEventListener(browserTabChange);
|
|
42
25
|
return function () {
|
|
43
26
|
BrowserTab.removeEventListener(browserTabChange);
|
|
44
|
-
};
|
|
27
|
+
}; // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
45
28
|
}, [api]);
|
|
46
29
|
|
|
47
|
-
|
|
48
|
-
run();
|
|
49
|
-
},
|
|
30
|
+
_useRafInterval(function () {
|
|
31
|
+
return run();
|
|
32
|
+
}, 30 * 1000);
|
|
50
33
|
|
|
51
|
-
useEffect(function () {
|
|
52
|
-
var timer = setInterval(function () {
|
|
53
|
-
return setRundep(Date.now());
|
|
54
|
-
}, 30 * 1000);
|
|
55
|
-
return function () {
|
|
56
|
-
return clearInterval(timer);
|
|
57
|
-
};
|
|
58
|
-
}, []);
|
|
59
34
|
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
60
35
|
}
|
|
61
36
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { ILivePlayerProps } from './interface';
|
|
3
3
|
import './index.less';
|
|
4
|
-
declare function LivePlayer({ list, children }: ILivePlayerProps): JSX.Element;
|
|
4
|
+
declare function LivePlayer({ list, children, onIndexChange, onClose, onCloseAll }: ILivePlayerProps): JSX.Element;
|
|
5
5
|
export default LivePlayer;
|
package/es/ScreenPlayer/Live.js
CHANGED
|
@@ -10,7 +10,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
10
10
|
|
|
11
11
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
12
|
|
|
13
|
-
import React, { useMemo, useRef, useState } from 'react';
|
|
13
|
+
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
14
14
|
import { ScreenType, mergeFill } from './utils';
|
|
15
15
|
import { LivePlayerWithExt } from './PlayerWithExt';
|
|
16
16
|
import Tools from './LiveTools';
|
|
@@ -20,7 +20,10 @@ import "./index.css";
|
|
|
20
20
|
function LivePlayer(_ref) {
|
|
21
21
|
var _ref$list = _ref.list,
|
|
22
22
|
list = _ref$list === void 0 ? [] : _ref$list,
|
|
23
|
-
children = _ref.children
|
|
23
|
+
children = _ref.children,
|
|
24
|
+
onIndexChange = _ref.onIndexChange,
|
|
25
|
+
onClose = _ref.onClose,
|
|
26
|
+
onCloseAll = _ref.onCloseAll;
|
|
24
27
|
|
|
25
28
|
var _useState = useState({
|
|
26
29
|
screenNum: 4,
|
|
@@ -73,8 +76,13 @@ function LivePlayer(_ref) {
|
|
|
73
76
|
setState(function (old) {
|
|
74
77
|
return Object.assign(Object.assign({}, old), obj);
|
|
75
78
|
});
|
|
76
|
-
};
|
|
79
|
+
}; // index变化同步到父组件
|
|
80
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
77
81
|
|
|
82
|
+
|
|
83
|
+
useEffect(function () {
|
|
84
|
+
return onIndexChange(state.selectIndex);
|
|
85
|
+
}, [state.selectIndex]);
|
|
78
86
|
return /*#__PURE__*/React.createElement("div", {
|
|
79
87
|
className: "split-screen-player-wrapper",
|
|
80
88
|
ref: domRef
|
|
@@ -102,6 +110,8 @@ function LivePlayer(_ref) {
|
|
|
102
110
|
}
|
|
103
111
|
}));
|
|
104
112
|
})), /*#__PURE__*/React.createElement(Tools, {
|
|
113
|
+
onClose: onClose,
|
|
114
|
+
onCloseAll: onCloseAll,
|
|
105
115
|
fit: fit,
|
|
106
116
|
toggleFit: toggleFit,
|
|
107
117
|
getPlayerItem: getPlayerItem,
|
|
@@ -12,6 +12,8 @@ interface IToolsProps {
|
|
|
12
12
|
getPlayerItem: () => ExportPlayerType | undefined;
|
|
13
13
|
fit?: string;
|
|
14
14
|
toggleFit?: () => void;
|
|
15
|
+
onClose?: () => void;
|
|
16
|
+
onCloseAll?: () => void;
|
|
15
17
|
}
|
|
16
|
-
declare function LiveTools({ containerRef, updateState, screenNum, getPlayerItem, mode, toggleFit, fit }: IToolsProps): JSX.Element;
|
|
18
|
+
declare function LiveTools({ containerRef, updateState, screenNum, getPlayerItem, mode, toggleFit, fit, onClose, onCloseAll }: IToolsProps): JSX.Element;
|
|
17
19
|
export default LiveTools;
|
|
@@ -24,7 +24,9 @@ function LiveTools(_ref) {
|
|
|
24
24
|
getPlayerItem = _ref.getPlayerItem,
|
|
25
25
|
mode = _ref.mode,
|
|
26
26
|
toggleFit = _ref.toggleFit,
|
|
27
|
-
fit = _ref.fit
|
|
27
|
+
fit = _ref.fit,
|
|
28
|
+
onClose = _ref.onClose,
|
|
29
|
+
onCloseAll = _ref.onCloseAll;
|
|
28
30
|
|
|
29
31
|
var _useFullscreen = _useFullscreen3(containerRef),
|
|
30
32
|
_useFullscreen2 = _slicedToArray(_useFullscreen, 2),
|
|
@@ -76,7 +78,8 @@ function LiveTools(_ref) {
|
|
|
76
78
|
type: "lm-player-Refresh_Main",
|
|
77
79
|
title: "\u91CD\u8F7D"
|
|
78
80
|
})), /*#__PURE__*/React.createElement("span", {
|
|
79
|
-
className: "player-tools-item"
|
|
81
|
+
className: "player-tools-item",
|
|
82
|
+
onClick: onClose
|
|
80
83
|
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
81
84
|
type: "lm-player-YesorNo_No_Dark",
|
|
82
85
|
title: "\u5173\u95ED\u5F53\u524D"
|
|
@@ -94,7 +97,8 @@ function LiveTools(_ref) {
|
|
|
94
97
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
95
98
|
className: "player-tools-right"
|
|
96
99
|
}, /*#__PURE__*/React.createElement("span", {
|
|
97
|
-
className: "player-tools-item"
|
|
100
|
+
className: "player-tools-item",
|
|
101
|
+
onClick: onCloseAll
|
|
98
102
|
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
99
103
|
type: "lm-player-YesorNo_No_Dark",
|
|
100
104
|
title: "\u5173\u95ED\u6240\u6709"
|
|
@@ -6,5 +6,5 @@ import './index.less';
|
|
|
6
6
|
* @param param0
|
|
7
7
|
* @returns
|
|
8
8
|
*/
|
|
9
|
-
declare function RecordPlayer({ list, children, queryRecord, onIndexChange }: IRecordPlayerProps): JSX.Element;
|
|
9
|
+
declare function RecordPlayer({ list, children, queryRecord, onIndexChange, onClose, onCloseAll }: IRecordPlayerProps): JSX.Element;
|
|
10
10
|
export default RecordPlayer;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
2
|
|
|
3
|
+
import "antd/lib/message/style";
|
|
4
|
+
import _message from "antd/lib/message";
|
|
3
5
|
import _usePrevious from "ahooks/es/usePrevious";
|
|
4
6
|
|
|
5
7
|
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; }
|
|
@@ -32,6 +34,7 @@ import RecordTools from './RecordTools';
|
|
|
32
34
|
import SegmentTimeLine from './SegmentTimeLine';
|
|
33
35
|
import useRecordList from './useRecordList';
|
|
34
36
|
import useVideoFit from './useVideoFit';
|
|
37
|
+
import DisableMark from '../DisableMark';
|
|
35
38
|
import "./index.css";
|
|
36
39
|
/**
|
|
37
40
|
* @desc 录像设计的时间全部需要到毫秒
|
|
@@ -45,7 +48,9 @@ function RecordPlayer(_ref) {
|
|
|
45
48
|
var list = _ref.list,
|
|
46
49
|
children = _ref.children,
|
|
47
50
|
queryRecord = _ref.queryRecord,
|
|
48
|
-
onIndexChange = _ref.onIndexChange
|
|
51
|
+
onIndexChange = _ref.onIndexChange,
|
|
52
|
+
onClose = _ref.onClose,
|
|
53
|
+
onCloseAll = _ref.onCloseAll;
|
|
49
54
|
|
|
50
55
|
var _useState = useState({
|
|
51
56
|
screenNum: 4,
|
|
@@ -54,7 +59,8 @@ function RecordPlayer(_ref) {
|
|
|
54
59
|
currentTimes: [],
|
|
55
60
|
loading: false,
|
|
56
61
|
seekTo: 0,
|
|
57
|
-
mergeSegments: []
|
|
62
|
+
mergeSegments: [],
|
|
63
|
+
timeMode: 24
|
|
58
64
|
}),
|
|
59
65
|
_useState2 = _slicedToArray(_useState, 2),
|
|
60
66
|
state = _useState2[0],
|
|
@@ -199,6 +205,10 @@ function RecordPlayer(_ref) {
|
|
|
199
205
|
obj.mode = newState.mode;
|
|
200
206
|
}
|
|
201
207
|
|
|
208
|
+
if (newState.hasOwnProperty('timeMode')) {
|
|
209
|
+
obj.timeMode = newState.timeMode;
|
|
210
|
+
}
|
|
211
|
+
|
|
202
212
|
setState(function (old) {
|
|
203
213
|
return Object.assign(Object.assign({}, old), obj);
|
|
204
214
|
});
|
|
@@ -210,7 +220,7 @@ function RecordPlayer(_ref) {
|
|
|
210
220
|
*/
|
|
211
221
|
|
|
212
222
|
|
|
213
|
-
var onTimeChange = useCallback(function (time) {
|
|
223
|
+
var onTimeChange = useCallback(function (time, outTimeline) {
|
|
214
224
|
return __awaiter(_this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
215
225
|
var index, segments;
|
|
216
226
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
@@ -225,23 +235,34 @@ function RecordPlayer(_ref) {
|
|
|
225
235
|
return _context.abrupt("return");
|
|
226
236
|
|
|
227
237
|
case 2:
|
|
238
|
+
if (!(outTimeline && segmentItem.recordType === 1)) {
|
|
239
|
+
_context.next = 5;
|
|
240
|
+
break;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
// 云录像 若点击了缺失的片段,直接忽略
|
|
244
|
+
_message.warning('当前录像片段缺失!');
|
|
245
|
+
|
|
246
|
+
return _context.abrupt("return");
|
|
247
|
+
|
|
248
|
+
case 5:
|
|
228
249
|
index = segmentItem.segments.findIndex(function (v) {
|
|
229
250
|
return time >= v.beginTime && time < v.endTime;
|
|
230
251
|
});
|
|
231
252
|
|
|
232
253
|
if (!(index === -1)) {
|
|
233
|
-
_context.next =
|
|
254
|
+
_context.next = 11;
|
|
234
255
|
break;
|
|
235
256
|
}
|
|
236
257
|
|
|
237
|
-
_context.next =
|
|
258
|
+
_context.next = 9;
|
|
238
259
|
return queryRecord({
|
|
239
260
|
cid: segmentItem.cid,
|
|
240
261
|
date: time,
|
|
241
262
|
recordType: segmentItem.recordType
|
|
242
263
|
});
|
|
243
264
|
|
|
244
|
-
case
|
|
265
|
+
case 9:
|
|
245
266
|
segments = _context.sent;
|
|
246
267
|
setState(function (old) {
|
|
247
268
|
return Object.assign(Object.assign({}, old), {
|
|
@@ -249,7 +270,7 @@ function RecordPlayer(_ref) {
|
|
|
249
270
|
});
|
|
250
271
|
});
|
|
251
272
|
|
|
252
|
-
case
|
|
273
|
+
case 11:
|
|
253
274
|
//更新time
|
|
254
275
|
setState(function (old) {
|
|
255
276
|
var mergeSegments = old.mergeSegments;
|
|
@@ -270,7 +291,7 @@ function RecordPlayer(_ref) {
|
|
|
270
291
|
});
|
|
271
292
|
});
|
|
272
293
|
|
|
273
|
-
case
|
|
294
|
+
case 12:
|
|
274
295
|
case "end":
|
|
275
296
|
return _context.stop();
|
|
276
297
|
}
|
|
@@ -338,7 +359,11 @@ function RecordPlayer(_ref) {
|
|
|
338
359
|
height: screenType.height
|
|
339
360
|
}
|
|
340
361
|
}));
|
|
341
|
-
})), /*#__PURE__*/React.createElement(
|
|
362
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
363
|
+
className: "player-tools-group"
|
|
364
|
+
}, /*#__PURE__*/React.createElement(DisableMark, {
|
|
365
|
+
disabled: !segmentItem.cid
|
|
366
|
+
}, /*#__PURE__*/React.createElement(RecordTools, {
|
|
342
367
|
time: state.currentTimes[state.selectIndex],
|
|
343
368
|
fit: fit,
|
|
344
369
|
toggleFit: toggleFit,
|
|
@@ -347,14 +372,18 @@ function RecordPlayer(_ref) {
|
|
|
347
372
|
mode: state.mode,
|
|
348
373
|
containerRef: domRef,
|
|
349
374
|
updateState: updateState,
|
|
350
|
-
onTimeChange: onTimeChange
|
|
375
|
+
onTimeChange: onTimeChange,
|
|
376
|
+
onClose: onClose,
|
|
377
|
+
onCloseAll: onCloseAll,
|
|
378
|
+
timeMode: state.timeMode
|
|
351
379
|
}), /*#__PURE__*/React.createElement(SegmentTimeLine, {
|
|
352
|
-
disabled: !!segmentItem.cid,
|
|
353
380
|
begin: timeBegin,
|
|
381
|
+
updateState: updateState,
|
|
354
382
|
timeCell: segmentItem.segments,
|
|
355
383
|
key: state.selectIndex,
|
|
356
|
-
onTimeChange: onTimeChange
|
|
357
|
-
|
|
384
|
+
onTimeChange: onTimeChange,
|
|
385
|
+
timeMode: state.timeMode
|
|
386
|
+
}))), children && /*#__PURE__*/React.cloneElement(children, {
|
|
358
387
|
selectIndex: state.selectIndex
|
|
359
388
|
}));
|
|
360
389
|
}
|
|
@@ -6,6 +6,7 @@ interface IToolsProps {
|
|
|
6
6
|
updateState: (state: {
|
|
7
7
|
screenNum?: number;
|
|
8
8
|
mode?: PlayModeType;
|
|
9
|
+
timeMode?: number;
|
|
9
10
|
}) => void;
|
|
10
11
|
screenNum: number;
|
|
11
12
|
mode: PlayModeType;
|
|
@@ -14,6 +15,10 @@ interface IToolsProps {
|
|
|
14
15
|
toggleFit?: () => void;
|
|
15
16
|
time?: number;
|
|
16
17
|
onTimeChange?: (time: number) => void;
|
|
18
|
+
onClose?: () => void;
|
|
19
|
+
onCloseAll?: () => void;
|
|
20
|
+
timeMode: number;
|
|
21
|
+
download?: () => void;
|
|
17
22
|
}
|
|
18
|
-
declare function RecordTools({ containerRef, updateState, screenNum, getPlayerItem, mode, toggleFit, fit, time, onTimeChange }: IToolsProps): JSX.Element;
|
|
23
|
+
declare function RecordTools({ containerRef, updateState, download, screenNum, timeMode, getPlayerItem, mode, toggleFit, fit, time, onTimeChange, onClose, onCloseAll }: IToolsProps): JSX.Element;
|
|
19
24
|
export default RecordTools;
|
|
@@ -17,17 +17,22 @@ import React from 'react';
|
|
|
17
17
|
import IconFont from '../Player/iconfont';
|
|
18
18
|
import ScreenSelect from './ScreenSelect';
|
|
19
19
|
import TimeSelect from './TimeSelect';
|
|
20
|
+
import TimeMode from './TimeMode';
|
|
20
21
|
|
|
21
22
|
function RecordTools(_ref) {
|
|
22
23
|
var containerRef = _ref.containerRef,
|
|
23
24
|
updateState = _ref.updateState,
|
|
25
|
+
download = _ref.download,
|
|
24
26
|
screenNum = _ref.screenNum,
|
|
27
|
+
timeMode = _ref.timeMode,
|
|
25
28
|
getPlayerItem = _ref.getPlayerItem,
|
|
26
29
|
mode = _ref.mode,
|
|
27
30
|
toggleFit = _ref.toggleFit,
|
|
28
31
|
fit = _ref.fit,
|
|
29
32
|
time = _ref.time,
|
|
30
|
-
onTimeChange = _ref.onTimeChange
|
|
33
|
+
onTimeChange = _ref.onTimeChange,
|
|
34
|
+
onClose = _ref.onClose,
|
|
35
|
+
onCloseAll = _ref.onCloseAll;
|
|
31
36
|
|
|
32
37
|
var _useFullscreen = _useFullscreen3(containerRef),
|
|
33
38
|
_useFullscreen2 = _slicedToArray(_useFullscreen, 2),
|
|
@@ -79,12 +84,14 @@ function RecordTools(_ref) {
|
|
|
79
84
|
type: "lm-player-Refresh_Main",
|
|
80
85
|
title: "\u91CD\u8F7D"
|
|
81
86
|
})), /*#__PURE__*/React.createElement("span", {
|
|
82
|
-
className: "player-tools-item"
|
|
87
|
+
className: "player-tools-item",
|
|
88
|
+
onClick: onClose
|
|
83
89
|
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
84
90
|
type: "lm-player-YesorNo_No_Dark",
|
|
85
91
|
title: "\u5173\u95ED\u5F53\u524D"
|
|
86
92
|
})), /*#__PURE__*/React.createElement("span", {
|
|
87
|
-
className: "player-tools-item"
|
|
93
|
+
className: "player-tools-item",
|
|
94
|
+
onClick: download
|
|
88
95
|
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
89
96
|
type: "lm-player-S_Edit_LoadDown",
|
|
90
97
|
title: "\u4E0B\u8F7D\u5F53\u524D\u5F55\u50CF"
|
|
@@ -114,7 +121,8 @@ function RecordTools(_ref) {
|
|
|
114
121
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
115
122
|
className: "player-tools-right"
|
|
116
123
|
}, /*#__PURE__*/React.createElement("span", {
|
|
117
|
-
className: "player-tools-item"
|
|
124
|
+
className: "player-tools-item",
|
|
125
|
+
onClick: onCloseAll
|
|
118
126
|
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
119
127
|
type: "lm-player-YesorNo_No_Dark",
|
|
120
128
|
title: "\u5173\u95ED\u6240\u6709"
|
|
@@ -149,7 +157,14 @@ function RecordTools(_ref) {
|
|
|
149
157
|
}) : /*#__PURE__*/React.createElement(IconFont, {
|
|
150
158
|
type: "lm-player-Full_Main",
|
|
151
159
|
title: "\u5168\u5C4F"
|
|
152
|
-
}))
|
|
160
|
+
})), /*#__PURE__*/React.createElement(TimeMode, {
|
|
161
|
+
timeMode: timeMode,
|
|
162
|
+
onChange: function onChange(m) {
|
|
163
|
+
return updateState({
|
|
164
|
+
timeMode: m
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
})));
|
|
153
168
|
}
|
|
154
169
|
|
|
155
170
|
export default RecordTools;
|
|
@@ -4,7 +4,10 @@ interface ISegmentTimeLineProps {
|
|
|
4
4
|
begin?: number;
|
|
5
5
|
timeCell?: ISegmentType[];
|
|
6
6
|
onTimeChange?: (time: number) => void;
|
|
7
|
-
|
|
7
|
+
timeMode: number;
|
|
8
|
+
updateState: (state: {
|
|
9
|
+
timeMode: number;
|
|
10
|
+
}) => void;
|
|
8
11
|
}
|
|
9
|
-
declare function SegmentTimeLine({ begin, timeCell,
|
|
12
|
+
declare function SegmentTimeLine({ begin, timeCell, onTimeChange, timeMode, updateState }: ISegmentTimeLineProps): JSX.Element;
|
|
10
13
|
export default SegmentTimeLine;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import _useUnmount from "ahooks/es/useUnmount";
|
|
2
|
+
import _useUpdateEffect from "ahooks/es/useUpdateEffect";
|
|
1
3
|
import _useThrottleFn2 from "ahooks/es/useThrottleFn";
|
|
2
4
|
import _useSize from "ahooks/es/useSize";
|
|
3
5
|
import moment from 'moment';
|
|
@@ -7,9 +9,11 @@ import TimeSlider from './TimeSlider';
|
|
|
7
9
|
function SegmentTimeLine(_ref) {
|
|
8
10
|
var begin = _ref.begin,
|
|
9
11
|
timeCell = _ref.timeCell,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
onTimeChange = _ref.onTimeChange,
|
|
13
|
+
timeMode = _ref.timeMode,
|
|
14
|
+
updateState = _ref.updateState;
|
|
12
15
|
var ref = useRef();
|
|
16
|
+
var timeSliderRef = useRef();
|
|
13
17
|
|
|
14
18
|
var size = _useSize(ref);
|
|
15
19
|
|
|
@@ -24,21 +28,35 @@ function SegmentTimeLine(_ref) {
|
|
|
24
28
|
minutes: 0,
|
|
25
29
|
seconds: 0
|
|
26
30
|
}).valueOf();
|
|
27
|
-
|
|
31
|
+
timeSliderRef.current = new TimeSlider(ref.current, {
|
|
28
32
|
onTimeChange: run,
|
|
29
|
-
start_timestamp: time -
|
|
33
|
+
start_timestamp: time - timeMode / 2 * 3600 * 1000,
|
|
30
34
|
current_timestamp: time,
|
|
31
|
-
timecell: timeCell
|
|
35
|
+
timecell: timeCell,
|
|
36
|
+
hours_per_ruler: timeMode,
|
|
37
|
+
onHoursPerChange: function onHoursPerChange(hour) {
|
|
38
|
+
return updateState({
|
|
39
|
+
timeMode: hour
|
|
40
|
+
});
|
|
41
|
+
}
|
|
32
42
|
});
|
|
33
|
-
return function () {
|
|
34
|
-
return timeLine.destory();
|
|
35
|
-
};
|
|
36
43
|
}, [begin, timeCell, size === null || size === void 0 ? void 0 : size.width, run]);
|
|
44
|
+
/**
|
|
45
|
+
* hour变化更新时间轴而不是重绘
|
|
46
|
+
*/
|
|
47
|
+
|
|
48
|
+
_useUpdateEffect(function () {
|
|
49
|
+
return timeSliderRef.current.drawHourChange(timeMode);
|
|
50
|
+
}, [timeMode]);
|
|
51
|
+
|
|
52
|
+
_useUnmount(function () {
|
|
53
|
+
timeSliderRef.current.destory();
|
|
54
|
+
timeSliderRef.current = null;
|
|
55
|
+
});
|
|
56
|
+
|
|
37
57
|
return /*#__PURE__*/React.createElement("div", {
|
|
38
58
|
className: "record-time-line"
|
|
39
|
-
},
|
|
40
|
-
className: "time-line-mask"
|
|
41
|
-
}), /*#__PURE__*/React.createElement("canvas", {
|
|
59
|
+
}, /*#__PURE__*/React.createElement("canvas", {
|
|
42
60
|
ref: ref
|
|
43
61
|
}));
|
|
44
62
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import "antd/lib/select/style";
|
|
2
|
+
import _Select from "antd/lib/select";
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { TimeModeLibs } from './utils';
|
|
5
|
+
|
|
6
|
+
function TimeMode(_ref) {
|
|
7
|
+
var timeMode = _ref.timeMode,
|
|
8
|
+
onChange = _ref.onChange;
|
|
9
|
+
return /*#__PURE__*/React.createElement(_Select, {
|
|
10
|
+
value: timeMode,
|
|
11
|
+
onChange: onChange,
|
|
12
|
+
className: "time-mode-select",
|
|
13
|
+
dropdownClassName: "time-mode-select-dropdown",
|
|
14
|
+
placement: "topLeft"
|
|
15
|
+
}, TimeModeLibs.map(function (item) {
|
|
16
|
+
return /*#__PURE__*/React.createElement(_Select.Option, {
|
|
17
|
+
value: item.name,
|
|
18
|
+
key: item.name
|
|
19
|
+
}, item.name, "\u5C0F\u65F6");
|
|
20
|
+
}));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export default TimeMode;
|
|
@@ -4,7 +4,8 @@ export interface ITimeSliderOptions {
|
|
|
4
4
|
start_timestamp?: number;
|
|
5
5
|
timecell?: TimeCellItem[];
|
|
6
6
|
current_timestamp?: number;
|
|
7
|
-
onTimeChange?: (time: number) => void;
|
|
7
|
+
onTimeChange?: (time: number, outTimeline?: boolean) => void;
|
|
8
|
+
onHoursPerChange?: (hour: number) => void;
|
|
8
9
|
}
|
|
9
10
|
export declare type TimeCellItem = ISegmentType;
|
|
10
11
|
export default class TimeSlider {
|
|
@@ -115,6 +116,7 @@ export default class TimeSlider {
|
|
|
115
116
|
* 滚轮放大缩小,以时间轴中心为准 mousewheel事件
|
|
116
117
|
*/
|
|
117
118
|
mousewheelFunc: (event: any) => void;
|
|
119
|
+
drawHourChange(hour: number): void;
|
|
118
120
|
/**
|
|
119
121
|
* 获取鼠标posx
|
|
120
122
|
* @param {*} e
|
|
@@ -5,6 +5,8 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
|
|
|
5
5
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
6
6
|
|
|
7
7
|
import moment from 'moment';
|
|
8
|
+
import { nextTick } from 'process';
|
|
9
|
+
var hours = [1, 6, 12, 24];
|
|
8
10
|
var currentColor = '#FF000A';
|
|
9
11
|
var normalLineColor = '#ffffff';
|
|
10
12
|
var hoverLineColor = '#319BFF';
|
|
@@ -103,7 +105,7 @@ var TimeSlider = /*#__PURE__*/function () {
|
|
|
103
105
|
_this.drawLine(pos_x, 20, pos_x, _this.canVansH, hoverLineColor, 1);
|
|
104
106
|
|
|
105
107
|
_this.ctx.fillStyle = hoverLineColor;
|
|
106
|
-
_this.ctx.font =
|
|
108
|
+
_this.ctx.font = '10px Arial';
|
|
107
109
|
|
|
108
110
|
_this.ctx.fillText(_this.changeTime(current_timestamp), pos_x - 50, 12);
|
|
109
111
|
}
|
|
@@ -131,18 +133,15 @@ var TimeSlider = /*#__PURE__*/function () {
|
|
|
131
133
|
|
|
132
134
|
var timecellItem = _this.timecell.find(function (v) {
|
|
133
135
|
return current_timestamp >= v.beginTime && current_timestamp < v.endTime;
|
|
134
|
-
});
|
|
136
|
+
}); // 当前片段没有录像的时候
|
|
135
137
|
|
|
136
|
-
if (timecellItem && !timecellItem.url) {
|
|
137
|
-
// 无录像轴 不让点击
|
|
138
|
-
return;
|
|
139
|
-
}
|
|
140
138
|
|
|
139
|
+
var outTimeline = timecellItem && !timecellItem.url;
|
|
141
140
|
_this.current_timestamp = current_timestamp;
|
|
142
141
|
|
|
143
142
|
_this.set_time_to_middle(_this.current_timestamp);
|
|
144
143
|
|
|
145
|
-
_this.options.onTimeChange && _this.options.onTimeChange(current_timestamp);
|
|
144
|
+
_this.options.onTimeChange && _this.options.onTimeChange(current_timestamp, outTimeline);
|
|
146
145
|
}
|
|
147
146
|
|
|
148
147
|
document.removeEventListener('mousemove', _this.mousemoveFunc);
|
|
@@ -180,24 +179,33 @@ var TimeSlider = /*#__PURE__*/function () {
|
|
|
180
179
|
var middle_time = _this.start_timestamp + _this.hours_per_ruler * 3600 * 1000 / 2; //ms 记住当前中间的时间
|
|
181
180
|
|
|
182
181
|
if (delta < 0) {
|
|
183
|
-
|
|
182
|
+
// 缩小
|
|
183
|
+
var index = hours.indexOf(_this.zoom);
|
|
184
184
|
|
|
185
|
-
if (
|
|
186
|
-
_this.zoom =
|
|
185
|
+
if (index === hours.length - 1) {
|
|
186
|
+
_this.zoom = hours[index];
|
|
187
|
+
} else {
|
|
188
|
+
_this.zoom = hours[index + 1];
|
|
187
189
|
}
|
|
188
190
|
|
|
189
191
|
_this.hours_per_ruler = _this.zoom;
|
|
190
192
|
} else if (delta > 0) {
|
|
191
193
|
// 放大
|
|
192
|
-
|
|
194
|
+
var _index = hours.indexOf(_this.zoom);
|
|
193
195
|
|
|
194
|
-
if (
|
|
195
|
-
_this.zoom =
|
|
196
|
+
if (_index === 0) {
|
|
197
|
+
_this.zoom = hours[0];
|
|
198
|
+
} else {
|
|
199
|
+
_this.zoom = hours[_index - 1];
|
|
196
200
|
}
|
|
197
201
|
|
|
198
202
|
_this.hours_per_ruler = _this.zoom;
|
|
199
203
|
}
|
|
200
204
|
|
|
205
|
+
nextTick(function () {
|
|
206
|
+
return _this.options.onHoursPerChange && _this.options.onHoursPerChange(_this.hours_per_ruler);
|
|
207
|
+
});
|
|
208
|
+
|
|
201
209
|
_this.clearCanvas();
|
|
202
210
|
|
|
203
211
|
_this.start_timestamp = middle_time - _this.hours_per_ruler * 3600 * 1000 / 2; //start_timestamp = 当前中间的时间 - zoom/2
|
|
@@ -233,7 +241,7 @@ var TimeSlider = /*#__PURE__*/function () {
|
|
|
233
241
|
this.options = options;
|
|
234
242
|
this.canvansW = this.canvas.width = this.canvas.clientWidth;
|
|
235
243
|
this.canVansH = this.canvas.height = this.canvas.clientHeight;
|
|
236
|
-
this.hours_per_ruler = (_a = this.options.hours_per_ruler) !== null && _a !== void 0 ? _a : this.hours_per_ruler;
|
|
244
|
+
this.zoom = this.hours_per_ruler = (_a = this.options.hours_per_ruler) !== null && _a !== void 0 ? _a : this.hours_per_ruler;
|
|
237
245
|
this.start_timestamp = (_b = this.options.start_timestamp) !== null && _b !== void 0 ? _b : this.start_timestamp;
|
|
238
246
|
this.current_timestamp = (_c = this.options.current_timestamp) !== null && _c !== void 0 ? _c : this.current_timestamp;
|
|
239
247
|
this.timecell = (_d = this.options.timecell) !== null && _d !== void 0 ? _d : this.timecell;
|
|
@@ -360,13 +368,13 @@ var TimeSlider = /*#__PURE__*/function () {
|
|
|
360
368
|
lineH = 10;
|
|
361
369
|
var big_date = this.graduation_title(date);
|
|
362
370
|
this.ctx.fillStyle = normalLineColor;
|
|
363
|
-
this.ctx.font =
|
|
371
|
+
this.ctx.font = '10px Arial';
|
|
364
372
|
this.ctx.fillText(big_date, graduation_left - 12, 30);
|
|
365
373
|
} else if (graduation_time / (60 * 1000) % medium_step === 0) {
|
|
366
374
|
lineH = 10;
|
|
367
375
|
var middle_date = this.graduation_title(date);
|
|
368
376
|
this.ctx.fillStyle = normalLineColor;
|
|
369
|
-
this.ctx.font =
|
|
377
|
+
this.ctx.font = '10px Arial';
|
|
370
378
|
this.ctx.fillText(middle_date, graduation_left - (middle_date.length > 5 ? 24 : 12), 30);
|
|
371
379
|
} else {
|
|
372
380
|
lineH = 5;
|
|
@@ -515,6 +523,17 @@ var TimeSlider = /*#__PURE__*/function () {
|
|
|
515
523
|
}
|
|
516
524
|
}
|
|
517
525
|
}
|
|
526
|
+
}, {
|
|
527
|
+
key: "drawHourChange",
|
|
528
|
+
value: function drawHourChange(hour) {
|
|
529
|
+
var middle_time = this.start_timestamp + this.hours_per_ruler * 3600 * 1000 / 2; //ms 记住当前中间的时间
|
|
530
|
+
|
|
531
|
+
this.hours_per_ruler = this.zoom = hour;
|
|
532
|
+
this.clearCanvas();
|
|
533
|
+
this.start_timestamp = middle_time - this.hours_per_ruler * 3600 * 1000 / 2; //start_timestamp = 当前中间的时间 - zoom/2
|
|
534
|
+
|
|
535
|
+
this.init(this.start_timestamp, this.timecell, true);
|
|
536
|
+
}
|
|
518
537
|
/**
|
|
519
538
|
* 清除canvas 每次重新绘制需要先清除
|
|
520
539
|
*/
|
package/es/ScreenPlayer/demo.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
min-width: 600px;
|
|
7
7
|
}
|
|
8
8
|
.split-screen-player-wrapper .player-layout {
|
|
9
|
-
height: calc(100% -
|
|
9
|
+
height: calc(100% - 88px);
|
|
10
10
|
}
|
|
11
11
|
.split-screen-player-wrapper .player-layout .player-with-ext-layout {
|
|
12
12
|
float: left;
|
|
@@ -19,6 +19,10 @@
|
|
|
19
19
|
.split-screen-player-wrapper .player-layout .player-with-ext-layout.player-current-index .lm-player-ext-layout {
|
|
20
20
|
border: 1px solid var(--primary);
|
|
21
21
|
}
|
|
22
|
+
.split-screen-player-wrapper .player-tools-group {
|
|
23
|
+
height: 88px;
|
|
24
|
+
position: relative;
|
|
25
|
+
}
|
|
22
26
|
.split-screen-player-wrapper .player-record-time {
|
|
23
27
|
width: 100%;
|
|
24
28
|
height: 100%;
|
|
@@ -95,12 +99,26 @@
|
|
|
95
99
|
z-index: 5;
|
|
96
100
|
cursor: not-allowed;
|
|
97
101
|
}
|
|
98
|
-
.split-screen-player-wrapper.split-screen-player-wrapper-record .player-layout {
|
|
99
|
-
height: calc(100% - 42px - 60px);
|
|
100
|
-
}
|
|
101
102
|
.player-time-select {
|
|
102
103
|
width: 190px;
|
|
103
104
|
display: flex;
|
|
104
105
|
justify-content: space-around;
|
|
105
106
|
align-items: center;
|
|
106
107
|
}
|
|
108
|
+
.time-mode-select {
|
|
109
|
+
font-size: var(--fs-small);
|
|
110
|
+
color: var(--gray1);
|
|
111
|
+
}
|
|
112
|
+
.time-mode-select .cloudapp-select-selector {
|
|
113
|
+
background-color: transparent !important;
|
|
114
|
+
border-radius: var(--radius1) !important;
|
|
115
|
+
}
|
|
116
|
+
.time-mode-select .anticon {
|
|
117
|
+
color: var(--gray1);
|
|
118
|
+
}
|
|
119
|
+
.time-mode-select-dropdown {
|
|
120
|
+
font-size: var(--fs-small);
|
|
121
|
+
}
|
|
122
|
+
.time-mode-select-dropdown .cloudapp-select-item {
|
|
123
|
+
font-size: var(--fs-small);
|
|
124
|
+
}
|
|
@@ -23,6 +23,20 @@ export interface IRecordPlayerProps {
|
|
|
23
23
|
* 窗口索引变化,后续基于索引传入播放必要数据
|
|
24
24
|
*/
|
|
25
25
|
onIndexChange: (idx: number) => void;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* 关闭单个窗口
|
|
29
|
+
*/
|
|
30
|
+
onClose?: () => void;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* 关闭所有窗口
|
|
34
|
+
*/
|
|
35
|
+
onCloseAll?: () => void;
|
|
36
|
+
/**
|
|
37
|
+
* 录像下载回调
|
|
38
|
+
*/
|
|
39
|
+
download?: () => void;
|
|
26
40
|
}
|
|
27
41
|
|
|
28
42
|
export interface IRecordPlayerState {
|
|
@@ -60,6 +74,11 @@ export interface IRecordPlayerState {
|
|
|
60
74
|
* 加载中,用于拦截多次时间轴变化需要加载片段的情况
|
|
61
75
|
*/
|
|
62
76
|
loading?: boolean;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* 录像时间轴单页绘制时长单位(hour)
|
|
80
|
+
*/
|
|
81
|
+
timeMode: number;
|
|
63
82
|
}
|
|
64
83
|
|
|
65
84
|
export type ScreenItemLivePlayerType = {
|
|
@@ -70,6 +89,20 @@ export type ScreenItemLivePlayerType = {
|
|
|
70
89
|
export interface ILivePlayerProps {
|
|
71
90
|
list?: ScreenItemLivePlayerType[];
|
|
72
91
|
children?: JSX.Element;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* 关闭单个窗口
|
|
95
|
+
*/
|
|
96
|
+
onClose?: () => void;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* 关闭所有窗口
|
|
100
|
+
*/
|
|
101
|
+
onCloseAll?: () => void;
|
|
102
|
+
/**
|
|
103
|
+
* 窗口索引变化,后续基于索引传入播放必要数据
|
|
104
|
+
*/
|
|
105
|
+
onIndexChange: (idx: number) => void;
|
|
73
106
|
}
|
|
74
107
|
|
|
75
108
|
export interface ILivePlayerState {
|
|
@@ -4,6 +4,9 @@ export declare const ScreenType: {
|
|
|
4
4
|
width: string;
|
|
5
5
|
height: string;
|
|
6
6
|
}[];
|
|
7
|
+
export declare const TimeModeLibs: {
|
|
8
|
+
name: number;
|
|
9
|
+
}[];
|
|
7
10
|
export declare function mergeFill<T, S>(len: number, mergeArr: T[], fillItem: S): (T | S)[];
|
|
8
11
|
export declare const FILTER_KEY = "00|11|00";
|
|
9
12
|
/**
|
package/es/ScreenPlayer/utils.js
CHANGED
|
@@ -15,6 +15,15 @@ export var ScreenType = [{
|
|
|
15
15
|
width: '25%',
|
|
16
16
|
height: '25%'
|
|
17
17
|
}];
|
|
18
|
+
export var TimeModeLibs = [{
|
|
19
|
+
name: 24
|
|
20
|
+
}, {
|
|
21
|
+
name: 12
|
|
22
|
+
}, {
|
|
23
|
+
name: 6
|
|
24
|
+
}, {
|
|
25
|
+
name: 1
|
|
26
|
+
}];
|
|
18
27
|
export function mergeFill(len, mergeArr, fillItem) {
|
|
19
28
|
return new Array(len).fill(fillItem).map(function (v, i) {
|
|
20
29
|
return mergeArr[i] ? mergeArr[i] : v;
|
package/es/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export { default as Box } from './Box';
|
|
|
6
6
|
export { default as CheckGroupFixed } from './CheckGroupFixed';
|
|
7
7
|
export { default as Config } from './Config';
|
|
8
8
|
export { default as ConfigContext } from './ConfigContext';
|
|
9
|
+
export { default as DisableMark } from './DisableMark';
|
|
9
10
|
export { default as DomMove } from './DomMove';
|
|
10
11
|
export { default as Drag } from './Drag';
|
|
11
12
|
export { default as Drawer } from './Drawer';
|
package/es/index.js
CHANGED
|
@@ -6,6 +6,7 @@ export { default as Box } from './Box';
|
|
|
6
6
|
export { default as CheckGroupFixed } from './CheckGroupFixed';
|
|
7
7
|
export { default as Config } from './Config';
|
|
8
8
|
export { default as ConfigContext } from './ConfigContext';
|
|
9
|
+
export { default as DisableMark } from './DisableMark';
|
|
9
10
|
export { default as DomMove } from './DomMove';
|
|
10
11
|
export { default as Drag } from './Drag';
|
|
11
12
|
export { default as Drawer } from './Drawer';
|