@cloud-app-dev/vidc 3.0.6 → 3.0.7

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.
@@ -3,7 +3,6 @@ import "./index.css";
3
3
  export default function DisableMark(_ref) {
4
4
  var children = _ref.children,
5
5
  disabled = _ref.disabled;
6
- console.log(disabled);
7
6
  return /*#__PURE__*/React.createElement(React.Fragment, null, disabled ? /*#__PURE__*/React.createElement("div", {
8
7
  className: "disable-mark"
9
8
  }) : null, children);
@@ -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; }
@@ -57,7 +59,8 @@ function RecordPlayer(_ref) {
57
59
  currentTimes: [],
58
60
  loading: false,
59
61
  seekTo: 0,
60
- mergeSegments: []
62
+ mergeSegments: [],
63
+ timeMode: 24
61
64
  }),
62
65
  _useState2 = _slicedToArray(_useState, 2),
63
66
  state = _useState2[0],
@@ -202,6 +205,10 @@ function RecordPlayer(_ref) {
202
205
  obj.mode = newState.mode;
203
206
  }
204
207
 
208
+ if (newState.hasOwnProperty('timeMode')) {
209
+ obj.timeMode = newState.timeMode;
210
+ }
211
+
205
212
  setState(function (old) {
206
213
  return Object.assign(Object.assign({}, old), obj);
207
214
  });
@@ -213,7 +220,7 @@ function RecordPlayer(_ref) {
213
220
  */
214
221
 
215
222
 
216
- var onTimeChange = useCallback(function (time) {
223
+ var onTimeChange = useCallback(function (time, outTimeline) {
217
224
  return __awaiter(_this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
218
225
  var index, segments;
219
226
  return _regeneratorRuntime().wrap(function _callee$(_context) {
@@ -228,23 +235,34 @@ function RecordPlayer(_ref) {
228
235
  return _context.abrupt("return");
229
236
 
230
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:
231
249
  index = segmentItem.segments.findIndex(function (v) {
232
250
  return time >= v.beginTime && time < v.endTime;
233
251
  });
234
252
 
235
253
  if (!(index === -1)) {
236
- _context.next = 8;
254
+ _context.next = 11;
237
255
  break;
238
256
  }
239
257
 
240
- _context.next = 6;
258
+ _context.next = 9;
241
259
  return queryRecord({
242
260
  cid: segmentItem.cid,
243
261
  date: time,
244
262
  recordType: segmentItem.recordType
245
263
  });
246
264
 
247
- case 6:
265
+ case 9:
248
266
  segments = _context.sent;
249
267
  setState(function (old) {
250
268
  return Object.assign(Object.assign({}, old), {
@@ -252,7 +270,7 @@ function RecordPlayer(_ref) {
252
270
  });
253
271
  });
254
272
 
255
- case 8:
273
+ case 11:
256
274
  //更新time
257
275
  setState(function (old) {
258
276
  var mergeSegments = old.mergeSegments;
@@ -273,7 +291,7 @@ function RecordPlayer(_ref) {
273
291
  });
274
292
  });
275
293
 
276
- case 9:
294
+ case 12:
277
295
  case "end":
278
296
  return _context.stop();
279
297
  }
@@ -288,11 +306,10 @@ function RecordPlayer(_ref) {
288
306
  setState(function (old) {
289
307
  return Object.assign({}, old);
290
308
  });
291
- };
292
-
293
- console.log(segmentItem.cid); // index变化同步到父组件
309
+ }; // index变化同步到父组件
294
310
  // eslint-disable-next-line react-hooks/exhaustive-deps
295
311
 
312
+
296
313
  useEffect(function () {
297
314
  return onIndexChange(state.selectIndex);
298
315
  }, [state.selectIndex]);
@@ -357,12 +374,15 @@ function RecordPlayer(_ref) {
357
374
  updateState: updateState,
358
375
  onTimeChange: onTimeChange,
359
376
  onClose: onClose,
360
- onCloseAll: onCloseAll
377
+ onCloseAll: onCloseAll,
378
+ timeMode: state.timeMode
361
379
  }), /*#__PURE__*/React.createElement(SegmentTimeLine, {
362
380
  begin: timeBegin,
381
+ updateState: updateState,
363
382
  timeCell: segmentItem.segments,
364
383
  key: state.selectIndex,
365
- onTimeChange: onTimeChange
384
+ onTimeChange: onTimeChange,
385
+ timeMode: state.timeMode
366
386
  }))), children && /*#__PURE__*/React.cloneElement(children, {
367
387
  selectIndex: state.selectIndex
368
388
  }));
@@ -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;
@@ -16,6 +17,7 @@ interface IToolsProps {
16
17
  onTimeChange?: (time: number) => void;
17
18
  onClose?: () => void;
18
19
  onCloseAll?: () => void;
20
+ timeMode: number;
19
21
  }
20
- declare function RecordTools({ containerRef, updateState, screenNum, getPlayerItem, mode, toggleFit, fit, time, onTimeChange, onClose, onCloseAll }: IToolsProps): JSX.Element;
22
+ declare function RecordTools({ containerRef, updateState, screenNum, timeMode, getPlayerItem, mode, toggleFit, fit, time, onTimeChange, onClose, onCloseAll }: IToolsProps): JSX.Element;
21
23
  export default RecordTools;
@@ -17,11 +17,13 @@ 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,
24
25
  screenNum = _ref.screenNum,
26
+ timeMode = _ref.timeMode,
25
27
  getPlayerItem = _ref.getPlayerItem,
26
28
  mode = _ref.mode,
27
29
  toggleFit = _ref.toggleFit,
@@ -153,7 +155,14 @@ function RecordTools(_ref) {
153
155
  }) : /*#__PURE__*/React.createElement(IconFont, {
154
156
  type: "lm-player-Full_Main",
155
157
  title: "\u5168\u5C4F"
156
- }))));
158
+ })), /*#__PURE__*/React.createElement(TimeMode, {
159
+ timeMode: timeMode,
160
+ onChange: function onChange(m) {
161
+ return updateState({
162
+ timeMode: m
163
+ });
164
+ }
165
+ })));
157
166
  }
158
167
 
159
168
  export default RecordTools;
@@ -4,6 +4,10 @@ interface ISegmentTimeLineProps {
4
4
  begin?: number;
5
5
  timeCell?: ISegmentType[];
6
6
  onTimeChange?: (time: number) => void;
7
+ timeMode: number;
8
+ updateState: (state: {
9
+ timeMode: number;
10
+ }) => void;
7
11
  }
8
- declare function SegmentTimeLine({ begin, timeCell, onTimeChange }: ISegmentTimeLineProps): JSX.Element;
12
+ declare function SegmentTimeLine({ begin, timeCell, onTimeChange, timeMode }: ISegmentTimeLineProps): JSX.Element;
9
13
  export default SegmentTimeLine;
@@ -7,7 +7,8 @@ import TimeSlider from './TimeSlider';
7
7
  function SegmentTimeLine(_ref) {
8
8
  var begin = _ref.begin,
9
9
  timeCell = _ref.timeCell,
10
- onTimeChange = _ref.onTimeChange;
10
+ onTimeChange = _ref.onTimeChange,
11
+ timeMode = _ref.timeMode;
11
12
  var ref = useRef();
12
13
 
13
14
  var size = _useSize(ref);
@@ -25,14 +26,15 @@ function SegmentTimeLine(_ref) {
25
26
  }).valueOf();
26
27
  var timeLine = new TimeSlider(ref.current, {
27
28
  onTimeChange: run,
28
- start_timestamp: time - 12 * 3600 * 1000,
29
+ start_timestamp: time - timeMode / 2 * 3600 * 1000,
29
30
  current_timestamp: time,
30
- timecell: timeCell
31
+ timecell: timeCell,
32
+ hours_per_ruler: timeMode
31
33
  });
32
34
  return function () {
33
35
  return timeLine.destory();
34
36
  };
35
- }, [begin, timeCell, size === null || size === void 0 ? void 0 : size.width, run]);
37
+ }, [begin, timeCell, size === null || size === void 0 ? void 0 : size.width, run, timeMode]);
36
38
  return /*#__PURE__*/React.createElement("div", {
37
39
  className: "record-time-line"
38
40
  }, /*#__PURE__*/React.createElement("canvas", {
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ interface ITimeModeProps {
3
+ timeMode: number;
4
+ onChange: (timeMode: number) => void;
5
+ }
6
+ declare function TimeMode({ timeMode, onChange }: ITimeModeProps): JSX.Element;
7
+ export default TimeMode;
@@ -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;
@@ -57,7 +57,6 @@ function TimeSelect(_ref) {
57
57
  minutes: values[1],
58
58
  seconds: values[2]
59
59
  }).valueOf();
60
- console.log(values, newTime);
61
60
  onChange && onChange(newTime);
62
61
  };
63
62
 
@@ -4,7 +4,7 @@ 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
8
  }
9
9
  export declare type TimeCellItem = ISegmentType;
10
10
  export default class TimeSlider {
@@ -103,7 +103,7 @@ var TimeSlider = /*#__PURE__*/function () {
103
103
  _this.drawLine(pos_x, 20, pos_x, _this.canVansH, hoverLineColor, 1);
104
104
 
105
105
  _this.ctx.fillStyle = hoverLineColor;
106
- _this.ctx.font = "10px Arial";
106
+ _this.ctx.font = '10px Arial';
107
107
 
108
108
  _this.ctx.fillText(_this.changeTime(current_timestamp), pos_x - 50, 12);
109
109
  }
@@ -131,18 +131,15 @@ var TimeSlider = /*#__PURE__*/function () {
131
131
 
132
132
  var timecellItem = _this.timecell.find(function (v) {
133
133
  return current_timestamp >= v.beginTime && current_timestamp < v.endTime;
134
- });
134
+ }); // 当前片段没有录像的时候
135
135
 
136
- if (timecellItem && !timecellItem.url) {
137
- // 无录像轴 不让点击
138
- return;
139
- }
140
136
 
137
+ var outTimeline = timecellItem && !timecellItem.url;
141
138
  _this.current_timestamp = current_timestamp;
142
139
 
143
140
  _this.set_time_to_middle(_this.current_timestamp);
144
141
 
145
- _this.options.onTimeChange && _this.options.onTimeChange(current_timestamp);
142
+ _this.options.onTimeChange && _this.options.onTimeChange(current_timestamp, outTimeline);
146
143
  }
147
144
 
148
145
  document.removeEventListener('mousemove', _this.mousemoveFunc);
@@ -233,7 +230,7 @@ var TimeSlider = /*#__PURE__*/function () {
233
230
  this.options = options;
234
231
  this.canvansW = this.canvas.width = this.canvas.clientWidth;
235
232
  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;
233
+ this.zoom = this.hours_per_ruler = (_a = this.options.hours_per_ruler) !== null && _a !== void 0 ? _a : this.hours_per_ruler;
237
234
  this.start_timestamp = (_b = this.options.start_timestamp) !== null && _b !== void 0 ? _b : this.start_timestamp;
238
235
  this.current_timestamp = (_c = this.options.current_timestamp) !== null && _c !== void 0 ? _c : this.current_timestamp;
239
236
  this.timecell = (_d = this.options.timecell) !== null && _d !== void 0 ? _d : this.timecell;
@@ -360,13 +357,13 @@ var TimeSlider = /*#__PURE__*/function () {
360
357
  lineH = 10;
361
358
  var big_date = this.graduation_title(date);
362
359
  this.ctx.fillStyle = normalLineColor;
363
- this.ctx.font = "10px Arial";
360
+ this.ctx.font = '10px Arial';
364
361
  this.ctx.fillText(big_date, graduation_left - 12, 30);
365
362
  } else if (graduation_time / (60 * 1000) % medium_step === 0) {
366
363
  lineH = 10;
367
364
  var middle_date = this.graduation_title(date);
368
365
  this.ctx.fillStyle = normalLineColor;
369
- this.ctx.font = "10px Arial";
366
+ this.ctx.font = '10px Arial';
370
367
  this.ctx.fillText(middle_date, graduation_left - (middle_date.length > 5 ? 24 : 12), 30);
371
368
  } else {
372
369
  lineH = 5;
@@ -105,3 +105,20 @@
105
105
  justify-content: space-around;
106
106
  align-items: center;
107
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
+ }
@@ -73,6 +73,11 @@ export interface IRecordPlayerState {
73
73
  * 加载中,用于拦截多次时间轴变化需要加载片段的情况
74
74
  */
75
75
  loading?: boolean;
76
+
77
+ /**
78
+ * 录像时间轴单页绘制时长单位(hour)
79
+ */
80
+ timeMode:number
76
81
  }
77
82
 
78
83
  export type ScreenItemLivePlayerType = {
@@ -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
  /**
@@ -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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "private": false,
3
3
  "name": "@cloud-app-dev/vidc",
4
4
  "description": "Video Image Data Componennts",
5
- "version": "3.0.6",
5
+ "version": "3.0.7",
6
6
  "scripts": {
7
7
  "start": "dumi dev",
8
8
  "docs:build": "dumi build",