@cloud-app-dev/vidc 3.0.4 → 3.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/.umirc.ts +12 -7
- package/es/Drawer/index.css +1 -0
- package/es/Map/AMap.d.ts +14 -1
- package/es/Map/BasicMap/AMapInstance.js +18 -2
- package/es/Map/Config/utils.js +2 -2
- package/es/Player/demo.js +4 -3
- package/es/Player/iconfont.d.ts +1 -1
- package/es/Player/iconfont.js +1 -1
- package/es/Player/style/iconfont.ttf +0 -0
- package/es/Player/style/iconfont.woff +0 -0
- package/es/Player/style/iconfont.woff2 +0 -0
- package/es/ScreenPlayer/LiveTools.js +79 -46
- package/es/ScreenPlayer/PlayerWithExt.js +0 -3
- package/es/ScreenPlayer/Record.js +14 -4
- package/es/ScreenPlayer/RecordTools.d.ts +3 -1
- package/es/ScreenPlayer/RecordTools.js +99 -46
- package/es/ScreenPlayer/ScreenSelect.d.ts +7 -0
- package/es/ScreenPlayer/ScreenSelect.js +28 -0
- package/es/ScreenPlayer/SegmentTimeLine.js +8 -2
- package/es/ScreenPlayer/TimeSelect.d.ts +7 -0
- package/es/ScreenPlayer/TimeSelect.js +129 -0
- package/es/ScreenPlayer/demo.d.ts +1 -1
- package/es/ScreenPlayer/demo.js +7 -3
- package/es/ScreenPlayer/demo2.js +1 -1
- package/es/ScreenPlayer/index.css +58 -1
- package/es/Timeout/index.d.ts +8 -9
- package/es/Timeout/index.js +17 -23
- package/package.json +1 -1
package/.umirc.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { defineConfig } from 'dumi';
|
|
|
2
2
|
import path from 'path';
|
|
3
3
|
|
|
4
4
|
const token =
|
|
5
|
-
'eyJhbGciOiJIUzI1NiJ9.
|
|
5
|
+
'eyJhbGciOiJIUzI1NiJ9.eyJvcmdhbml6YXRpb25JZCI6IjEwMDEwMTAwMDQ0NSIsImV4dCI6MTY2MTY1NjgzMTU3MywidWlkIjoiMTAxMDAwMDAwNjk5IiwidmFsaWRTdGF0ZSI6MTA0NDA2LCJyb2xlSWQiOlsxMDAwMDAxMTA1MTgsMTAwMDAwMTEwNzI4XSwidmFsaWRUaW1lIjoxNzA0MzgzOTk5MDAwLCJvcHRDZW50ZXJJZCI6IjEwMDEwMDAwMDIzMyIsInVzZXJUeXBlIjoxMDA3MDQsImlhdCI6MTY2MTM5NzYzMTU3M30.OWPxfPgFBWqGJaRsYLSAZohn2AarhbkOuWLa1bwgZE4';
|
|
6
6
|
|
|
7
7
|
export default defineConfig({
|
|
8
8
|
title: 'CloudApp VIDC',
|
|
@@ -39,12 +39,17 @@ export default defineConfig({
|
|
|
39
39
|
},
|
|
40
40
|
},
|
|
41
41
|
},
|
|
42
|
-
mfsu:
|
|
43
|
-
development
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
mfsu:
|
|
43
|
+
process.env.NODE_ENV === 'development'
|
|
44
|
+
? {
|
|
45
|
+
development: {
|
|
46
|
+
output: './.mfsu/dev',
|
|
47
|
+
},
|
|
48
|
+
production: {
|
|
49
|
+
output: './.mfsu/prod',
|
|
50
|
+
},
|
|
51
|
+
}
|
|
52
|
+
: undefined,
|
|
48
53
|
scripts: ['//at.alicdn.com/t/font_1724012_972m5d05cou.js'],
|
|
49
54
|
styles: [
|
|
50
55
|
`:root{
|
package/es/Drawer/index.css
CHANGED
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
.lm-drawer-container.cloudapp-drawer .cloudapp-drawer-header .cloudapp-drawer-title {
|
|
18
18
|
color: inherit;
|
|
19
19
|
font-size: var(--fs-large);
|
|
20
|
+
line-height: 2em;
|
|
20
21
|
}
|
|
21
22
|
.lm-drawer-container.cloudapp-drawer .cloudapp-drawer-header .cloudapp-drawer-close {
|
|
22
23
|
padding: 0;
|
package/es/Map/AMap.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-use-before-define */
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
1
3
|
declare global {
|
|
2
4
|
namespace AMap {
|
|
3
5
|
/**
|
|
@@ -75,6 +77,7 @@ declare global {
|
|
|
75
77
|
* @param {boolean} [opts.geodesic=false] 是否绘制成大地线,默认false
|
|
76
78
|
* @param {boolean} [opts.showDir=false] 是否延路径显示白色方向箭头,默认false。建议折线宽度大于6时使用
|
|
77
79
|
*/
|
|
80
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
78
81
|
export class BezierCurve extends CombinePolyline<Required<BezierCurveOptions>> {
|
|
79
82
|
_prevZoom: number;
|
|
80
83
|
readonly className: OverlayType;
|
|
@@ -364,6 +367,7 @@ declare global {
|
|
|
364
367
|
* });
|
|
365
368
|
* map.addLayer(buildingLayer);
|
|
366
369
|
*/
|
|
370
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
367
371
|
export class BuildingLayer extends BuildingLayer_2 {
|
|
368
372
|
constructor(opts?: Partial<BuildingLayerOpts> | any);
|
|
369
373
|
/**
|
|
@@ -406,6 +410,7 @@ declare global {
|
|
|
406
410
|
/**
|
|
407
411
|
* @public
|
|
408
412
|
*/
|
|
413
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
409
414
|
class BuildingLayer_2 extends Layer {
|
|
410
415
|
CLASS_NAME: string;
|
|
411
416
|
constructor();
|
|
@@ -464,6 +469,7 @@ declare global {
|
|
|
464
469
|
* @extends {ImageLayer}
|
|
465
470
|
* @public
|
|
466
471
|
*/
|
|
472
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
467
473
|
export class CanvasLayer extends CoreImageLayer {
|
|
468
474
|
constructor(opts?: CanvasLayerOptions);
|
|
469
475
|
/**
|
|
@@ -549,6 +555,7 @@ declare global {
|
|
|
549
555
|
* 虚线:[10,10] ,[10,10] 表示10个像素的实线和10个像素的空白(如此反复)组成的虚线
|
|
550
556
|
* 点画线:[10,2,10], [10,2,10] 表示10个像素的实线和2个像素的空白 + 10个像素的实线和10个像素的空白 (如此反复)组成的虚线
|
|
551
557
|
*/
|
|
558
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
552
559
|
export class Circle extends CombinePolygon<Required<CircleOptions>> {
|
|
553
560
|
readonly className: OverlayType;
|
|
554
561
|
|
|
@@ -642,6 +649,7 @@ declare global {
|
|
|
642
649
|
* @param {boolean} [opts.draggable=false] 设置多边形是否可拖拽移动,默认为false
|
|
643
650
|
* @param {object} [opts.extData] 用户自定义属性,支持JavaScript API任意数据类型,如Polygon的id等
|
|
644
651
|
*/
|
|
652
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
645
653
|
export class CircleMarker extends CoreCircleMarker {
|
|
646
654
|
className: OverlayType;
|
|
647
655
|
|
|
@@ -731,6 +739,7 @@ declare global {
|
|
|
731
739
|
* @public
|
|
732
740
|
* @private
|
|
733
741
|
*/
|
|
742
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define, @typescript-eslint/no-unused-vars
|
|
734
743
|
abstract class CombinePolygon<T = any> extends CorePolygon {
|
|
735
744
|
abstract setOptions(optsArg: any): void;
|
|
736
745
|
/**
|
|
@@ -5054,7 +5063,11 @@ declare global {
|
|
|
5054
5063
|
export class MarkerCluster extends Event {
|
|
5055
5064
|
constructor(map: AMap.Map, dataOtions: any[], MarkerClusterOptions: MarkerClusterOptions);
|
|
5056
5065
|
setData(data: any[]);
|
|
5057
|
-
|
|
5066
|
+
}
|
|
5067
|
+
|
|
5068
|
+
export class ControlBar extends Control {
|
|
5069
|
+
constructor(options: any);
|
|
5070
|
+
addTo(map: AMap.Map): void;
|
|
5058
5071
|
}
|
|
5059
5072
|
|
|
5060
5073
|
/**
|
|
@@ -16,16 +16,32 @@ var AMapInstance = /*#__PURE__*/function () {
|
|
|
16
16
|
_createClass(AMapInstance, [{
|
|
17
17
|
key: "createMap",
|
|
18
18
|
value: function createMap() {
|
|
19
|
+
var _this = this;
|
|
20
|
+
|
|
19
21
|
var _a;
|
|
20
22
|
|
|
21
23
|
this.map = new AMap.Map(this.mapContainer, {
|
|
22
|
-
viewMode: '
|
|
24
|
+
viewMode: '3D',
|
|
23
25
|
zoom: this.config.zoom,
|
|
24
26
|
center: this.config.center,
|
|
25
|
-
|
|
27
|
+
rotateEnable: true,
|
|
28
|
+
pitchEnable: true,
|
|
29
|
+
pitch: 50,
|
|
30
|
+
rotation: -15,
|
|
31
|
+
zooms: [2, 20],
|
|
26
32
|
resizeEnable: true,
|
|
27
33
|
mapStyle: "amap://styles/".concat((_a = this.config.amapStyle) !== null && _a !== void 0 ? _a : 'normal')
|
|
28
34
|
});
|
|
35
|
+
AMap.plugin(['AMap.ControlBar'], function () {
|
|
36
|
+
var controlBar = new AMap.ControlBar({
|
|
37
|
+
position: {
|
|
38
|
+
right: '10px',
|
|
39
|
+
top: '10px'
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
_this.map.addControl(controlBar);
|
|
44
|
+
});
|
|
29
45
|
}
|
|
30
46
|
}, {
|
|
31
47
|
key: "destoryMap",
|
package/es/Map/Config/utils.js
CHANGED
|
@@ -10,7 +10,7 @@ var localconfig = {
|
|
|
10
10
|
center: [118.767413, 32.041544],
|
|
11
11
|
maxZoom: 18,
|
|
12
12
|
minZoom: 3,
|
|
13
|
-
zoom:
|
|
13
|
+
zoom: 16,
|
|
14
14
|
zoomOffset: 0,
|
|
15
15
|
distance: 50,
|
|
16
16
|
amapStyle: 'normal',
|
|
@@ -25,7 +25,7 @@ export function queryMapConfig(type) {
|
|
|
25
25
|
case 0:
|
|
26
26
|
url = localconfig.url, crs = localconfig.crs, maxBounds = localconfig.maxBounds, subdomains = localconfig.subdomains, zoom = localconfig.zoom, zoomOffset = localconfig.zoomOffset, center = localconfig.center, maxZoom = localconfig.maxZoom, minZoom = localconfig.minZoom, distance = localconfig.distance, amapStyle = localconfig.amapStyle;
|
|
27
27
|
|
|
28
|
-
if (!(type
|
|
28
|
+
if (!(type === 'L')) {
|
|
29
29
|
_context.next = 3;
|
|
30
30
|
break;
|
|
31
31
|
}
|
package/es/Player/demo.js
CHANGED
|
@@ -118,7 +118,8 @@ function Demo1() {
|
|
|
118
118
|
}, "\u64AD\u653E")), /*#__PURE__*/React.createElement(Player, {
|
|
119
119
|
type: state.type,
|
|
120
120
|
url: state.url,
|
|
121
|
-
isLive: !!state.isLive
|
|
121
|
+
isLive: !!state.isLive,
|
|
122
|
+
customTimeLine: state.isLive ? /*#__PURE__*/React.createElement(React.Fragment, null) : undefined
|
|
122
123
|
}));
|
|
123
124
|
}
|
|
124
125
|
|
|
@@ -199,8 +200,8 @@ function Demo3() {
|
|
|
199
200
|
var _useState5 = useState({
|
|
200
201
|
url: 'http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4',
|
|
201
202
|
tempUrl: '',
|
|
202
|
-
begin:
|
|
203
|
-
end:
|
|
203
|
+
begin: 1652889636000,
|
|
204
|
+
end: 1652890200000
|
|
204
205
|
}),
|
|
205
206
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
206
207
|
state = _useState6[0],
|
package/es/Player/iconfont.d.ts
CHANGED
package/es/Player/iconfont.js
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _useUpdate from "ahooks/es/useUpdate";
|
|
1
2
|
import _useFullscreen3 from "ahooks/es/useFullscreen";
|
|
2
3
|
|
|
3
4
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
@@ -13,7 +14,8 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
13
14
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
15
|
|
|
15
16
|
import React from 'react';
|
|
16
|
-
import
|
|
17
|
+
import IconFont from '../Player/iconfont';
|
|
18
|
+
import ScreenSelect from './ScreenSelect';
|
|
17
19
|
|
|
18
20
|
function LiveTools(_ref) {
|
|
19
21
|
var containerRef = _ref.containerRef,
|
|
@@ -27,17 +29,22 @@ function LiveTools(_ref) {
|
|
|
27
29
|
var _useFullscreen = _useFullscreen3(containerRef),
|
|
28
30
|
_useFullscreen2 = _slicedToArray(_useFullscreen, 2),
|
|
29
31
|
isFullscreen = _useFullscreen2[0],
|
|
30
|
-
toggleFullscreen = _useFullscreen2[1].toggleFullscreen;
|
|
32
|
+
toggleFullscreen = _useFullscreen2[1].toggleFullscreen;
|
|
33
|
+
|
|
34
|
+
var update = _useUpdate(); // 播放状态控制
|
|
31
35
|
|
|
32
36
|
|
|
33
37
|
var playToggle = function playToggle() {
|
|
34
|
-
var player = getPlayerItem();
|
|
38
|
+
var player = getPlayerItem(); // eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
39
|
+
|
|
35
40
|
player ? player.video.paused ? player.api.play() : player.api.pause() : undefined;
|
|
41
|
+
update();
|
|
36
42
|
}; // 重连
|
|
37
43
|
|
|
38
44
|
|
|
39
45
|
var reload = function reload() {
|
|
40
|
-
var player = getPlayerItem();
|
|
46
|
+
var player = getPlayerItem(); // eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
47
|
+
|
|
41
48
|
player ? player.reload ? player.reload() : player.api.reload() : undefined;
|
|
42
49
|
};
|
|
43
50
|
|
|
@@ -46,57 +53,83 @@ function LiveTools(_ref) {
|
|
|
46
53
|
return player ? player.api.snapshot() : undefined;
|
|
47
54
|
};
|
|
48
55
|
|
|
56
|
+
var player = getPlayerItem();
|
|
49
57
|
return /*#__PURE__*/React.createElement("div", {
|
|
50
58
|
className: "player-tools"
|
|
51
59
|
}, /*#__PURE__*/React.createElement("div", {
|
|
52
|
-
className: "
|
|
53
|
-
},
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
60
|
+
className: "player-tools-left"
|
|
61
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
62
|
+
className: "player-tools-item"
|
|
63
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
64
|
+
type: "lm-player-volume-close",
|
|
65
|
+
title: "\u97F3\u91CF"
|
|
66
|
+
})), /*#__PURE__*/React.createElement("span", {
|
|
67
|
+
className: "player-tools-item"
|
|
68
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
69
|
+
type: "lm-player-xiangji1fill",
|
|
70
|
+
title: "\u622A\u56FE",
|
|
71
|
+
onClick: snapshot
|
|
72
|
+
})), /*#__PURE__*/React.createElement("span", {
|
|
73
|
+
className: "player-tools-item",
|
|
74
|
+
onClick: reload
|
|
75
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
76
|
+
type: "lm-player-Refresh_Main",
|
|
77
|
+
title: "\u91CD\u8F7D"
|
|
78
|
+
})), /*#__PURE__*/React.createElement("span", {
|
|
79
|
+
className: "player-tools-item"
|
|
80
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
81
|
+
type: "lm-player-YesorNo_No_Dark",
|
|
82
|
+
title: "\u5173\u95ED\u5F53\u524D"
|
|
83
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
84
|
+
className: "player-tools-mid"
|
|
85
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
86
|
+
className: "player-tools-item",
|
|
87
|
+
onClick: playToggle
|
|
88
|
+
}, player && !player.video.paused ? /*#__PURE__*/React.createElement(IconFont, {
|
|
89
|
+
type: "lm-player-Pause_Main",
|
|
90
|
+
title: "\u6682\u505C"
|
|
91
|
+
}) : /*#__PURE__*/React.createElement(IconFont, {
|
|
92
|
+
type: "lm-player-Play_Main",
|
|
93
|
+
title: "\u64AD\u653E"
|
|
94
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
95
|
+
className: "player-tools-right"
|
|
96
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
97
|
+
className: "player-tools-item"
|
|
98
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
99
|
+
type: "lm-player-YesorNo_No_Dark",
|
|
100
|
+
title: "\u5173\u95ED\u6240\u6709"
|
|
101
|
+
})), /*#__PURE__*/React.createElement("span", {
|
|
102
|
+
className: "player-tools-item",
|
|
74
103
|
onClick: function onClick() {
|
|
75
104
|
return updateState({
|
|
76
105
|
mode: mode === 1 ? 2 : 1
|
|
77
106
|
});
|
|
78
107
|
}
|
|
79
|
-
},
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}, "\u64AD\u653E/\u6682\u505C"), /*#__PURE__*/React.createElement("span", {
|
|
85
|
-
style: {
|
|
86
|
-
padding: 6
|
|
87
|
-
},
|
|
88
|
-
onClick: reload
|
|
89
|
-
}, "\u91CD\u8FDE"), /*#__PURE__*/React.createElement("span", {
|
|
90
|
-
style: {
|
|
91
|
-
padding: 6
|
|
92
|
-
},
|
|
108
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
109
|
+
type: "lm-player-YesorNo_No_Dark",
|
|
110
|
+
title: "\u5207\u6362".concat(mode === 1 ? '插件' : '浏览器', "\u6A21\u5F0F")
|
|
111
|
+
})), /*#__PURE__*/React.createElement("span", {
|
|
112
|
+
className: "player-tools-item",
|
|
93
113
|
onClick: toggleFit
|
|
94
|
-
}, fit === 'fill' ?
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
114
|
+
}, fit === 'fill' ? /*#__PURE__*/React.createElement(IconFont, {
|
|
115
|
+
type: "lm-player-S_View_ScreenSizeFull",
|
|
116
|
+
title: "\u81EA\u9002\u5E94"
|
|
117
|
+
}) : /*#__PURE__*/React.createElement(IconFont, {
|
|
118
|
+
type: "lm-player-S_View_ScreenSizeFull",
|
|
119
|
+
title: "\u586B\u5145"
|
|
120
|
+
})), /*#__PURE__*/React.createElement(ScreenSelect, {
|
|
121
|
+
screenNum: screenNum,
|
|
122
|
+
updateState: updateState
|
|
123
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
124
|
+
className: "player-tools-item",
|
|
125
|
+
onClick: toggleFullscreen
|
|
126
|
+
}, isFullscreen ? /*#__PURE__*/React.createElement(IconFont, {
|
|
127
|
+
type: "lm-player-ExitFull_Main",
|
|
128
|
+
title: "\u5168\u5C4F"
|
|
129
|
+
}) : /*#__PURE__*/React.createElement(IconFont, {
|
|
130
|
+
type: "lm-player-Full_Main",
|
|
131
|
+
title: "\u5168\u5C4F"
|
|
132
|
+
}))));
|
|
100
133
|
}
|
|
101
134
|
|
|
102
135
|
export default LiveTools;
|
|
@@ -40,7 +40,6 @@ export function LivePlayerWithExt(_a) {
|
|
|
40
40
|
|
|
41
41
|
var _useFullscreen = _useFullscreen3((_b = ref.current) === null || _b === void 0 ? void 0 : _b.container),
|
|
42
42
|
_useFullscreen2 = _slicedToArray(_useFullscreen, 2),
|
|
43
|
-
_ = _useFullscreen2[0],
|
|
44
43
|
toggleFullscreen = _useFullscreen2[1].toggleFullscreen;
|
|
45
44
|
|
|
46
45
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -79,7 +78,6 @@ export function SegmentPlayerWithExt(_a) {
|
|
|
79
78
|
|
|
80
79
|
var _useFullscreen4 = _useFullscreen3((_b = ref.current) === null || _b === void 0 ? void 0 : _b.container),
|
|
81
80
|
_useFullscreen5 = _slicedToArray(_useFullscreen4, 2),
|
|
82
|
-
_ = _useFullscreen5[0],
|
|
83
81
|
toggleFullscreen = _useFullscreen5[1].toggleFullscreen;
|
|
84
82
|
|
|
85
83
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -161,7 +159,6 @@ export function FrontendPlayerWithExt(_ref) {
|
|
|
161
159
|
|
|
162
160
|
var _useFullscreen6 = _useFullscreen3((_a = ref.current) === null || _a === void 0 ? void 0 : _a.container),
|
|
163
161
|
_useFullscreen7 = _slicedToArray(_useFullscreen6, 2),
|
|
164
|
-
_ = _useFullscreen7[0],
|
|
165
162
|
toggleFullscreen = _useFullscreen7[1].toggleFullscreen;
|
|
166
163
|
|
|
167
164
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -278,9 +278,17 @@ function RecordPlayer(_ref) {
|
|
|
278
278
|
}, _callee);
|
|
279
279
|
}));
|
|
280
280
|
}, // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
281
|
-
[segmentItem.cid, segmentItem.recordType, segmentItem.segments, state.loading]);
|
|
281
|
+
[segmentItem.cid, segmentItem.recordType, segmentItem.segments, state.loading]);
|
|
282
|
+
|
|
283
|
+
var _updatePlayer = function updatePlayer(player, index) {
|
|
284
|
+
playerRef.current[index] = player;
|
|
285
|
+
setState(function (old) {
|
|
286
|
+
return Object.assign({}, old);
|
|
287
|
+
});
|
|
288
|
+
}; // index变化同步到父组件
|
|
282
289
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
283
290
|
|
|
291
|
+
|
|
284
292
|
useEffect(function () {
|
|
285
293
|
return onIndexChange(state.selectIndex);
|
|
286
294
|
}, [state.selectIndex]);
|
|
@@ -297,7 +305,7 @@ function RecordPlayer(_ref) {
|
|
|
297
305
|
key: "".concat((_b = item === null || item === void 0 ? void 0 : item.date) !== null && _b !== void 0 ? _b : '', "-").concat((_c = item.cid) !== null && _c !== void 0 ? _c : '', "-").concat(index),
|
|
298
306
|
className: state.selectIndex === index ? 'player-current-index' : '',
|
|
299
307
|
updatePlayer: function updatePlayer(player) {
|
|
300
|
-
return
|
|
308
|
+
return _updatePlayer(player, index);
|
|
301
309
|
},
|
|
302
310
|
onClick: function onClick() {
|
|
303
311
|
return setState(function (old) {
|
|
@@ -314,7 +322,7 @@ function RecordPlayer(_ref) {
|
|
|
314
322
|
className: state.selectIndex === index ? 'player-current-index' : '',
|
|
315
323
|
segments: ((_d = recordList[index]) === null || _d === void 0 ? void 0 : _d.segments) || [],
|
|
316
324
|
updatePlayer: function updatePlayer(player) {
|
|
317
|
-
return
|
|
325
|
+
return _updatePlayer(player, index);
|
|
318
326
|
},
|
|
319
327
|
onClick: function onClick() {
|
|
320
328
|
return setState(function (old) {
|
|
@@ -331,13 +339,15 @@ function RecordPlayer(_ref) {
|
|
|
331
339
|
}
|
|
332
340
|
}));
|
|
333
341
|
})), /*#__PURE__*/React.createElement(RecordTools, {
|
|
342
|
+
time: state.currentTimes[state.selectIndex],
|
|
334
343
|
fit: fit,
|
|
335
344
|
toggleFit: toggleFit,
|
|
336
345
|
getPlayerItem: getPlayerItem,
|
|
337
346
|
screenNum: state.screenNum,
|
|
338
347
|
mode: state.mode,
|
|
339
348
|
containerRef: domRef,
|
|
340
|
-
updateState: updateState
|
|
349
|
+
updateState: updateState,
|
|
350
|
+
onTimeChange: onTimeChange
|
|
341
351
|
}), /*#__PURE__*/React.createElement(SegmentTimeLine, {
|
|
342
352
|
disabled: !!segmentItem.cid,
|
|
343
353
|
begin: timeBegin,
|
|
@@ -12,6 +12,8 @@ interface IToolsProps {
|
|
|
12
12
|
getPlayerItem: () => ExportPlayerType | undefined;
|
|
13
13
|
fit?: string;
|
|
14
14
|
toggleFit?: () => void;
|
|
15
|
+
time?: number;
|
|
16
|
+
onTimeChange?: (time: number) => void;
|
|
15
17
|
}
|
|
16
|
-
declare function RecordTools({ containerRef, updateState, screenNum, getPlayerItem, mode, fit,
|
|
18
|
+
declare function RecordTools({ containerRef, updateState, screenNum, getPlayerItem, mode, toggleFit, fit, time, onTimeChange }: IToolsProps): JSX.Element;
|
|
17
19
|
export default RecordTools;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _useUpdate from "ahooks/es/useUpdate";
|
|
1
2
|
import _useFullscreen3 from "ahooks/es/useFullscreen";
|
|
2
3
|
|
|
3
4
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
@@ -13,7 +14,9 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
13
14
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
15
|
|
|
15
16
|
import React from 'react';
|
|
16
|
-
import
|
|
17
|
+
import IconFont from '../Player/iconfont';
|
|
18
|
+
import ScreenSelect from './ScreenSelect';
|
|
19
|
+
import TimeSelect from './TimeSelect';
|
|
17
20
|
|
|
18
21
|
function RecordTools(_ref) {
|
|
19
22
|
var containerRef = _ref.containerRef,
|
|
@@ -21,23 +24,30 @@ function RecordTools(_ref) {
|
|
|
21
24
|
screenNum = _ref.screenNum,
|
|
22
25
|
getPlayerItem = _ref.getPlayerItem,
|
|
23
26
|
mode = _ref.mode,
|
|
27
|
+
toggleFit = _ref.toggleFit,
|
|
24
28
|
fit = _ref.fit,
|
|
25
|
-
|
|
29
|
+
time = _ref.time,
|
|
30
|
+
onTimeChange = _ref.onTimeChange;
|
|
26
31
|
|
|
27
32
|
var _useFullscreen = _useFullscreen3(containerRef),
|
|
28
33
|
_useFullscreen2 = _slicedToArray(_useFullscreen, 2),
|
|
29
34
|
isFullscreen = _useFullscreen2[0],
|
|
30
|
-
toggleFullscreen = _useFullscreen2[1].toggleFullscreen;
|
|
35
|
+
toggleFullscreen = _useFullscreen2[1].toggleFullscreen;
|
|
36
|
+
|
|
37
|
+
var update = _useUpdate(); // 播放状态控制
|
|
31
38
|
|
|
32
39
|
|
|
33
40
|
var playToggle = function playToggle() {
|
|
34
|
-
var player = getPlayerItem();
|
|
41
|
+
var player = getPlayerItem(); // eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
42
|
+
|
|
35
43
|
player ? player.video.paused ? player.api.play() : player.api.pause() : undefined;
|
|
44
|
+
update();
|
|
36
45
|
}; // 重连
|
|
37
46
|
|
|
38
47
|
|
|
39
48
|
var reload = function reload() {
|
|
40
|
-
var player = getPlayerItem();
|
|
49
|
+
var player = getPlayerItem(); // eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
50
|
+
|
|
41
51
|
player ? player.reload ? player.reload() : player.api.reload() : undefined;
|
|
42
52
|
};
|
|
43
53
|
|
|
@@ -46,57 +56,100 @@ function RecordTools(_ref) {
|
|
|
46
56
|
return player ? player.api.snapshot() : undefined;
|
|
47
57
|
};
|
|
48
58
|
|
|
59
|
+
var player = getPlayerItem();
|
|
49
60
|
return /*#__PURE__*/React.createElement("div", {
|
|
50
61
|
className: "player-tools"
|
|
51
62
|
}, /*#__PURE__*/React.createElement("div", {
|
|
52
|
-
className: "
|
|
53
|
-
},
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
className: "player-tools-left"
|
|
64
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
65
|
+
className: "player-tools-item"
|
|
66
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
67
|
+
type: "lm-player-volume-close",
|
|
68
|
+
title: "\u97F3\u91CF"
|
|
69
|
+
})), /*#__PURE__*/React.createElement("span", {
|
|
70
|
+
className: "player-tools-item"
|
|
71
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
72
|
+
type: "lm-player-xiangji1fill",
|
|
73
|
+
title: "\u622A\u56FE",
|
|
74
|
+
onClick: snapshot
|
|
75
|
+
})), /*#__PURE__*/React.createElement("span", {
|
|
76
|
+
className: "player-tools-item",
|
|
77
|
+
onClick: reload
|
|
78
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
79
|
+
type: "lm-player-Refresh_Main",
|
|
80
|
+
title: "\u91CD\u8F7D"
|
|
81
|
+
})), /*#__PURE__*/React.createElement("span", {
|
|
82
|
+
className: "player-tools-item"
|
|
83
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
84
|
+
type: "lm-player-YesorNo_No_Dark",
|
|
85
|
+
title: "\u5173\u95ED\u5F53\u524D"
|
|
86
|
+
})), /*#__PURE__*/React.createElement("span", {
|
|
87
|
+
className: "player-tools-item"
|
|
88
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
89
|
+
type: "lm-player-S_Edit_LoadDown",
|
|
90
|
+
title: "\u4E0B\u8F7D\u5F53\u524D\u5F55\u50CF"
|
|
91
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
92
|
+
className: "player-tools-mid"
|
|
93
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
94
|
+
className: "player-tools-item",
|
|
95
|
+
onClick: playToggle
|
|
96
|
+
}, player && !player.video.paused ? /*#__PURE__*/React.createElement(IconFont, {
|
|
97
|
+
type: "lm-player-Pause_Main",
|
|
98
|
+
title: "\u6682\u505C"
|
|
99
|
+
}) : /*#__PURE__*/React.createElement(IconFont, {
|
|
100
|
+
type: "lm-player-Play_Main",
|
|
101
|
+
title: "\u64AD\u653E"
|
|
102
|
+
})), /*#__PURE__*/React.createElement(TimeSelect, {
|
|
103
|
+
time: time,
|
|
104
|
+
onChange: onTimeChange
|
|
65
105
|
}), /*#__PURE__*/React.createElement("span", {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
106
|
+
className: "player-tools-item",
|
|
107
|
+
onClick: playToggle
|
|
108
|
+
}, player && !player.video.paused ? /*#__PURE__*/React.createElement(IconFont, {
|
|
109
|
+
type: "lm-player-Pause_Main",
|
|
110
|
+
title: "\u6682\u505C"
|
|
111
|
+
}) : /*#__PURE__*/React.createElement(IconFont, {
|
|
112
|
+
type: "lm-player-Play_Main",
|
|
113
|
+
title: "\u64AD\u653E"
|
|
114
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
115
|
+
className: "player-tools-right"
|
|
116
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
117
|
+
className: "player-tools-item"
|
|
118
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
119
|
+
type: "lm-player-YesorNo_No_Dark",
|
|
120
|
+
title: "\u5173\u95ED\u6240\u6709"
|
|
121
|
+
})), /*#__PURE__*/React.createElement("span", {
|
|
122
|
+
className: "player-tools-item",
|
|
74
123
|
onClick: function onClick() {
|
|
75
124
|
return updateState({
|
|
76
125
|
mode: mode === 1 ? 2 : 1
|
|
77
126
|
});
|
|
78
127
|
}
|
|
79
|
-
},
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}, "\u64AD\u653E/\u6682\u505C"), /*#__PURE__*/React.createElement("span", {
|
|
85
|
-
style: {
|
|
86
|
-
padding: 6
|
|
87
|
-
},
|
|
88
|
-
onClick: reload
|
|
89
|
-
}, "\u91CD\u8FDE"), /*#__PURE__*/React.createElement("span", {
|
|
90
|
-
style: {
|
|
91
|
-
padding: 6
|
|
92
|
-
},
|
|
128
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
129
|
+
type: "lm-player-YesorNo_No_Dark",
|
|
130
|
+
title: "\u5207\u6362".concat(mode === 1 ? '插件' : '浏览器', "\u6A21\u5F0F")
|
|
131
|
+
})), /*#__PURE__*/React.createElement("span", {
|
|
132
|
+
className: "player-tools-item",
|
|
93
133
|
onClick: toggleFit
|
|
94
|
-
}, fit === 'fill' ?
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
134
|
+
}, fit === 'fill' ? /*#__PURE__*/React.createElement(IconFont, {
|
|
135
|
+
type: "lm-player-S_View_ScreenSizeFull",
|
|
136
|
+
title: "\u81EA\u9002\u5E94"
|
|
137
|
+
}) : /*#__PURE__*/React.createElement(IconFont, {
|
|
138
|
+
type: "lm-player-S_View_ScreenSizeFull",
|
|
139
|
+
title: "\u586B\u5145"
|
|
140
|
+
})), /*#__PURE__*/React.createElement(ScreenSelect, {
|
|
141
|
+
screenNum: screenNum,
|
|
142
|
+
updateState: updateState
|
|
143
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
144
|
+
className: "player-tools-item",
|
|
145
|
+
onClick: toggleFullscreen
|
|
146
|
+
}, isFullscreen ? /*#__PURE__*/React.createElement(IconFont, {
|
|
147
|
+
type: "lm-player-ExitFull_Main",
|
|
148
|
+
title: "\u5168\u5C4F"
|
|
149
|
+
}) : /*#__PURE__*/React.createElement(IconFont, {
|
|
150
|
+
type: "lm-player-Full_Main",
|
|
151
|
+
title: "\u5168\u5C4F"
|
|
152
|
+
}))));
|
|
100
153
|
}
|
|
101
154
|
|
|
102
155
|
export default RecordTools;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import "antd/lib/tooltip/style";
|
|
2
|
+
import _Tooltip from "antd/lib/tooltip";
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { ScreenType } from './utils';
|
|
5
|
+
|
|
6
|
+
function ScreenSelect(_ref) {
|
|
7
|
+
var screenNum = _ref.screenNum,
|
|
8
|
+
updateState = _ref.updateState;
|
|
9
|
+
return /*#__PURE__*/React.createElement(_Tooltip, {
|
|
10
|
+
title: /*#__PURE__*/React.createElement("div", null, ScreenType.map(function (item) {
|
|
11
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
12
|
+
key: "".concat(item.name),
|
|
13
|
+
style: {
|
|
14
|
+
padding: 6
|
|
15
|
+
},
|
|
16
|
+
onClick: function onClick() {
|
|
17
|
+
return updateState({
|
|
18
|
+
screenNum: item.name
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}, item.name);
|
|
22
|
+
}))
|
|
23
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
24
|
+
className: "player-tools-item"
|
|
25
|
+
}, screenNum));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export default ScreenSelect;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _useThrottleFn2 from "ahooks/es/useThrottleFn";
|
|
2
2
|
import _useSize from "ahooks/es/useSize";
|
|
3
|
+
import moment from 'moment';
|
|
3
4
|
import React, { useEffect, useRef } from 'react';
|
|
4
5
|
import TimeSlider from './TimeSlider';
|
|
5
6
|
|
|
@@ -18,10 +19,15 @@ function SegmentTimeLine(_ref) {
|
|
|
18
19
|
run = _useThrottleFn.run;
|
|
19
20
|
|
|
20
21
|
useEffect(function () {
|
|
22
|
+
var time = begin !== null && begin !== void 0 ? begin : moment().set({
|
|
23
|
+
hours: 0,
|
|
24
|
+
minutes: 0,
|
|
25
|
+
seconds: 0
|
|
26
|
+
}).valueOf();
|
|
21
27
|
var timeLine = new TimeSlider(ref.current, {
|
|
22
28
|
onTimeChange: run,
|
|
23
|
-
start_timestamp:
|
|
24
|
-
current_timestamp:
|
|
29
|
+
start_timestamp: time - 12 * 3600 * 1000,
|
|
30
|
+
current_timestamp: time,
|
|
25
31
|
timecell: timeCell
|
|
26
32
|
});
|
|
27
33
|
return function () {
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import "antd/lib/button/style";
|
|
2
|
+
import _Button from "antd/lib/button";
|
|
3
|
+
import "antd/lib/input-number/style";
|
|
4
|
+
import _InputNumber from "antd/lib/input-number";
|
|
5
|
+
import "antd/lib/popover/style";
|
|
6
|
+
import _Popover from "antd/lib/popover";
|
|
7
|
+
import _useUpdateEffect from "ahooks/es/useUpdateEffect";
|
|
8
|
+
|
|
9
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
10
|
+
|
|
11
|
+
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."); }
|
|
12
|
+
|
|
13
|
+
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); }
|
|
14
|
+
|
|
15
|
+
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; }
|
|
16
|
+
|
|
17
|
+
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; }
|
|
18
|
+
|
|
19
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
20
|
+
|
|
21
|
+
import React, { useMemo, useState } from 'react';
|
|
22
|
+
import moment from 'moment';
|
|
23
|
+
|
|
24
|
+
function TimeSelect(_ref) {
|
|
25
|
+
var time = _ref.time,
|
|
26
|
+
onChange = _ref.onChange;
|
|
27
|
+
|
|
28
|
+
var _useState = useState(function () {
|
|
29
|
+
var m = time ? moment(time) : moment().set({
|
|
30
|
+
hours: 0,
|
|
31
|
+
minutes: 0,
|
|
32
|
+
seconds: 0
|
|
33
|
+
});
|
|
34
|
+
return [m.hours(), m.minutes(), m.seconds()];
|
|
35
|
+
}),
|
|
36
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
37
|
+
values = _useState2[0],
|
|
38
|
+
setValues = _useState2[1];
|
|
39
|
+
|
|
40
|
+
var timeStr = useMemo(function () {
|
|
41
|
+
var m = time ? moment(time) : moment().set({
|
|
42
|
+
hours: 0,
|
|
43
|
+
minutes: 0,
|
|
44
|
+
seconds: 0
|
|
45
|
+
});
|
|
46
|
+
return m.format('HH:mm:ss');
|
|
47
|
+
}, [time]);
|
|
48
|
+
|
|
49
|
+
var onChangeTime = function onChangeTime() {
|
|
50
|
+
var m = time ? moment(time) : moment().set({
|
|
51
|
+
hours: 0,
|
|
52
|
+
minutes: 0,
|
|
53
|
+
seconds: 0
|
|
54
|
+
});
|
|
55
|
+
var newTime = m.set({
|
|
56
|
+
hours: values[0],
|
|
57
|
+
minutes: values[1],
|
|
58
|
+
seconds: values[2]
|
|
59
|
+
}).valueOf();
|
|
60
|
+
console.log(values, newTime);
|
|
61
|
+
onChange && onChange(newTime);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
_useUpdateEffect(function () {
|
|
65
|
+
var m = time ? moment(time) : moment().set({
|
|
66
|
+
hours: 0,
|
|
67
|
+
minutes: 0,
|
|
68
|
+
seconds: 0
|
|
69
|
+
});
|
|
70
|
+
setValues([m.hours(), m.minutes(), m.seconds()]);
|
|
71
|
+
}, [time]);
|
|
72
|
+
|
|
73
|
+
var formatter = function formatter(value) {
|
|
74
|
+
return String(value).length === 1 ? "0".concat(value) : value + '';
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
return /*#__PURE__*/React.createElement(_Popover, {
|
|
78
|
+
content: /*#__PURE__*/React.createElement("div", {
|
|
79
|
+
className: "player-time-select"
|
|
80
|
+
}, /*#__PURE__*/React.createElement(_InputNumber, {
|
|
81
|
+
size: "small",
|
|
82
|
+
style: {
|
|
83
|
+
width: 36
|
|
84
|
+
},
|
|
85
|
+
formatter: formatter,
|
|
86
|
+
controls: false,
|
|
87
|
+
value: values[0],
|
|
88
|
+
onChange: function onChange(v) {
|
|
89
|
+
return setValues(function (old) {
|
|
90
|
+
return [v, old[1], old[2]];
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
}), ":", /*#__PURE__*/React.createElement(_InputNumber, {
|
|
94
|
+
size: "small",
|
|
95
|
+
style: {
|
|
96
|
+
width: 36
|
|
97
|
+
},
|
|
98
|
+
formatter: formatter,
|
|
99
|
+
controls: false,
|
|
100
|
+
value: values[1],
|
|
101
|
+
onChange: function onChange(v) {
|
|
102
|
+
return setValues(function (old) {
|
|
103
|
+
return [old[0], v, old[2]];
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
}), ":", /*#__PURE__*/React.createElement(_InputNumber, {
|
|
107
|
+
size: "small",
|
|
108
|
+
style: {
|
|
109
|
+
width: 36
|
|
110
|
+
},
|
|
111
|
+
formatter: formatter,
|
|
112
|
+
controls: false,
|
|
113
|
+
value: values[2],
|
|
114
|
+
onChange: function onChange(v) {
|
|
115
|
+
return setValues(function (old) {
|
|
116
|
+
return [old[0], old[1], v];
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
}), /*#__PURE__*/React.createElement(_Button, {
|
|
120
|
+
size: "small",
|
|
121
|
+
type: "primary",
|
|
122
|
+
onClick: onChangeTime
|
|
123
|
+
}, "\u786E\u5B9A"))
|
|
124
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
125
|
+
className: "player-record-time"
|
|
126
|
+
}, timeStr));
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export default TimeSelect;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export default function (): JSX.Element;
|
|
2
|
+
export default function App(): JSX.Element;
|
package/es/ScreenPlayer/demo.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import "antd/lib/config-provider/style";
|
|
2
|
+
import _ConfigProvider from "antd/lib/config-provider";
|
|
1
3
|
import React from 'react';
|
|
2
4
|
import LivePlayer from './Live';
|
|
3
5
|
var list = [{
|
|
@@ -13,13 +15,15 @@ var list = [{
|
|
|
13
15
|
url: 'https://6a75ef90-0-server.antelopecloud.cn/flv_live?app=live&token=557997490_3356491776_1691725056_86b4dd8105fea7b1180408a63d17b37b',
|
|
14
16
|
type: 'flv'
|
|
15
17
|
}];
|
|
16
|
-
export default function () {
|
|
17
|
-
return /*#__PURE__*/React.createElement(
|
|
18
|
+
export default function App() {
|
|
19
|
+
return /*#__PURE__*/React.createElement(_ConfigProvider, {
|
|
20
|
+
prefixCls: "cloudapp"
|
|
21
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
18
22
|
style: {
|
|
19
23
|
width: 1200,
|
|
20
24
|
height: 800
|
|
21
25
|
}
|
|
22
26
|
}, /*#__PURE__*/React.createElement(LivePlayer, {
|
|
23
27
|
list: list
|
|
24
|
-
}));
|
|
28
|
+
})));
|
|
25
29
|
}
|
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.eyJvcmdhbml6YXRpb25JZCI6IjEwMDEwMTAwMDQ0NSIsImV4dCI6MTY2MTY1NjgzMTU3MywidWlkIjoiMTAxMDAwMDAwNjk5IiwidmFsaWRTdGF0ZSI6MTA0NDA2LCJyb2xlSWQiOlsxMDAwMDAxMTA1MTgsMTAwMDAwMTEwNzI4XSwidmFsaWRUaW1lIjoxNzA0MzgzOTk5MDAwLCJvcHRDZW50ZXJJZCI6IjEwMDEwMDAwMDIzMyIsInVzZXJUeXBlIjoxMDA3MDQsImlhdCI6MTY2MTM5NzYzMTU3M30.OWPxfPgFBWqGJaRsYLSAZohn2AarhbkOuWLa1bwgZE4";
|
|
32
32
|
var cids = ['538509097', '539172446'];
|
|
33
33
|
|
|
34
34
|
var query = function query(_ref) {
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
height: 100%;
|
|
4
4
|
box-sizing: border-box;
|
|
5
5
|
user-select: none;
|
|
6
|
+
min-width: 600px;
|
|
6
7
|
}
|
|
7
8
|
.split-screen-player-wrapper .player-layout {
|
|
8
9
|
height: calc(100% - 42px);
|
|
9
|
-
border-bottom: 1px solid var(--gray12);
|
|
10
10
|
}
|
|
11
11
|
.split-screen-player-wrapper .player-layout .player-with-ext-layout {
|
|
12
12
|
float: left;
|
|
@@ -19,9 +19,60 @@
|
|
|
19
19
|
.split-screen-player-wrapper .player-layout .player-with-ext-layout.player-current-index .lm-player-ext-layout {
|
|
20
20
|
border: 1px solid var(--primary);
|
|
21
21
|
}
|
|
22
|
+
.split-screen-player-wrapper .player-record-time {
|
|
23
|
+
width: 100%;
|
|
24
|
+
height: 100%;
|
|
25
|
+
text-align: center;
|
|
26
|
+
background-color: var(--gray11);
|
|
27
|
+
line-height: 42px;
|
|
28
|
+
padding: 0 16px;
|
|
29
|
+
font-size: 16px;
|
|
30
|
+
color: var(--gray1);
|
|
31
|
+
margin: 0 20px;
|
|
32
|
+
}
|
|
22
33
|
.split-screen-player-wrapper .player-tools {
|
|
23
34
|
height: 42px;
|
|
24
35
|
background-color: var(--gray12);
|
|
36
|
+
padding: 0 10px;
|
|
37
|
+
display: flex;
|
|
38
|
+
align-items: center;
|
|
39
|
+
justify-content: space-between;
|
|
40
|
+
}
|
|
41
|
+
.split-screen-player-wrapper .player-tools .player-tools-left,
|
|
42
|
+
.split-screen-player-wrapper .player-tools .player-tools-right {
|
|
43
|
+
min-width: 35%;
|
|
44
|
+
display: flex;
|
|
45
|
+
align-items: center;
|
|
46
|
+
}
|
|
47
|
+
.split-screen-player-wrapper .player-tools .player-tools-right {
|
|
48
|
+
justify-content: flex-end;
|
|
49
|
+
margin-right: 0;
|
|
50
|
+
margin-left: 4px;
|
|
51
|
+
}
|
|
52
|
+
.split-screen-player-wrapper .player-tools .player-tools-mid {
|
|
53
|
+
display: flex;
|
|
54
|
+
align-items: center;
|
|
55
|
+
justify-self: center;
|
|
56
|
+
height: 100%;
|
|
57
|
+
}
|
|
58
|
+
.split-screen-player-wrapper .player-tools .player-tools-mid .player-tools-item {
|
|
59
|
+
margin: 0;
|
|
60
|
+
}
|
|
61
|
+
.split-screen-player-wrapper .player-tools .player-tools-item {
|
|
62
|
+
font-size: 18px;
|
|
63
|
+
width: 32px;
|
|
64
|
+
height: 32px;
|
|
65
|
+
color: var(--gray1);
|
|
66
|
+
text-align: center;
|
|
67
|
+
cursor: pointer;
|
|
68
|
+
margin-right: 4px;
|
|
69
|
+
}
|
|
70
|
+
.split-screen-player-wrapper .player-tools .player-tools-item .lm-player-iconfont {
|
|
71
|
+
font-size: 20px;
|
|
72
|
+
}
|
|
73
|
+
.split-screen-player-wrapper .player-tools .player-tools-item:hover {
|
|
74
|
+
background-color: var(--gray11);
|
|
75
|
+
border-radius: var(--radius1);
|
|
25
76
|
}
|
|
26
77
|
.split-screen-player-wrapper.split-screen-player-wrapper-record .record-time-line {
|
|
27
78
|
width: 100%;
|
|
@@ -47,3 +98,9 @@
|
|
|
47
98
|
.split-screen-player-wrapper.split-screen-player-wrapper-record .player-layout {
|
|
48
99
|
height: calc(100% - 42px - 60px);
|
|
49
100
|
}
|
|
101
|
+
.player-time-select {
|
|
102
|
+
width: 190px;
|
|
103
|
+
display: flex;
|
|
104
|
+
justify-content: space-around;
|
|
105
|
+
align-items: center;
|
|
106
|
+
}
|
package/es/Timeout/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { BasicTarget } from 'ahooks/es/utils/domTarget';
|
|
3
|
-
import 'antd/es/modal/style/css';
|
|
4
3
|
interface ITimeoutProps {
|
|
5
4
|
/**
|
|
6
|
-
|
|
5
|
+
* 容器
|
|
6
|
+
* @default `document.body`
|
|
7
7
|
*/
|
|
8
8
|
contianer?: BasicTarget;
|
|
9
9
|
/**
|
|
@@ -14,20 +14,19 @@ interface ITimeoutProps {
|
|
|
14
14
|
* 超时动作,默认退出登录
|
|
15
15
|
*/
|
|
16
16
|
onTimeout?: () => void;
|
|
17
|
+
/**
|
|
18
|
+
* 忽略的情况
|
|
19
|
+
*/
|
|
20
|
+
ignore?: () => boolean;
|
|
17
21
|
}
|
|
18
22
|
/**
|
|
19
|
-
*
|
|
23
|
+
* @desc 用户创建界面超时回调
|
|
20
24
|
*/
|
|
21
|
-
declare function Timeout({ contianer, time, onTimeout }: ITimeoutProps): JSX.Element;
|
|
25
|
+
declare function Timeout({ contianer, time, onTimeout, ignore }: ITimeoutProps): JSX.Element;
|
|
22
26
|
declare namespace Timeout {
|
|
23
27
|
var defaultProps: {
|
|
24
28
|
time: number;
|
|
25
29
|
contianer: HTMLElement;
|
|
26
|
-
onTimeout: typeof defaultTimeoutAction;
|
|
27
30
|
};
|
|
28
31
|
}
|
|
29
|
-
declare function defaultTimeoutAction(): {
|
|
30
|
-
destroy: () => void;
|
|
31
|
-
update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
|
|
32
|
-
};
|
|
33
32
|
export default Timeout;
|
package/es/Timeout/index.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import "antd/lib/modal/style";
|
|
2
|
-
import _Modal from "antd/lib/modal";
|
|
3
1
|
import _useEventListener from "ahooks/es/useEventListener";
|
|
4
2
|
import _useRafInterval from "ahooks/es/useRafInterval";
|
|
5
3
|
|
|
@@ -16,16 +14,15 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
16
14
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
17
15
|
|
|
18
16
|
import React, { useEffect, useRef, useState } from 'react';
|
|
19
|
-
|
|
20
|
-
import 'antd/es/modal/style/css';
|
|
17
|
+
|
|
21
18
|
/**
|
|
22
|
-
*
|
|
19
|
+
* @desc 用户创建界面超时回调
|
|
23
20
|
*/
|
|
24
|
-
|
|
25
21
|
function Timeout(_ref) {
|
|
26
22
|
var contianer = _ref.contianer,
|
|
27
23
|
time = _ref.time,
|
|
28
|
-
onTimeout = _ref.onTimeout
|
|
24
|
+
onTimeout = _ref.onTimeout,
|
|
25
|
+
ignore = _ref.ignore;
|
|
29
26
|
var cuurentTimeRef = useRef(Date.now());
|
|
30
27
|
var lockstatusRef = useRef(false);
|
|
31
28
|
|
|
@@ -37,15 +34,24 @@ function Timeout(_ref) {
|
|
|
37
34
|
setState = _useState2[1];
|
|
38
35
|
|
|
39
36
|
_useRafInterval(function () {
|
|
40
|
-
|
|
37
|
+
var now = Date.now();
|
|
38
|
+
setState(function (old) {
|
|
41
39
|
return Object.assign(Object.assign({}, old), {
|
|
42
|
-
timelock:
|
|
40
|
+
timelock: now
|
|
43
41
|
});
|
|
44
42
|
});
|
|
43
|
+
var isIgnore = ignore ? ignore() : false;
|
|
44
|
+
|
|
45
|
+
if (isIgnore) {
|
|
46
|
+
// 如果当前需要忽略,那么重置时间
|
|
47
|
+
cuurentTimeRef.current = now;
|
|
48
|
+
}
|
|
45
49
|
}, 1 * 1000);
|
|
46
50
|
|
|
47
51
|
useEffect(function () {
|
|
48
|
-
|
|
52
|
+
var isIgnore = ignore ? ignore() : false;
|
|
53
|
+
|
|
54
|
+
if (!lockstatusRef.current && state.timelock - cuurentTimeRef.current > time * 1000 && !isIgnore) {
|
|
49
55
|
lockstatusRef.current = true;
|
|
50
56
|
onTimeout && onTimeout();
|
|
51
57
|
setTimeout(function () {
|
|
@@ -64,20 +70,8 @@ function Timeout(_ref) {
|
|
|
64
70
|
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
65
71
|
}
|
|
66
72
|
|
|
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
73
|
Timeout.defaultProps = {
|
|
79
74
|
time: 15 * 60,
|
|
80
|
-
contianer: document.body
|
|
81
|
-
onTimeout: defaultTimeoutAction
|
|
75
|
+
contianer: document.body
|
|
82
76
|
};
|
|
83
77
|
export default Timeout;
|