@cloud-app-dev/vidc 4.0.4 → 4.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/Player/single_player.js +20 -25
- package/es/ScreenPlayer/ScreenSelect.js +38 -62
- package/es/ScreenPlayer/index.less +32 -40
- package/es/utils.d.ts +1 -1
- package/package.json +2 -2
|
@@ -3,7 +3,6 @@ import _useUpdateEffect from "ahooks/es/useUpdateEffect";
|
|
|
3
3
|
import _useMemoizedFn from "ahooks/es/useMemoizedFn";
|
|
4
4
|
import _useLatest from "ahooks/es/useLatest";
|
|
5
5
|
import _useToggle3 from "ahooks/es/useToggle";
|
|
6
|
-
import _cache from "@cloud-app-dev/utils/es/cache";
|
|
7
6
|
var _excluded = ["className", "url", "type", "hideContrallerBar", "isLive", "errorReloadTimer", "children", "onCanPlayerInit", "extActions"];
|
|
8
7
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9
8
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -18,7 +17,6 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
|
|
|
18
17
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
19
18
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
20
19
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
21
|
-
import { Watermark } from 'antd';
|
|
22
20
|
import React, { useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
23
21
|
import { usePlayerApi } from "./api";
|
|
24
22
|
import { Provider } from "./context";
|
|
@@ -36,7 +34,6 @@ import { getVideoType, playUnload } from "./util";
|
|
|
36
34
|
import "./style/index.less";
|
|
37
35
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
38
36
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
39
|
-
var WatermarkConfig = _cache.getCache('WatermarkConfig', 'session');
|
|
40
37
|
var SinglePlayer = /*#__PURE__*/React.forwardRef(function SinglePlayer(_ref, ref) {
|
|
41
38
|
var _props$reload;
|
|
42
39
|
var className = _ref.className,
|
|
@@ -248,28 +245,26 @@ var SinglePlayer = /*#__PURE__*/React.forwardRef(function SinglePlayer(_ref, ref
|
|
|
248
245
|
container: state.container,
|
|
249
246
|
isLive: isLive,
|
|
250
247
|
isFpsPlay: state.isFpsPlay,
|
|
251
|
-
children: /*#__PURE__*/
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
})
|
|
272
|
-
}))
|
|
248
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
249
|
+
className: "lm-player-container ".concat(className),
|
|
250
|
+
ref: domRef,
|
|
251
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
252
|
+
className: "player-mask-layout",
|
|
253
|
+
children: [/*#__PURE__*/_jsx("video", _objectSpread(_objectSpread({}, videoProps), {}, {
|
|
254
|
+
style: {
|
|
255
|
+
objectFit: fit,
|
|
256
|
+
visibility: state.isFpsPlay ? 'hidden' : 'unset'
|
|
257
|
+
}
|
|
258
|
+
})), hasApiEventInit && hasLink && state.isFpsPlay ? /*#__PURE__*/_jsx(FPSPlay, {
|
|
259
|
+
fps: fps,
|
|
260
|
+
event: event,
|
|
261
|
+
api: playApi,
|
|
262
|
+
fpsDelay: fpsDelay
|
|
263
|
+
}) : /*#__PURE__*/_jsx(Empty, {})]
|
|
264
|
+
}), hasApiEventInit && hasLink ? /*#__PURE__*/_jsx(VideoMessage, {}) : /*#__PURE__*/_jsx(Empty, {}), hasApiEventInit && hasLink && !hideContrallerBar ? /*#__PURE__*/_jsx(ContrallerEvent, {
|
|
265
|
+
children: /*#__PURE__*/_jsx(ContrallerBar, _objectSpread({}, contrallerProps))
|
|
266
|
+
}) : /*#__PURE__*/_jsx(Empty, {}), hasApiEventInit ? customTimeLine ? customTimeLine : !hideContrallerBar ? /*#__PURE__*/_jsx(Timeline, {}) : /*#__PURE__*/_jsx(Empty, {}) : /*#__PURE__*/_jsx(Empty, {}), children]
|
|
267
|
+
})
|
|
273
268
|
});
|
|
274
269
|
});
|
|
275
270
|
SinglePlayer.defaultProps = {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Select } from 'antd';
|
|
2
2
|
import React, { useMemo } from 'react';
|
|
3
|
+
import CustomRenderSelect from "../CustomRenderSelect";
|
|
3
4
|
import IconFont from "../Player/iconfont";
|
|
4
5
|
import { ScreenType } from "./utils";
|
|
5
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -13,71 +14,46 @@ function ScreenSelect(_ref) {
|
|
|
13
14
|
return v.name === screenNum;
|
|
14
15
|
})) === null || _ScreenType$find === void 0 ? void 0 : _ScreenType$find.icon;
|
|
15
16
|
}, [screenNum]);
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
className: "ant-select-item ant-select-item-option",
|
|
22
|
-
style: item.name === screenNum ? {
|
|
23
|
-
color: 'var(--primary)',
|
|
24
|
-
backgroundColor: 'var(--form-bg-light)'
|
|
25
|
-
} : {},
|
|
26
|
-
onClick: function onClick() {
|
|
27
|
-
updateState({
|
|
28
|
-
screenNum: item.name
|
|
29
|
-
});
|
|
30
|
-
},
|
|
31
|
-
children: [/*#__PURE__*/_jsx("span", {
|
|
32
|
-
style: {
|
|
33
|
-
paddingRight: 4,
|
|
34
|
-
color: 'var(--icon)',
|
|
35
|
-
position: 'relative',
|
|
36
|
-
top: 1
|
|
37
|
-
},
|
|
38
|
-
children: /*#__PURE__*/_jsx(IconFont, {
|
|
39
|
-
type: item.icon
|
|
40
|
-
})
|
|
41
|
-
}), item.name, "\u5206\u5C4F"]
|
|
42
|
-
}, "".concat(item.name));
|
|
43
|
-
})
|
|
44
|
-
});
|
|
45
|
-
};
|
|
46
|
-
return (
|
|
47
|
-
/*#__PURE__*/
|
|
48
|
-
// <CustomRenderSelect
|
|
49
|
-
// value={screenNum}
|
|
50
|
-
// popupClassName="custom-select-dropdown "
|
|
51
|
-
// customRender={() => (
|
|
52
|
-
// <span className="select-current-screen-item">
|
|
53
|
-
// <IconFont type={icon} />
|
|
54
|
-
// </span>
|
|
55
|
-
// )}
|
|
56
|
-
// onChange={(v) => updateState({ screenNum: v })}
|
|
57
|
-
// placement="topLeft"
|
|
58
|
-
// >
|
|
59
|
-
// {ScreenType.map((item) => (
|
|
60
|
-
// <Select.Option key={`${item.name}`} value={item.name}>
|
|
61
|
-
// <span style={{ paddingRight: 4, color: 'var(--icon)', position: 'relative', top: 1 }}>
|
|
62
|
-
// <IconFont type={item.icon} />
|
|
63
|
-
// </span>
|
|
64
|
-
// {item.name}分屏
|
|
65
|
-
// </Select.Option>
|
|
66
|
-
// ))}
|
|
67
|
-
// </CustomRenderSelect>
|
|
68
|
-
_jsx(Popover, {
|
|
69
|
-
trigger: "hover",
|
|
70
|
-
content: getScreenOptions,
|
|
71
|
-
getPopupContainer: function getPopupContainer(node) {
|
|
72
|
-
return node;
|
|
73
|
-
},
|
|
74
|
-
children: /*#__PURE__*/_jsx("span", {
|
|
17
|
+
return /*#__PURE__*/_jsx(CustomRenderSelect, {
|
|
18
|
+
value: screenNum,
|
|
19
|
+
popupClassName: "custom-select-dropdown ",
|
|
20
|
+
customRender: function customRender() {
|
|
21
|
+
return /*#__PURE__*/_jsx("span", {
|
|
75
22
|
className: "select-current-screen-item",
|
|
76
23
|
children: /*#__PURE__*/_jsx(IconFont, {
|
|
77
24
|
type: icon
|
|
78
25
|
})
|
|
79
|
-
})
|
|
26
|
+
});
|
|
27
|
+
},
|
|
28
|
+
onChange: function onChange(v) {
|
|
29
|
+
return updateState({
|
|
30
|
+
screenNum: v
|
|
31
|
+
});
|
|
32
|
+
},
|
|
33
|
+
placement: "topLeft",
|
|
34
|
+
children: ScreenType.map(function (item) {
|
|
35
|
+
return /*#__PURE__*/_jsxs(Select.Option, {
|
|
36
|
+
value: item.name,
|
|
37
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
38
|
+
style: {
|
|
39
|
+
paddingRight: 4,
|
|
40
|
+
color: 'var(--icon)',
|
|
41
|
+
position: 'relative',
|
|
42
|
+
top: 1
|
|
43
|
+
},
|
|
44
|
+
children: /*#__PURE__*/_jsx(IconFont, {
|
|
45
|
+
type: item.icon
|
|
46
|
+
})
|
|
47
|
+
}), item.name, "\u5206\u5C4F"]
|
|
48
|
+
}, "".concat(item.name));
|
|
80
49
|
})
|
|
81
|
-
)
|
|
50
|
+
})
|
|
51
|
+
// <Popover trigger="hover" content={getScreenOptions} getPopupContainer={(node) => node}>
|
|
52
|
+
// <span className="select-current-screen-item">
|
|
53
|
+
// <IconFont type={icon} />
|
|
54
|
+
// </span>
|
|
55
|
+
// </Popover>
|
|
56
|
+
;
|
|
82
57
|
}
|
|
58
|
+
|
|
83
59
|
export default ScreenSelect;
|
|
@@ -4,15 +4,10 @@
|
|
|
4
4
|
box-sizing: border-box;
|
|
5
5
|
user-select: none;
|
|
6
6
|
min-width: 600px;
|
|
7
|
-
|
|
8
7
|
.player-layout {
|
|
9
8
|
height: calc(100% - 88px);
|
|
10
|
-
|
|
11
9
|
.player-with-ext-layout {
|
|
12
|
-
float: left;
|
|
13
|
-
|
|
14
10
|
.lm-player-ext-layout {
|
|
15
|
-
height: 100%;
|
|
16
11
|
border: 1px solid var(--gray12);
|
|
17
12
|
box-sizing: border-box;
|
|
18
13
|
}
|
|
@@ -24,7 +19,6 @@
|
|
|
24
19
|
}
|
|
25
20
|
}
|
|
26
21
|
}
|
|
27
|
-
|
|
28
22
|
&.split-screen-player-live-wrapper {
|
|
29
23
|
.player-layout {
|
|
30
24
|
height: calc(100% - 42px);
|
|
@@ -186,7 +180,7 @@
|
|
|
186
180
|
/* ------------------------6分屏---------------------- */
|
|
187
181
|
.container6 {
|
|
188
182
|
display: grid;
|
|
189
|
-
grid-template-columns: repeat(3, 33.
|
|
183
|
+
grid-template-columns: repeat(3, 33.33333333%);
|
|
190
184
|
grid-template-rows: repeat(2, 50%);
|
|
191
185
|
grid-auto-flow: row dense; //排列顺序先行后列 紧密排列
|
|
192
186
|
place-content: center;
|
|
@@ -195,67 +189,66 @@
|
|
|
195
189
|
/* -----------------------8分屏---------------------- */
|
|
196
190
|
.container8 {
|
|
197
191
|
display: grid;
|
|
198
|
-
grid-template-columns: repeat(
|
|
199
|
-
grid-template-rows: repeat(
|
|
192
|
+
grid-template-columns: repeat(24, 4.166666666666667%);
|
|
193
|
+
grid-template-rows: repeat(24, 4.166666666666667%);
|
|
200
194
|
grid-auto-flow: row dense; //排列顺序先行后列 紧密排列
|
|
201
195
|
place-content: center;
|
|
202
196
|
}
|
|
203
197
|
|
|
204
198
|
.item8-1 {
|
|
205
199
|
grid-column-start: 1;
|
|
206
|
-
grid-column-end:
|
|
200
|
+
grid-column-end: 13;
|
|
207
201
|
grid-row-start: 1;
|
|
208
|
-
grid-row-end:
|
|
202
|
+
grid-row-end: 13;
|
|
209
203
|
}
|
|
210
204
|
|
|
211
205
|
.item8-2 {
|
|
212
|
-
grid-column-start:
|
|
213
|
-
grid-column-end:
|
|
206
|
+
grid-column-start: 13;
|
|
207
|
+
grid-column-end: 19;
|
|
214
208
|
grid-row-start: 1;
|
|
215
|
-
grid-row-end:
|
|
209
|
+
grid-row-end: 9;
|
|
216
210
|
}
|
|
217
211
|
|
|
218
212
|
.item8-3 {
|
|
219
|
-
grid-column-start:
|
|
220
|
-
grid-column-end:
|
|
213
|
+
grid-column-start: 19;
|
|
214
|
+
grid-column-end: 25;
|
|
221
215
|
grid-row-start: 1;
|
|
222
|
-
grid-row-end:
|
|
216
|
+
grid-row-end: 9;
|
|
223
217
|
}
|
|
224
218
|
|
|
225
219
|
.item8-4 {
|
|
226
|
-
grid-column-start:
|
|
227
|
-
grid-column-end:
|
|
228
|
-
grid-row-start:
|
|
229
|
-
grid-row-end:
|
|
220
|
+
grid-column-start: 13;
|
|
221
|
+
grid-column-end: 19;
|
|
222
|
+
grid-row-start: 9;
|
|
223
|
+
grid-row-end: 17;
|
|
230
224
|
}
|
|
231
225
|
|
|
232
226
|
.item8-5 {
|
|
233
|
-
|
|
234
|
-
grid-column-
|
|
235
|
-
grid-
|
|
236
|
-
grid-row-
|
|
237
|
-
grid-row-end: 563;
|
|
227
|
+
grid-column-start: 19;
|
|
228
|
+
grid-column-end: 25;
|
|
229
|
+
grid-row-start: 9;
|
|
230
|
+
grid-row-end: 17;
|
|
238
231
|
}
|
|
239
232
|
|
|
240
233
|
.item8-6 {
|
|
241
|
-
grid-column-start:
|
|
242
|
-
grid-column-end:
|
|
243
|
-
grid-row-start:
|
|
244
|
-
grid-row-end:
|
|
234
|
+
grid-column-start: 1;
|
|
235
|
+
grid-column-end: 13;
|
|
236
|
+
grid-row-start: 13;
|
|
237
|
+
grid-row-end: 25;
|
|
245
238
|
}
|
|
246
239
|
|
|
247
240
|
.item8-7 {
|
|
248
|
-
grid-column-start:
|
|
249
|
-
grid-column-end:
|
|
250
|
-
grid-row-start:
|
|
251
|
-
grid-row-end:
|
|
241
|
+
grid-column-start: 13;
|
|
242
|
+
grid-column-end: 19;
|
|
243
|
+
grid-row-start: 17;
|
|
244
|
+
grid-row-end: 25;
|
|
252
245
|
}
|
|
253
246
|
|
|
254
247
|
.item8-8 {
|
|
255
|
-
grid-column-start:
|
|
256
|
-
grid-column-end:
|
|
257
|
-
grid-row-start:
|
|
258
|
-
grid-row-end:
|
|
248
|
+
grid-column-start: 19;
|
|
249
|
+
grid-column-end: 25;
|
|
250
|
+
grid-row-start: 17;
|
|
251
|
+
grid-row-end: 25;
|
|
259
252
|
}
|
|
260
253
|
|
|
261
254
|
/* ------------------------9分屏---------------------- */
|
|
@@ -291,7 +284,6 @@
|
|
|
291
284
|
grid-row-end: 3;
|
|
292
285
|
}
|
|
293
286
|
|
|
294
|
-
|
|
295
287
|
/* ------------------------13分屏---------------------- */
|
|
296
288
|
|
|
297
289
|
.container13 {
|
|
@@ -360,4 +352,4 @@
|
|
|
360
352
|
cursor: pointer;
|
|
361
353
|
border: 1px solid var(--gray1);
|
|
362
354
|
border-radius: 2px;
|
|
363
|
-
}
|
|
355
|
+
}
|
package/es/utils.d.ts
CHANGED
|
@@ -10,5 +10,5 @@ declare const getEleScrollHeight: (el: Document | Element) => number;
|
|
|
10
10
|
export declare const getHeader: () => {
|
|
11
11
|
Authorization: any;
|
|
12
12
|
};
|
|
13
|
-
declare function likeGo<T>(fn: () => Promise<T>): Promise<[T,
|
|
13
|
+
declare function likeGo<T, S>(fn: () => Promise<T>): Promise<[T, S]>;
|
|
14
14
|
export { getScrollTop, getScrollHeight, getClientHeight, getEleScrollHeight, likeGo };
|
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.5",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"docs:deploy": "gh-pages -d docs-dist",
|
|
8
8
|
"build": "npm run entry && father build",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"@types/react": "^18.0.26",
|
|
68
68
|
"@types/react-dom": "^18.0.9",
|
|
69
69
|
"@umijs/lint": "^4.0.36",
|
|
70
|
-
"antd": "^5.
|
|
70
|
+
"antd": "^5.2.2",
|
|
71
71
|
"babel-plugin-import": "^1.13.5",
|
|
72
72
|
"dumi": "^2.1.10",
|
|
73
73
|
"eslint": "^8.28.0",
|