@cloud-app-dev/vidc 4.0.7 → 4.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -71,7 +71,7 @@ var SinglePlayer = /*#__PURE__*/React.forwardRef(function SinglePlayer(_ref, ref
|
|
|
71
71
|
_useState2 = _slicedToArray(_useState, 2),
|
|
72
72
|
state = _useState2[0],
|
|
73
73
|
setState = _useState2[1];
|
|
74
|
-
var _useToggle = _useToggle3('
|
|
74
|
+
var _useToggle = _useToggle3('fill', 'contain'),
|
|
75
75
|
_useToggle2 = _slicedToArray(_useToggle, 2),
|
|
76
76
|
fit = _useToggle2[0],
|
|
77
77
|
toggle = _useToggle2[1].toggle;
|
|
@@ -3,10 +3,9 @@ import React from 'react';
|
|
|
3
3
|
import CustomRenderSelect from "../CustomRenderSelect";
|
|
4
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
5
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
-
|
|
7
6
|
function RatePick(_ref) {
|
|
8
7
|
var onChange = _ref.onChange,
|
|
9
|
-
|
|
8
|
+
value = _ref.value;
|
|
10
9
|
return /*#__PURE__*/_jsxs(CustomRenderSelect, {
|
|
11
10
|
value: value,
|
|
12
11
|
popupClassName: "rate-select-dropdown ",
|
|
@@ -20,27 +19,26 @@ function RatePick(_ref) {
|
|
|
20
19
|
placement: "topLeft",
|
|
21
20
|
children: [/*#__PURE__*/_jsx(Select.Option, {
|
|
22
21
|
value: 8,
|
|
23
|
-
children: "
|
|
22
|
+
children: "8.0\u500D"
|
|
24
23
|
}), /*#__PURE__*/_jsx(Select.Option, {
|
|
25
24
|
value: 6,
|
|
26
|
-
children: "
|
|
25
|
+
children: "6.0\u500D"
|
|
27
26
|
}), /*#__PURE__*/_jsx(Select.Option, {
|
|
28
27
|
value: 4,
|
|
29
|
-
children: "
|
|
28
|
+
children: "4.0\u500D"
|
|
30
29
|
}), /*#__PURE__*/_jsx(Select.Option, {
|
|
31
30
|
value: 2,
|
|
32
|
-
children: "
|
|
31
|
+
children: "2.0\u500D"
|
|
33
32
|
}), /*#__PURE__*/_jsx(Select.Option, {
|
|
34
33
|
value: 1.5,
|
|
35
|
-
children: "
|
|
34
|
+
children: "1.5\u500D"
|
|
36
35
|
}), /*#__PURE__*/_jsx(Select.Option, {
|
|
37
36
|
value: 1,
|
|
38
|
-
children: "
|
|
37
|
+
children: "1.0\u500D"
|
|
39
38
|
}), /*#__PURE__*/_jsx(Select.Option, {
|
|
40
39
|
value: 0.5,
|
|
41
|
-
children: "
|
|
40
|
+
children: "0.5\u500D"
|
|
42
41
|
})]
|
|
43
42
|
});
|
|
44
43
|
}
|
|
45
|
-
|
|
46
44
|
export default RatePick;
|
|
@@ -58,7 +58,6 @@ function RecordPlayer(_ref) {
|
|
|
58
58
|
fps = _ref.fps,
|
|
59
59
|
seekLoading = _ref.seekLoading,
|
|
60
60
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
61
|
-
console.log(list);
|
|
62
61
|
var _useState = useState(_objectSpread(_objectSpread({}, cloneDeep(defaultState)), {}, {
|
|
63
62
|
screenNum: (_props$defaultScreen = props.defaultScreen) !== null && _props$defaultScreen !== void 0 ? _props$defaultScreen : defaultState.screenNum
|
|
64
63
|
})),
|
|
@@ -363,7 +362,7 @@ function RecordPlayer(_ref) {
|
|
|
363
362
|
children: screenList.map(function (item, index) {
|
|
364
363
|
var _state$modes$getKey;
|
|
365
364
|
var className = state.selectIndex === index ? "item".concat(screenType === null || screenType === void 0 ? void 0 : screenType.name, "-").concat(index + 1, " player-current-index") : "item".concat(screenType === null || screenType === void 0 ? void 0 : screenType.name, "-").concat(index + 1);
|
|
366
|
-
var key = item.date && item.cid
|
|
365
|
+
var key = item.date && item.cid ? getKey(item) : "".concat(index);
|
|
367
366
|
var mode = (_state$modes$getKey = state.modes[getKey(item)]) !== null && _state$modes$getKey !== void 0 ? _state$modes$getKey : item.mode;
|
|
368
367
|
var itemClick = function itemClick() {
|
|
369
368
|
return setState(function (old) {
|
|
@@ -374,44 +373,26 @@ function RecordPlayer(_ref) {
|
|
|
374
373
|
};
|
|
375
374
|
return item.recordType === 1 ? /*#__PURE__*/_createElement(SegmentPlayerWithExt, _objectSpread(_objectSpread({}, item), {}, {
|
|
376
375
|
segments: (item === null || item === void 0 ? void 0 : item.segments) || [],
|
|
377
|
-
key: key
|
|
378
|
-
|
|
379
|
-
,
|
|
380
|
-
className: className
|
|
381
|
-
// className={state.selectIndex === index ? 'player-current-index' : ''}
|
|
382
|
-
,
|
|
376
|
+
key: key,
|
|
377
|
+
className: className,
|
|
383
378
|
updatePlayer: function updatePlayer(player) {
|
|
384
379
|
return _updatePlayer(player, index);
|
|
385
380
|
},
|
|
386
|
-
onClick: itemClick
|
|
387
|
-
|
|
388
|
-
// style={{ width: screenType?.width, height: screenType?.height }}
|
|
389
|
-
,
|
|
390
|
-
mode: mode
|
|
391
|
-
// mode={state.modes[`${item?.date}-${item.cid}`] ?? item.mode}
|
|
392
|
-
,
|
|
381
|
+
onClick: itemClick,
|
|
382
|
+
mode: mode,
|
|
393
383
|
fps: fps,
|
|
394
384
|
fpsDelay: fpsDelay,
|
|
395
385
|
httpLoading: item.loading,
|
|
396
386
|
screenIndex: index
|
|
397
387
|
})) : /*#__PURE__*/_createElement(FrontendPlayerWithExt, _objectSpread(_objectSpread({}, item), {}, {
|
|
398
|
-
className: className
|
|
399
|
-
// className={state.selectIndex === index ? 'player-current-index' : ''}
|
|
400
|
-
,
|
|
388
|
+
className: className,
|
|
401
389
|
segments: (item === null || item === void 0 ? void 0 : item.segments) || [],
|
|
402
390
|
updatePlayer: function updatePlayer(player) {
|
|
403
391
|
return _updatePlayer(player, index);
|
|
404
392
|
},
|
|
405
|
-
onClick: itemClick
|
|
406
|
-
|
|
407
|
-
,
|
|
408
|
-
mode: mode
|
|
409
|
-
// mode={state.modes[`${item?.date}-${item.cid}`] ?? item.mode}
|
|
410
|
-
,
|
|
411
|
-
key: key
|
|
412
|
-
// key={item.date && item.cid ? `${item?.date}-${item.cid}` : `${index}`}
|
|
413
|
-
// style={{ width: screenType?.width, height: screenType?.height }}
|
|
414
|
-
,
|
|
393
|
+
onClick: itemClick,
|
|
394
|
+
mode: mode,
|
|
395
|
+
key: key,
|
|
415
396
|
httpLoading: item.loading,
|
|
416
397
|
getLocalRecordUrl: props.getLocalRecordUrl,
|
|
417
398
|
pluginDownloadUrl: props.pluginDownloadUrl,
|
|
@@ -428,9 +409,7 @@ function RecordPlayer(_ref) {
|
|
|
428
409
|
fit: fit,
|
|
429
410
|
toggleFit: toggleFit,
|
|
430
411
|
getPlayerItem: getPlayerItem,
|
|
431
|
-
screenNum: screenNum
|
|
432
|
-
// mode={segmentItem?.cid ? state.modes[`${segmentItem.cid}-${segmentItem.date}`] : (segmentItem?.mode as PlayModeType)}
|
|
433
|
-
,
|
|
412
|
+
screenNum: screenNum,
|
|
434
413
|
mode: state.modes[getKey(segmentItem)] || segmentItem.mode,
|
|
435
414
|
containerRef: domRef,
|
|
436
415
|
updateState: updateState,
|
|
@@ -1,43 +1,30 @@
|
|
|
1
1
|
import _useToggle3 from "ahooks/es/useToggle";
|
|
2
|
-
|
|
3
2
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
4
|
-
|
|
5
3
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
6
|
-
|
|
7
4
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
8
|
-
|
|
9
5
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
10
|
-
|
|
11
6
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
12
|
-
|
|
13
7
|
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."); }
|
|
14
|
-
|
|
15
8
|
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); }
|
|
16
|
-
|
|
17
|
-
function
|
|
18
|
-
|
|
19
|
-
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; }
|
|
20
|
-
|
|
9
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
10
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
21
11
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
22
|
-
|
|
23
12
|
import { useEffect, useMemo } from 'react';
|
|
24
13
|
export default function useVideoFit(containerRef) {
|
|
25
14
|
var deps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
toggle = _useToggle2[1].toggle;
|
|
31
|
-
|
|
15
|
+
var _useToggle = _useToggle3('fill', 'contain'),
|
|
16
|
+
_useToggle2 = _slicedToArray(_useToggle, 2),
|
|
17
|
+
fit = _useToggle2[0],
|
|
18
|
+
toggle = _useToggle2[1].toggle;
|
|
32
19
|
useEffect(function () {
|
|
33
20
|
if (!containerRef.current) {
|
|
34
21
|
return;
|
|
35
22
|
}
|
|
36
|
-
|
|
37
23
|
var videos = containerRef.current.querySelectorAll('video');
|
|
38
24
|
Array.from(videos).forEach(function (item) {
|
|
39
25
|
item.style.objectFit = fit;
|
|
40
|
-
});
|
|
26
|
+
});
|
|
27
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
41
28
|
}, [].concat(_toConsumableArray(deps), [fit]));
|
|
42
29
|
return useMemo(function () {
|
|
43
30
|
return {
|
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": "4.0.
|
|
5
|
+
"version": "4.0.8",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"docs:deploy": "gh-pages -d docs-dist",
|
|
8
8
|
"build": "npm run entry && father build",
|
|
@@ -66,12 +66,12 @@
|
|
|
66
66
|
"@types/node": "^18.11.11",
|
|
67
67
|
"@types/react": "^18.0.26",
|
|
68
68
|
"@types/react-dom": "^18.0.9",
|
|
69
|
-
"@umijs/lint": "^4.0.
|
|
69
|
+
"@umijs/lint": "^4.0.52",
|
|
70
70
|
"antd": "^5.2.2",
|
|
71
71
|
"babel-plugin-import": "^1.13.5",
|
|
72
|
-
"dumi": "^2.1.
|
|
72
|
+
"dumi": "^2.1.12",
|
|
73
73
|
"eslint": "^8.28.0",
|
|
74
|
-
"father": "^4.1.
|
|
74
|
+
"father": "^4.1.5",
|
|
75
75
|
"gh-pages": "^4.0.0",
|
|
76
76
|
"husky": "^8.0.1",
|
|
77
77
|
"lint-staged": "^13.0.3",
|