@cloud-app-dev/vidc 3.0.0 → 3.0.3
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/ErrorBoundary/index.d.ts +2 -2
- package/es/ErrorBoundary/index.js +2 -7
- package/es/LoaderApp/utils.d.ts +1 -1
- package/es/Map/BasicMap/index.js +3 -8
- package/es/Modal/index.js +7 -5
- package/es/Picture/component/RectMenu/index.d.ts +1 -1
- package/es/Player/api/index.d.ts +1 -8
- package/es/Player/api/index.js +23 -34
- package/es/Player/contraller_bar/left_bar.js +2 -2
- package/es/Player/contraller_bar/right_bar.d.ts +1 -1
- package/es/Player/contraller_bar/right_bar.js +13 -27
- package/es/Player/demo.js +8 -3
- 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 +20 -9
- 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/segment_timeline.js +8 -7
- package/es/Player/single_player.d.ts +2 -2
- package/es/Player/single_player.js +14 -10
- package/es/Player/util.d.ts +2 -24
- package/es/Player/util.js +43 -54
- package/es/PlayerExt/index.d.ts +1 -1
- package/es/ScreenPlayer/PlayerWithExt.d.ts +2 -2
- package/es/ScreenPlayer/PlayerWithExt.js +21 -28
- 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/index.d.ts +2 -3
- package/es/ScreenPlayer/index.js +4 -3
- package/es/ScreenPlayer/useRecordList.d.ts +1 -1
- package/es/ScreenPlayer/useVideoFit.d.ts +1 -1
- package/es/ScreenPlayer/useVideoFit.js +4 -2
- package/es/ScreenPlayer/utils.d.ts +1 -1
- package/es/Timeout/index.d.ts +33 -0
- package/es/Timeout/index.js +83 -0
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/es/withErrorBoundary/index.d.ts +2 -1
- package/es/withErrorBoundary/index.js +4 -2
- package/package.json +1 -1
- package/release-build.sh +44 -0
|
@@ -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,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
declare const _default: {
|
|
1
|
+
declare const Sceenplayer: {
|
|
3
2
|
LivePlayer: import("react").ComponentType<import("./interface").ILivePlayerProps>;
|
|
4
3
|
RecordPlayer: import("react").ComponentType<import("./interface").IRecordPlayerProps>;
|
|
5
4
|
};
|
|
6
|
-
export default
|
|
5
|
+
export default Sceenplayer;
|
package/es/ScreenPlayer/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import withErrorBoundary from '
|
|
1
|
+
import withErrorBoundary from '../withErrorBoundary';
|
|
2
2
|
import LivePlayer from './Live';
|
|
3
3
|
import RecordPlayer from './Record';
|
|
4
|
-
|
|
4
|
+
var Sceenplayer = {
|
|
5
5
|
LivePlayer: withErrorBoundary(LivePlayer),
|
|
6
6
|
RecordPlayer: withErrorBoundary(RecordPlayer)
|
|
7
|
-
};
|
|
7
|
+
};
|
|
8
|
+
export default Sceenplayer;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ISegmentType } from '
|
|
1
|
+
import { ISegmentType } from '../Player/player';
|
|
2
2
|
import { RecordItem } from './interface';
|
|
3
3
|
export default function useRecordList(list: RecordItem[], queryRecord: (options: any) => Promise<ISegmentType[]>): RecordItem[];
|
|
@@ -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 {
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { BasicTarget } from 'ahooks/es/utils/domTarget';
|
|
3
|
+
import 'antd/es/modal/style/css';
|
|
4
|
+
interface ITimeoutProps {
|
|
5
|
+
/**
|
|
6
|
+
*ß
|
|
7
|
+
*/
|
|
8
|
+
contianer?: BasicTarget;
|
|
9
|
+
/**
|
|
10
|
+
* 超时时长单位s
|
|
11
|
+
*/
|
|
12
|
+
time?: number;
|
|
13
|
+
/**
|
|
14
|
+
* 超时动作,默认退出登录
|
|
15
|
+
*/
|
|
16
|
+
onTimeout?: () => void;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
declare function Timeout({ contianer, time, onTimeout }: ITimeoutProps): JSX.Element;
|
|
22
|
+
declare namespace Timeout {
|
|
23
|
+
var defaultProps: {
|
|
24
|
+
time: number;
|
|
25
|
+
contianer: HTMLElement;
|
|
26
|
+
onTimeout: typeof defaultTimeoutAction;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
declare function defaultTimeoutAction(): {
|
|
30
|
+
destroy: () => void;
|
|
31
|
+
update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
|
|
32
|
+
};
|
|
33
|
+
export default Timeout;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import "antd/lib/modal/style";
|
|
2
|
+
import _Modal from "antd/lib/modal";
|
|
3
|
+
import _useEventListener from "ahooks/es/useEventListener";
|
|
4
|
+
import _useRafInterval from "ahooks/es/useRafInterval";
|
|
5
|
+
|
|
6
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
7
|
+
|
|
8
|
+
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."); }
|
|
9
|
+
|
|
10
|
+
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); }
|
|
11
|
+
|
|
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
|
+
|
|
14
|
+
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; }
|
|
15
|
+
|
|
16
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
17
|
+
|
|
18
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
19
|
+
//此处antd有bug不能定制样式前缀
|
|
20
|
+
import 'antd/es/modal/style/css';
|
|
21
|
+
/**
|
|
22
|
+
*
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
function Timeout(_ref) {
|
|
26
|
+
var contianer = _ref.contianer,
|
|
27
|
+
time = _ref.time,
|
|
28
|
+
onTimeout = _ref.onTimeout;
|
|
29
|
+
var cuurentTimeRef = useRef(Date.now());
|
|
30
|
+
var lockstatusRef = useRef(false);
|
|
31
|
+
|
|
32
|
+
var _useState = useState({
|
|
33
|
+
timelock: Date.now()
|
|
34
|
+
}),
|
|
35
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
36
|
+
state = _useState2[0],
|
|
37
|
+
setState = _useState2[1];
|
|
38
|
+
|
|
39
|
+
_useRafInterval(function () {
|
|
40
|
+
return setState(function (old) {
|
|
41
|
+
return Object.assign(Object.assign({}, old), {
|
|
42
|
+
timelock: Date.now()
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
}, 1 * 1000);
|
|
46
|
+
|
|
47
|
+
useEffect(function () {
|
|
48
|
+
if (!lockstatusRef.current && state.timelock - cuurentTimeRef.current > time * 1000) {
|
|
49
|
+
lockstatusRef.current = true;
|
|
50
|
+
onTimeout && onTimeout();
|
|
51
|
+
setTimeout(function () {
|
|
52
|
+
return lockstatusRef.current = false;
|
|
53
|
+
}, 1000);
|
|
54
|
+
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
55
|
+
|
|
56
|
+
}, [state.timelock, time]);
|
|
57
|
+
|
|
58
|
+
_useEventListener('mousemove', function () {
|
|
59
|
+
return cuurentTimeRef.current = Date.now();
|
|
60
|
+
}, {
|
|
61
|
+
target: contianer
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function defaultTimeoutAction() {
|
|
68
|
+
return _Modal.warning({
|
|
69
|
+
title: '系统提示',
|
|
70
|
+
content: /*#__PURE__*/React.createElement("p", null, "\u60A8\u957F\u65F6\u95F4\u672A\u64CD\u4F5C\u7CFB\u7EDF\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55\uFF01"),
|
|
71
|
+
onOk: function onOk() {
|
|
72
|
+
sessionStorage.clear();
|
|
73
|
+
window.location.replace('/login');
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
Timeout.defaultProps = {
|
|
79
|
+
time: 15 * 60,
|
|
80
|
+
contianer: document.body,
|
|
81
|
+
onTimeout: defaultTimeoutAction
|
|
82
|
+
};
|
|
83
|
+
export default Timeout;
|
package/es/index.d.ts
CHANGED
|
@@ -32,6 +32,7 @@ export { default as SegmentPlayer } from './SegmentPlayer';
|
|
|
32
32
|
export { default as Service } from './Service';
|
|
33
33
|
export { default as TableLayout } from './TableLayout';
|
|
34
34
|
export { default as ThemeAntd } from './ThemeAntd';
|
|
35
|
+
export { default as Timeout } from './Timeout';
|
|
35
36
|
export { default as Tree } from './Tree';
|
|
36
37
|
export { default as useHistory } from './useHistory';
|
|
37
38
|
export { default as useInfiniteScroll } from './useInfiniteScroll';
|
package/es/index.js
CHANGED
|
@@ -32,6 +32,7 @@ export { default as SegmentPlayer } from './SegmentPlayer';
|
|
|
32
32
|
export { default as Service } from './Service';
|
|
33
33
|
export { default as TableLayout } from './TableLayout';
|
|
34
34
|
export { default as ThemeAntd } from './ThemeAntd';
|
|
35
|
+
export { default as Timeout } from './Timeout';
|
|
35
36
|
export { default as Tree } from './Tree';
|
|
36
37
|
export { default as useHistory } from './useHistory';
|
|
37
38
|
export { default as useInfiniteScroll } from './useInfiniteScroll';
|
|
@@ -5,4 +5,5 @@ import { IErrorBoundaryProps } from '../ErrorBoundary';
|
|
|
5
5
|
* @param Component 业务组件
|
|
6
6
|
* @param errorBoundaryProps error boundary的props
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
declare function withErrorBoundary<P>(Component: React.ComponentType<P>, errorBoundaryProps?: IErrorBoundaryProps): React.ComponentType<P>;
|
|
9
|
+
export default withErrorBoundary;
|
|
@@ -29,7 +29,7 @@ var Fallback = function Fallback() {
|
|
|
29
29
|
*/
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
function withErrorBoundary(Component, errorBoundaryProps) {
|
|
33
33
|
var Wrapped = function Wrapped(props) {
|
|
34
34
|
return /*#__PURE__*/React.createElement(ErrorBoundary, Object.assign({
|
|
35
35
|
fallback: /*#__PURE__*/React.createElement(Fallback, null)
|
|
@@ -40,4 +40,6 @@ export default function withErrorBoundary(Component, errorBoundaryProps) {
|
|
|
40
40
|
var name = Component.displayName || Component.name || 'Unknown';
|
|
41
41
|
Wrapped.displayName = "withErrorBoundary(".concat(name, ")");
|
|
42
42
|
return Wrapped;
|
|
43
|
-
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export default withErrorBoundary;
|
package/package.json
CHANGED
package/release-build.sh
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
#! /bin/sh
|
|
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
|
+
|
|
11
|
+
npm run build
|
|
12
|
+
if [ $? -eq 0 ]; then
|
|
13
|
+
echo "build success!"
|
|
14
|
+
else
|
|
15
|
+
echo "build failed!"
|
|
16
|
+
exit 1
|
|
17
|
+
fi
|
|
18
|
+
|
|
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
|
|
35
|
+
|
|
36
|
+
git add .
|
|
37
|
+
|
|
38
|
+
git commit -m "新版本构建发布"
|
|
39
|
+
|
|
40
|
+
git pull
|
|
41
|
+
|
|
42
|
+
git push
|
|
43
|
+
|
|
44
|
+
exit 1
|