@cloud-app-dev/vidc 3.0.1 → 3.0.4
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/.umirc.ts +1 -1
- package/es/LoaderApp/utils.d.ts +1 -1
- package/es/Map/AMap.d.ts +6839 -1319
- package/es/Map/BasicMap/AMapInstance.d.ts +4 -3
- package/es/Map/BasicMap/AMapInstance.js +3 -4
- package/es/Map/BasicMap/LeafletInstance.d.ts +3 -3
- package/es/Map/ClusterLayer/hook.d.ts +4 -4
- package/es/Map/ClusterLayer/hook.js +20 -24
- package/es/Map/ClusterLayer/index.d.ts +1 -0
- package/es/Map/ClusterLayer/index.js +1 -0
- package/es/Map/InfoWindow/MakerLikeWindow.d.ts +4 -0
- package/es/Map/InfoWindow/MakerLikeWindow.js +103 -0
- package/es/Map/InfoWindow/demo.js +48 -21
- package/es/Map/InfoWindow/index.d.ts +7 -5
- package/es/Map/InfoWindow/index.js +7 -6
- package/es/Map/interface.d.ts +1 -1
- package/es/Map/useMarker/index.d.ts +2 -2
- package/es/Map/useMarker/index.js +3 -19
- package/es/Player/api/index.d.ts +1 -0
- package/es/Player/api/index.js +2 -0
- package/es/Player/demo.js +8 -3
- package/es/Player/event/errorEvent.js +3 -8
- package/es/Player/frontend_player.d.ts +1 -2
- package/es/Player/frontend_player.js +27 -57
- package/es/Player/frontend_timeline.d.ts +2 -1
- package/es/Player/frontend_timeline.js +14 -4
- package/es/Player/player.d.ts +7 -9
- package/es/Player/segment_player.d.ts +1 -1
- package/es/Player/segment_player.js +74 -36
- package/es/Player/single_player.d.ts +2 -2
- package/es/Player/single_player.js +20 -11
- package/es/ScreenPlayer/Live.js +9 -1
- package/es/ScreenPlayer/LiveTools.d.ts +3 -1
- package/es/ScreenPlayer/LiveTools.js +8 -1
- package/es/ScreenPlayer/PlayerWithExt.js +48 -27
- package/es/ScreenPlayer/Record.d.ts +5 -0
- package/es/ScreenPlayer/Record.js +7 -19
- package/es/ScreenPlayer/TimeSlider.d.ts +1 -1
- package/es/ScreenPlayer/TimeSlider.js +39 -35
- package/es/ScreenPlayer/demo2.js +1 -1
- package/es/ScreenPlayer/index.css +2 -3
- package/es/ScreenPlayer/useVideoFit.d.ts +1 -1
- package/es/ScreenPlayer/useVideoFit.js +4 -2
- package/package.json +1 -1
- package/release-build.sh +29 -4
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import _useFullscreen3 from "ahooks/es/useFullscreen";
|
|
2
|
+
|
|
1
3
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
4
|
|
|
3
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."); }
|
|
@@ -16,7 +18,10 @@ import LivePlayer from '../Player/single_player';
|
|
|
16
18
|
import SegmentPlayer from '../Player/segment_player';
|
|
17
19
|
import FrontendPlayer from '../Player/frontend_player';
|
|
18
20
|
import ExtModel from '../PlayerExt';
|
|
21
|
+
import moment from 'moment';
|
|
19
22
|
export function LivePlayerWithExt(_a) {
|
|
23
|
+
var _b;
|
|
24
|
+
|
|
20
25
|
var mode = _a.mode,
|
|
21
26
|
isLive = _a.isLive,
|
|
22
27
|
url = _a.url,
|
|
@@ -31,11 +36,18 @@ export function LivePlayerWithExt(_a) {
|
|
|
31
36
|
var ref = useRef();
|
|
32
37
|
var update = useCallback(function () {
|
|
33
38
|
return updatePlayer(ref);
|
|
34
|
-
}, []);
|
|
39
|
+
}, [updatePlayer]);
|
|
40
|
+
|
|
41
|
+
var _useFullscreen = _useFullscreen3((_b = ref.current) === null || _b === void 0 ? void 0 : _b.container),
|
|
42
|
+
_useFullscreen2 = _slicedToArray(_useFullscreen, 2),
|
|
43
|
+
_ = _useFullscreen2[0],
|
|
44
|
+
toggleFullscreen = _useFullscreen2[1].toggleFullscreen;
|
|
45
|
+
|
|
35
46
|
return /*#__PURE__*/React.createElement("div", {
|
|
36
47
|
className: "player-with-ext-layout ".concat(className),
|
|
37
48
|
style: style,
|
|
38
|
-
onClick: onClick
|
|
49
|
+
onClick: onClick,
|
|
50
|
+
onDoubleClick: toggleFullscreen
|
|
39
51
|
}, /*#__PURE__*/React.createElement(ExtModel, {
|
|
40
52
|
url: url,
|
|
41
53
|
mode: mode,
|
|
@@ -50,6 +62,8 @@ export function LivePlayerWithExt(_a) {
|
|
|
50
62
|
}))));
|
|
51
63
|
}
|
|
52
64
|
export function SegmentPlayerWithExt(_a) {
|
|
65
|
+
var _b;
|
|
66
|
+
|
|
53
67
|
var begin = _a.begin,
|
|
54
68
|
style = _a.style,
|
|
55
69
|
className = _a.className,
|
|
@@ -59,21 +73,20 @@ export function SegmentPlayerWithExt(_a) {
|
|
|
59
73
|
props = __rest(_a, ["begin", "style", "className", "segments", "updatePlayer", "onClick"]);
|
|
60
74
|
|
|
61
75
|
var ref = useRef();
|
|
76
|
+
var update = useCallback(function () {
|
|
77
|
+
return updatePlayer(ref);
|
|
78
|
+
}, [updatePlayer]);
|
|
62
79
|
|
|
63
|
-
var
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
ref.current[k] = obj[k];
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
updatePlayer(ref);
|
|
71
|
-
};
|
|
80
|
+
var _useFullscreen4 = _useFullscreen3((_b = ref.current) === null || _b === void 0 ? void 0 : _b.container),
|
|
81
|
+
_useFullscreen5 = _slicedToArray(_useFullscreen4, 2),
|
|
82
|
+
_ = _useFullscreen5[0],
|
|
83
|
+
toggleFullscreen = _useFullscreen5[1].toggleFullscreen;
|
|
72
84
|
|
|
73
85
|
return /*#__PURE__*/React.createElement("div", {
|
|
74
86
|
className: "player-with-ext-layout ".concat(className),
|
|
75
87
|
style: style,
|
|
76
|
-
onClick: onClick
|
|
88
|
+
onClick: onClick,
|
|
89
|
+
onDoubleClick: toggleFullscreen
|
|
77
90
|
}, /*#__PURE__*/React.createElement(ExtModel, {
|
|
78
91
|
segments: segments,
|
|
79
92
|
mode: 1
|
|
@@ -97,6 +110,8 @@ export function FrontendPlayerWithExt(_ref) {
|
|
|
97
110
|
onClick = _ref.onClick,
|
|
98
111
|
pluginDownloadUrl = _ref.pluginDownloadUrl;
|
|
99
112
|
|
|
113
|
+
var _a;
|
|
114
|
+
|
|
100
115
|
var _useState = useState({
|
|
101
116
|
begin: 0,
|
|
102
117
|
end: 0,
|
|
@@ -115,7 +130,8 @@ export function FrontendPlayerWithExt(_ref) {
|
|
|
115
130
|
begin = _ref2[0],
|
|
116
131
|
end = _ref2[1];
|
|
117
132
|
var videoUrl = new URL(segments[0].url);
|
|
118
|
-
videoUrl.searchParams.set('begin', "".concat(begin));
|
|
133
|
+
videoUrl.searchParams.set('begin', "".concat(moment(begin).unix()));
|
|
134
|
+
videoUrl.searchParams.set('end', "".concat(moment(end).unix()));
|
|
119
135
|
setState({
|
|
120
136
|
begin: begin,
|
|
121
137
|
end: end,
|
|
@@ -127,31 +143,32 @@ export function FrontendPlayerWithExt(_ref) {
|
|
|
127
143
|
return;
|
|
128
144
|
}
|
|
129
145
|
|
|
146
|
+
var endTime = moment(segments[segments.length - 1].endTime).unix();
|
|
147
|
+
var beginTime = moment(time).unix();
|
|
130
148
|
var videoUrl = new URL(state.url);
|
|
131
|
-
videoUrl.searchParams.set('begin', "".concat(
|
|
149
|
+
videoUrl.searchParams.set('begin', "".concat(beginTime));
|
|
150
|
+
videoUrl.searchParams.set('end', "".concat(endTime));
|
|
132
151
|
setState(function (old) {
|
|
133
152
|
return Object.assign(Object.assign({}, old), {
|
|
134
153
|
url: videoUrl.toString()
|
|
135
154
|
});
|
|
136
155
|
});
|
|
137
|
-
}, [state.url]);
|
|
156
|
+
}, [segments, state.url]);
|
|
138
157
|
var ref = useRef();
|
|
158
|
+
var update = useCallback(function () {
|
|
159
|
+
return updatePlayer(ref);
|
|
160
|
+
}, [updatePlayer]);
|
|
139
161
|
|
|
140
|
-
var
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
ref.current[k] = obj[k];
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
ref.current['seekTo'] = seekTo;
|
|
148
|
-
updatePlayer(ref);
|
|
149
|
-
};
|
|
162
|
+
var _useFullscreen6 = _useFullscreen3((_a = ref.current) === null || _a === void 0 ? void 0 : _a.container),
|
|
163
|
+
_useFullscreen7 = _slicedToArray(_useFullscreen6, 2),
|
|
164
|
+
_ = _useFullscreen7[0],
|
|
165
|
+
toggleFullscreen = _useFullscreen7[1].toggleFullscreen;
|
|
150
166
|
|
|
151
167
|
return /*#__PURE__*/React.createElement("div", {
|
|
152
168
|
className: "player-with-ext-layout ".concat(className),
|
|
153
169
|
style: style,
|
|
154
|
-
onClick: onClick
|
|
170
|
+
onClick: onClick,
|
|
171
|
+
onDoubleClick: toggleFullscreen
|
|
155
172
|
}, /*#__PURE__*/React.createElement(ExtModel, {
|
|
156
173
|
segments: segments,
|
|
157
174
|
mode: mode,
|
|
@@ -161,9 +178,13 @@ export function FrontendPlayerWithExt(_ref) {
|
|
|
161
178
|
url: state.url,
|
|
162
179
|
hideContrallerBar: true,
|
|
163
180
|
forwordRef: ref,
|
|
181
|
+
extActions: {
|
|
182
|
+
seekTo: seekTo
|
|
183
|
+
},
|
|
164
184
|
begin: state.begin,
|
|
165
185
|
end: state.end,
|
|
166
186
|
onCanPlayerInit: update,
|
|
167
|
-
customTimeLine: /*#__PURE__*/React.createElement(React.Fragment, null)
|
|
187
|
+
customTimeLine: /*#__PURE__*/React.createElement(React.Fragment, null),
|
|
188
|
+
type: "flv"
|
|
168
189
|
})));
|
|
169
190
|
}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { IRecordPlayerProps } from './interface';
|
|
3
3
|
import './index.less';
|
|
4
|
+
/**
|
|
5
|
+
* @desc 录像设计的时间全部需要到毫秒
|
|
6
|
+
* @param param0
|
|
7
|
+
* @returns
|
|
8
|
+
*/
|
|
4
9
|
declare function RecordPlayer({ list, children, queryRecord, onIndexChange }: IRecordPlayerProps): JSX.Element;
|
|
5
10
|
export default RecordPlayer;
|
|
@@ -1,6 +1,5 @@
|
|
|
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 _nextTick from "@cloud-app-dev/utils/es/nextTick";
|
|
4
3
|
import _usePrevious from "ahooks/es/usePrevious";
|
|
5
4
|
|
|
6
5
|
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; }
|
|
@@ -34,6 +33,11 @@ import SegmentTimeLine from './SegmentTimeLine';
|
|
|
34
33
|
import useRecordList from './useRecordList';
|
|
35
34
|
import useVideoFit from './useVideoFit';
|
|
36
35
|
import "./index.css";
|
|
36
|
+
/**
|
|
37
|
+
* @desc 录像设计的时间全部需要到毫秒
|
|
38
|
+
* @param param0
|
|
39
|
+
* @returns
|
|
40
|
+
*/
|
|
37
41
|
|
|
38
42
|
function RecordPlayer(_ref) {
|
|
39
43
|
var _this = this;
|
|
@@ -176,24 +180,8 @@ function RecordPlayer(_ref) {
|
|
|
176
180
|
seekTo: 0
|
|
177
181
|
});
|
|
178
182
|
});
|
|
179
|
-
var play = getPlayerItem();
|
|
180
|
-
|
|
181
|
-
if (segmentItem.recordType === 2) {
|
|
182
|
-
play.seekTo && play.seekTo(Math.round(state.seekTo / 1000));
|
|
183
|
-
return;
|
|
184
|
-
} // 云录像seek处理
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
var seekTime = state.seekTo - item.segments[index].beginTime;
|
|
188
|
-
|
|
189
|
-
if (play.setIndex) {
|
|
190
|
-
play.setIndex(index);
|
|
191
|
-
|
|
192
|
-
_nextTick(function () {
|
|
193
|
-
return play.api.seekTo(seekTime / 1000);
|
|
194
|
-
});
|
|
195
|
-
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
196
|
-
|
|
183
|
+
var play = getPlayerItem();
|
|
184
|
+
play.api.seekTo(state.seekTo); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
197
185
|
}, [state.seekTo, state.selectIndex, recordList, segmentItem.recordType]); // 更新状态
|
|
198
186
|
|
|
199
187
|
var updateState = function updateState(newState) {
|
|
@@ -5,10 +5,9 @@ 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
|
-
var
|
|
9
|
-
var currentColor = '#248ffa';
|
|
8
|
+
var currentColor = '#FF000A';
|
|
10
9
|
var normalLineColor = '#ffffff';
|
|
11
|
-
var hoverLineColor = '#
|
|
10
|
+
var hoverLineColor = '#319BFF';
|
|
12
11
|
var minPerStep = [1, 2, 5, 10, 15, 20, 30, 60, 120, 180, 240, 360, 720, 1440];
|
|
13
12
|
var minStepSize = 20;
|
|
14
13
|
|
|
@@ -89,21 +88,24 @@ var TimeSlider = /*#__PURE__*/function () {
|
|
|
89
88
|
|
|
90
89
|
this.mousemoveFunc2 = function (e) {
|
|
91
90
|
if (!_this.g_isMousedown) {
|
|
92
|
-
var pos_x = _this.get_cursor_x_position(e);
|
|
91
|
+
var pos_x = _this.get_cursor_x_position(e); // const px_per_ms = this.canvansW / (this.hours_per_ruler * 60 * 60 * 1000); // px/ms
|
|
92
|
+
// const current_timestamp = this.start_timestamp + pos_x / px_per_ms;
|
|
93
93
|
|
|
94
|
-
var px_per_ms = _this.canvansW / (_this.hours_per_ruler * 60 * 60 * 1000); // px/ms
|
|
95
94
|
|
|
96
|
-
_this.
|
|
95
|
+
var ms_per_px = _this.hours_per_ruler * 3600 * 1000 / _this.canvansW; // ms/px
|
|
97
96
|
|
|
98
|
-
var
|
|
97
|
+
var current_timestamp = _this.start_timestamp + pos_x * ms_per_px;
|
|
98
|
+
|
|
99
|
+
_this.clearCanvas();
|
|
99
100
|
|
|
100
101
|
_this.init(_this.start_timestamp, _this.timecell, true);
|
|
101
102
|
|
|
102
|
-
_this.drawLine(pos_x,
|
|
103
|
+
_this.drawLine(pos_x, 20, pos_x, _this.canVansH, hoverLineColor, 1);
|
|
103
104
|
|
|
104
105
|
_this.ctx.fillStyle = hoverLineColor;
|
|
106
|
+
_this.ctx.font = "10px Arial";
|
|
105
107
|
|
|
106
|
-
_this.ctx.fillText(_this.changeTime(
|
|
108
|
+
_this.ctx.fillText(_this.changeTime(current_timestamp), pos_x - 50, 12);
|
|
107
109
|
}
|
|
108
110
|
};
|
|
109
111
|
/**
|
|
@@ -120,12 +122,12 @@ var TimeSlider = /*#__PURE__*/function () {
|
|
|
120
122
|
// click 事件
|
|
121
123
|
_this.g_isMousedown = false;
|
|
122
124
|
|
|
123
|
-
var
|
|
125
|
+
var pos_x = _this.get_cursor_x_position(e); //鼠标距离 px
|
|
124
126
|
|
|
125
127
|
|
|
126
|
-
var ms_per_px = _this.
|
|
128
|
+
var ms_per_px = _this.hours_per_ruler * 3600 * 1000 / _this.canvansW; // ms/px
|
|
127
129
|
|
|
128
|
-
var current_timestamp = _this.start_timestamp +
|
|
130
|
+
var current_timestamp = _this.start_timestamp + pos_x * ms_per_px;
|
|
129
131
|
|
|
130
132
|
var timecellItem = _this.timecell.find(function (v) {
|
|
131
133
|
return current_timestamp >= v.beginTime && current_timestamp < v.endTime;
|
|
@@ -136,11 +138,11 @@ var TimeSlider = /*#__PURE__*/function () {
|
|
|
136
138
|
return;
|
|
137
139
|
}
|
|
138
140
|
|
|
139
|
-
_this.current_timestamp =
|
|
141
|
+
_this.current_timestamp = current_timestamp;
|
|
140
142
|
|
|
141
143
|
_this.set_time_to_middle(_this.current_timestamp);
|
|
142
144
|
|
|
143
|
-
_this.options.onTimeChange && _this.options.onTimeChange(
|
|
145
|
+
_this.options.onTimeChange && _this.options.onTimeChange(current_timestamp);
|
|
144
146
|
}
|
|
145
147
|
|
|
146
148
|
document.removeEventListener('mousemove', _this.mousemoveFunc);
|
|
@@ -276,15 +278,15 @@ var TimeSlider = /*#__PURE__*/function () {
|
|
|
276
278
|
var px_per_ms = this.canvansW / (this.hours_per_ruler * 60 * 60 * 1000); // px/ms
|
|
277
279
|
|
|
278
280
|
var left = px_per_ms * ms_current;
|
|
279
|
-
this.ctx.fillStyle =
|
|
280
|
-
this.ctx.
|
|
281
|
-
this.
|
|
281
|
+
this.ctx.fillStyle = '#ffffff';
|
|
282
|
+
this.ctx.font = '12px Arial';
|
|
283
|
+
this.ctx.fillText(this.changeTime(time), left - 64, 14);
|
|
284
|
+
this.drawLine(left, 20, left, this.canVansH, currentColor, 2); //中间当前点线
|
|
282
285
|
}
|
|
283
286
|
}, {
|
|
284
287
|
key: "drawCellBg",
|
|
285
|
-
value: function drawCellBg() {
|
|
286
|
-
this.ctx.
|
|
287
|
-
this.ctx.fillRect(0, 0, this.canvansW, 15);
|
|
288
|
+
value: function drawCellBg() {// this.ctx.fillStyle = canvasbg;
|
|
289
|
+
// this.ctx.fillRect(0, 0, this.canvansW, 15);
|
|
288
290
|
}
|
|
289
291
|
}, {
|
|
290
292
|
key: "get_line_sizes",
|
|
@@ -308,9 +310,9 @@ var TimeSlider = /*#__PURE__*/function () {
|
|
|
308
310
|
|
|
309
311
|
var medium_step = 30;
|
|
310
312
|
|
|
311
|
-
for (var
|
|
312
|
-
if (this.distance_between_gtitle / px_per_min <= this.minutes_per_step[
|
|
313
|
-
medium_step = this.minutes_per_step[
|
|
313
|
+
for (var _i = 0; _i < this.minutes_per_step.length; _i++) {
|
|
314
|
+
if (this.distance_between_gtitle / px_per_min <= this.minutes_per_step[_i]) {
|
|
315
|
+
medium_step = this.minutes_per_step[_i];
|
|
314
316
|
break;
|
|
315
317
|
}
|
|
316
318
|
}
|
|
@@ -354,21 +356,23 @@ var TimeSlider = /*#__PURE__*/function () {
|
|
|
354
356
|
|
|
355
357
|
var date = new Date(graduation_time);
|
|
356
358
|
|
|
357
|
-
if (date.getUTCHours()
|
|
358
|
-
lineH =
|
|
359
|
+
if (date.getUTCHours() === 0 && date.getUTCMinutes() === 0) {
|
|
360
|
+
lineH = 10;
|
|
359
361
|
var big_date = this.graduation_title(date);
|
|
360
362
|
this.ctx.fillStyle = normalLineColor;
|
|
361
|
-
this.ctx.
|
|
362
|
-
|
|
363
|
-
|
|
363
|
+
this.ctx.font = "10px Arial";
|
|
364
|
+
this.ctx.fillText(big_date, graduation_left - 12, 30);
|
|
365
|
+
} else if (graduation_time / (60 * 1000) % medium_step === 0) {
|
|
366
|
+
lineH = 10;
|
|
364
367
|
var middle_date = this.graduation_title(date);
|
|
365
368
|
this.ctx.fillStyle = normalLineColor;
|
|
366
|
-
this.ctx.
|
|
369
|
+
this.ctx.font = "10px Arial";
|
|
370
|
+
this.ctx.fillText(middle_date, graduation_left - (middle_date.length > 5 ? 24 : 12), 30);
|
|
367
371
|
} else {
|
|
368
|
-
lineH =
|
|
372
|
+
lineH = 5;
|
|
369
373
|
}
|
|
370
374
|
|
|
371
|
-
this.drawLine(graduation_left,
|
|
375
|
+
this.drawLine(graduation_left, this.canVansH - lineH, graduation_left, this.canVansH, normalLineColor, 2);
|
|
372
376
|
}
|
|
373
377
|
}
|
|
374
378
|
}, {
|
|
@@ -389,7 +393,7 @@ var TimeSlider = /*#__PURE__*/function () {
|
|
|
389
393
|
var m = datetime.getMinutes();
|
|
390
394
|
var s = datetime.getMilliseconds();
|
|
391
395
|
|
|
392
|
-
if (h
|
|
396
|
+
if (h === 0 && m === 0 && s === 0) {
|
|
393
397
|
return moment(datetime).format('YYYY.MM.DD');
|
|
394
398
|
}
|
|
395
399
|
|
|
@@ -443,10 +447,10 @@ var TimeSlider = /*#__PURE__*/function () {
|
|
|
443
447
|
|
|
444
448
|
var beginX = (cell.beginTime - this.start_timestamp) * px_per_ms;
|
|
445
449
|
var cell_width = (cell.endTime - cell.beginTime) * px_per_ms;
|
|
446
|
-
this.ctx.fillStyle = cell.url ? ((_a = cell.style) === null || _a === void 0 ? void 0 : _a.background) || hoverLineColor : '#
|
|
447
|
-
this.ctx.fillRect(beginX,
|
|
450
|
+
this.ctx.fillStyle = cell.url ? ((_a = cell.style) === null || _a === void 0 ? void 0 : _a.background) || hoverLineColor : '#242C3D';
|
|
451
|
+
this.ctx.fillRect(beginX, this.canVansH - 10, cell_width + 1, this.canVansH);
|
|
448
452
|
}
|
|
449
|
-
|
|
453
|
+
/**·
|
|
450
454
|
* 时间轴事件
|
|
451
455
|
*/
|
|
452
456
|
|
package/es/ScreenPlayer/demo2.js
CHANGED
|
@@ -28,7 +28,7 @@ import RecordPlayer from './Record';
|
|
|
28
28
|
import moment from 'moment';
|
|
29
29
|
import Service from '../Service';
|
|
30
30
|
import { completionSegments } from './utils';
|
|
31
|
-
var token = "eyJhbGciOiJIUzI1NiJ9.
|
|
31
|
+
var token = "eyJhbGciOiJIUzI1NiJ9.eyJvcmdhbml6YXRpb25JZCI6IjEwMDEwMTAwMDQ0NSIsImV4dCI6MTY2MTM4OTU0MzA4NSwidWlkIjoiMTAxMDAwMDAwNjk5IiwidmFsaWRTdGF0ZSI6MTA0NDA2LCJyb2xlSWQiOlsxMDAwMDAxMTA1MTgsMTAwMDAwMTEwNzI4XSwidmFsaWRUaW1lIjoxNzA0MzgzOTk5MDAwLCJvcHRDZW50ZXJJZCI6IjEwMDEwMDAwMDIzMyIsInVzZXJUeXBlIjoxMDA3MDQsImlhdCI6MTY2MTEzMDM0MzA4NX0.-0vh7SpomB6UWteJ6WIA5VneryhSW3Vrsz6RnHfgcRI";
|
|
32
32
|
var cids = ['538509097', '539172446'];
|
|
33
33
|
|
|
34
34
|
var query = function query(_ref) {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
}
|
|
26
26
|
.split-screen-player-wrapper.split-screen-player-wrapper-record .record-time-line {
|
|
27
27
|
width: 100%;
|
|
28
|
-
height:
|
|
28
|
+
height: 46px;
|
|
29
29
|
position: relative;
|
|
30
30
|
}
|
|
31
31
|
.split-screen-player-wrapper.split-screen-player-wrapper-record .record-time-line canvas {
|
|
@@ -33,8 +33,7 @@
|
|
|
33
33
|
width: 100%;
|
|
34
34
|
height: 100%;
|
|
35
35
|
cursor: pointer;
|
|
36
|
-
|
|
37
|
-
background-color: #2b2f33;
|
|
36
|
+
background-color: #030917;
|
|
38
37
|
}
|
|
39
38
|
.split-screen-player-wrapper.split-screen-player-wrapper-record .record-time-line .time-line-mask {
|
|
40
39
|
position: absolute;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export default function useVideoFit(containerRef: React.MutableRefObject<HTMLDivElement>, deps
|
|
2
|
+
export default function useVideoFit(containerRef: React.MutableRefObject<HTMLDivElement>, deps?: any[]): {
|
|
3
3
|
fit: string;
|
|
4
4
|
toggleFit: () => void;
|
|
5
5
|
};
|
|
@@ -21,7 +21,9 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
21
21
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
22
22
|
|
|
23
23
|
import { useEffect, useMemo } from 'react';
|
|
24
|
-
export default function useVideoFit(containerRef
|
|
24
|
+
export default function useVideoFit(containerRef) {
|
|
25
|
+
var deps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
26
|
+
|
|
25
27
|
var _useToggle = _useToggle3('contain', 'fill'),
|
|
26
28
|
_useToggle2 = _slicedToArray(_useToggle, 2),
|
|
27
29
|
fit = _useToggle2[0],
|
|
@@ -35,7 +37,7 @@ export default function useVideoFit(containerRef, deps) {
|
|
|
35
37
|
var videos = containerRef.current.querySelectorAll('video');
|
|
36
38
|
Array.from(videos).forEach(function (item) {
|
|
37
39
|
item.style.objectFit = fit;
|
|
38
|
-
});
|
|
40
|
+
}); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
39
41
|
}, [].concat(_toConsumableArray(deps), [fit]));
|
|
40
42
|
return useMemo(function () {
|
|
41
43
|
return {
|
package/package.json
CHANGED
package/release-build.sh
CHANGED
|
@@ -1,8 +1,37 @@
|
|
|
1
1
|
#! /bin/sh
|
|
2
2
|
|
|
3
|
+
pnpm install
|
|
4
|
+
if [ $? -eq 0 ]; then
|
|
5
|
+
echo "packages install success!"
|
|
6
|
+
else
|
|
7
|
+
echo "packages install failed!"
|
|
8
|
+
exit 1
|
|
9
|
+
fi
|
|
10
|
+
|
|
3
11
|
npm run build
|
|
12
|
+
if [ $? -eq 0 ]; then
|
|
13
|
+
echo "build success!"
|
|
14
|
+
else
|
|
15
|
+
echo "build failed!"
|
|
16
|
+
exit 1
|
|
17
|
+
fi
|
|
4
18
|
|
|
5
19
|
npm run deploy
|
|
20
|
+
if [ $? -eq 0 ]; then
|
|
21
|
+
echo "deploy success!"
|
|
22
|
+
else
|
|
23
|
+
echo "deploy failed!"
|
|
24
|
+
exit 1
|
|
25
|
+
fi
|
|
26
|
+
|
|
27
|
+
nrm use npm
|
|
28
|
+
npm publish
|
|
29
|
+
if [ $? -eq 0 ]; then
|
|
30
|
+
echo "publish success!"
|
|
31
|
+
else
|
|
32
|
+
echo "publish failed!"
|
|
33
|
+
exit 1
|
|
34
|
+
fi
|
|
6
35
|
|
|
7
36
|
git add .
|
|
8
37
|
|
|
@@ -12,8 +41,4 @@ git pull
|
|
|
12
41
|
|
|
13
42
|
git push
|
|
14
43
|
|
|
15
|
-
nrm use npm
|
|
16
|
-
|
|
17
|
-
npm publish
|
|
18
|
-
|
|
19
44
|
exit 1
|