@ray-js/ipc-player-integration 0.0.1-beta-21 → 0.0.1-beta-23
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/lib/ctx/ctx.composition.js +19 -9
- package/lib/ctx/ctx.d.ts +5 -3
- package/lib/ctx/ctx.js +57 -28
- package/lib/ctx/store.d.ts +1 -1
- package/lib/ctx/store.js +1 -1
- package/lib/i18n/index.d.ts +28 -0
- package/lib/i18n/strings.d.ts +14 -0
- package/lib/i18n/strings.js +16 -2
- package/lib/interface.d.ts +18 -8
- package/lib/plugins/battery/battery.composition.d.ts +47 -5
- package/lib/plugins/battery/battery.composition.js +4 -0
- package/lib/plugins/battery/battery.js +9 -9
- package/lib/plugins/battery/battery.less +4 -14
- package/lib/plugins/battery/batteryFull.d.ts +13 -0
- package/lib/plugins/battery/batteryFull.js +46 -0
- package/lib/plugins/fullScreen/fullScreen.js +12 -10
- package/lib/plugins/fullScreen/fullScreen.less +9 -8
- package/lib/plugins/fullScreen/verticalScreen.d.ts +1 -1
- package/lib/plugins/fullScreen/verticalScreen.js +8 -5
- package/lib/plugins/fullScreen/verticalScreen.less +7 -12
- package/lib/plugins/fullScreen/voiceIntercom.js +2 -2
- package/lib/plugins/index.d.ts +3 -1
- package/lib/plugins/index.js +6 -2
- package/lib/plugins/muted/muted.js +4 -4
- package/lib/plugins/muted/muted.less +8 -1
- package/lib/plugins/ptz/ptz.js +13 -26
- package/lib/plugins/ptz/ptz.less +2 -7
- package/lib/plugins/ptz/ptzControl.d.ts +0 -1
- package/lib/plugins/ptz/ptzControl.js +76 -32
- package/lib/plugins/recordVideo/recordVideo.js +154 -26
- package/lib/plugins/recordVideo/recordVideo.less +63 -6
- package/lib/plugins/resolution/fullResolutionControl.js +2 -2
- package/lib/plugins/resolution/resolution.js +9 -3
- package/lib/plugins/resolution/resolution.less +5 -5
- package/lib/plugins/screenshot/screenshot.js +65 -14
- package/lib/plugins/screenshot/screenshot.less +25 -23
- package/lib/plugins/smallIntercom/index.d.ts +1 -0
- package/lib/plugins/smallIntercom/index.js +1 -0
- package/lib/plugins/smallIntercom/smallIntercom.d.ts +6 -0
- package/lib/plugins/smallIntercom/smallIntercom.js +49 -0
- package/lib/plugins/smallIntercom/smallIntercom.less +50 -0
- package/lib/plugins/tempHumidity/tempHumidity.d.ts +1 -1
- package/lib/plugins/tempHumidity/tempHumidity.js +12 -4
- package/lib/plugins/videoBitKBP/index.d.ts +1 -0
- package/lib/plugins/videoBitKBP/index.js +1 -0
- package/lib/plugins/{videoBitKbps/videoBitKbps.d.ts → videoBitKBP/videoBitKBP.d.ts} +2 -2
- package/lib/plugins/{videoBitKbps/videoBitKbps.js → videoBitKBP/videoBitKBP.js} +14 -7
- package/lib/plugins/{videoBitKbps/videoBitKbps.less → videoBitKBP/videoBitKBP.less} +4 -5
- package/lib/plugins/voiceIntercom/voiceIntercom.d.ts +1 -1
- package/lib/plugins/voiceIntercom/voiceIntercom.js +25 -18
- package/lib/ui/bottomLeftContent.d.ts +8 -0
- package/lib/ui/bottomLeftContent.js +33 -0
- package/lib/ui/bottomRightContent.d.ts +8 -0
- package/lib/ui/bottomRightContent.js +33 -0
- package/lib/ui/constant.d.ts +1 -0
- package/lib/ui/constant.js +2 -1
- package/lib/ui/hooks.d.ts +1 -1
- package/lib/ui/hooks.js +4 -3
- package/lib/ui/{bottomContent.d.ts → topLeftContent.d.ts} +2 -2
- package/lib/ui/{bottomContent.js → topLeftContent.js} +9 -8
- package/lib/ui/{topContent.d.ts → topRightContent.d.ts} +2 -2
- package/lib/ui/{topContent.js → topRightContent.js} +9 -8
- package/lib/ui/ui.d.ts +3 -0
- package/lib/ui/ui.js +115 -56
- package/lib/ui/ui.less +162 -25
- package/lib/utils/device/index.d.ts +6 -0
- package/lib/utils/device/index.js +52 -0
- package/lib/utils/index.d.ts +3 -0
- package/lib/utils/index.js +15 -0
- package/package.json +7 -9
- package/lib/plugins/videoBitKbps/index.d.ts +0 -1
- package/lib/plugins/videoBitKbps/index.js +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
import React, { useContext } from 'react';
|
|
3
|
-
import { View, setPageOrientation } from '@ray-js/ray';
|
|
3
|
+
import { View, setPageOrientation, Text } from '@ray-js/ray';
|
|
4
4
|
import { useUpdateEffect } from 'ahooks';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import { UIEventContext } from '../../ui/context';
|
|
@@ -16,7 +16,8 @@ export function FullScreen(props) {
|
|
|
16
16
|
addContent,
|
|
17
17
|
deleteContent,
|
|
18
18
|
setPtzActive,
|
|
19
|
-
setFullResolutionActive
|
|
19
|
+
setFullResolutionActive,
|
|
20
|
+
className
|
|
20
21
|
} = props;
|
|
21
22
|
const {
|
|
22
23
|
screenType
|
|
@@ -42,9 +43,10 @@ export function FullScreen(props) {
|
|
|
42
43
|
});
|
|
43
44
|
|
|
44
45
|
// 添加全屏后,返回竖屏的控件
|
|
45
|
-
addContent('
|
|
46
|
+
addContent('topLeft', {
|
|
46
47
|
id: verticalScreenId,
|
|
47
48
|
content: VerticalScreen,
|
|
49
|
+
absoluteContentClassName: 'ipc-player-plugin-vertical-screen-wrap',
|
|
48
50
|
initProps: _objectSpread(_objectSpread({}, props), {}, {
|
|
49
51
|
onClick: () => {
|
|
50
52
|
event.emit(showAllComponent);
|
|
@@ -56,11 +58,9 @@ export function FullScreen(props) {
|
|
|
56
58
|
addContent('absolute', {
|
|
57
59
|
id: voiceIntercomId,
|
|
58
60
|
content: props => {
|
|
59
|
-
return /*#__PURE__*/React.createElement(
|
|
60
|
-
className: clsx('ipc-player-plugin-full-screen-voice')
|
|
61
|
-
}, /*#__PURE__*/React.createElement(VoiceIntercom, props));
|
|
61
|
+
return /*#__PURE__*/React.createElement(VoiceIntercom, props);
|
|
62
62
|
},
|
|
63
|
-
absoluteContentClassName: 'ipc-player-plugin-full-screen-voice-
|
|
63
|
+
absoluteContentClassName: 'ipc-player-plugin-full-screen-voice-wrap',
|
|
64
64
|
initProps: _objectSpread({}, props)
|
|
65
65
|
});
|
|
66
66
|
};
|
|
@@ -79,7 +79,7 @@ export function FullScreen(props) {
|
|
|
79
79
|
});
|
|
80
80
|
ty.showMenuButton();
|
|
81
81
|
ty.showStatusBar();
|
|
82
|
-
deleteContent('
|
|
82
|
+
deleteContent('topLeft', verticalScreenId);
|
|
83
83
|
deleteContent('absolute', voiceIntercomId);
|
|
84
84
|
deleteContent('absolute', ptzControlId);
|
|
85
85
|
deleteContent('absolute', fullResolutionId);
|
|
@@ -108,7 +108,9 @@ export function FullScreen(props) {
|
|
|
108
108
|
};
|
|
109
109
|
if (screenType === 'full') return null;
|
|
110
110
|
return /*#__PURE__*/React.createElement(View, {
|
|
111
|
-
className:
|
|
111
|
+
className: clsx(className),
|
|
112
112
|
onClick: () => handClick('full')
|
|
113
|
-
}
|
|
113
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
114
|
+
className: clsx('icon-panel', 'icon-panel-landscape', 'ipc-player-plugin-full-screen')
|
|
115
|
+
}));
|
|
114
116
|
}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
.ipc-player-plugin-full-screen {
|
|
2
|
-
position: absolute;
|
|
3
|
-
top: 50%;
|
|
4
|
-
transform: translateY(-50%);
|
|
5
|
-
right: calc(16px * var(--ipc-player-size-scale, 1));
|
|
2
|
+
// position: absolute;
|
|
3
|
+
// top: 50%;
|
|
4
|
+
// transform: translateY(-50%);
|
|
5
|
+
// right: calc(16px * var(--ipc-player-size-scale, 1));
|
|
6
6
|
color: var(--iconColor);
|
|
7
|
-
font-size: calc(var(--
|
|
7
|
+
font-size: calc(var(--iconPlayerSize) * var(--ipc-player-size-scale, 1)) !important;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
.ipc-player-plugin-full-screen-voice-
|
|
10
|
+
.ipc-player-plugin-full-screen-voice-wrap {
|
|
11
11
|
position: absolute;
|
|
12
12
|
top: 50%;
|
|
13
13
|
transform: translate(0, -50%);
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
// transform: translate(180%, 0);
|
|
15
|
+
right: calc(36px * var(--ipc-player-size-scale, 1));;
|
|
16
|
+
z-index: 340;
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
.ipc-player-plugin-full-screen-voice {
|
|
@@ -4,5 +4,5 @@ import type { ComponentConfigProps } from '../../interface';
|
|
|
4
4
|
type Props = ComponentConfigProps & {
|
|
5
5
|
onClick?: () => void;
|
|
6
6
|
};
|
|
7
|
-
export declare function VerticalScreen({ onClick }: Props): React.JSX.Element;
|
|
7
|
+
export declare function VerticalScreen({ onClick, className }: Props): React.JSX.Element;
|
|
8
8
|
export {};
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { View } from '@ray-js/ray';
|
|
2
|
+
import { View, Text } from '@ray-js/ray';
|
|
3
|
+
import clsx from 'clsx';
|
|
3
4
|
import './verticalScreen.less';
|
|
4
5
|
const NILL = () => null;
|
|
5
6
|
export function VerticalScreen(_ref) {
|
|
6
7
|
let {
|
|
7
|
-
onClick = NILL
|
|
8
|
+
onClick = NILL,
|
|
9
|
+
className
|
|
8
10
|
} = _ref;
|
|
11
|
+
console.log(className, 'className');
|
|
9
12
|
return /*#__PURE__*/React.createElement(View, {
|
|
10
|
-
className:
|
|
13
|
+
className: clsx(className),
|
|
11
14
|
onClick: onClick
|
|
12
|
-
}, /*#__PURE__*/React.createElement(
|
|
13
|
-
className:
|
|
15
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
16
|
+
className: clsx('icon-panel', 'icon-panel-left-arrow', 'ipc-player-plugin-vertical-screen-icon')
|
|
14
17
|
}));
|
|
15
18
|
}
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
.ipc-player-plugin-vertical-screen {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
.ipc-player-plugin-vertical-screen-icon {
|
|
9
|
-
// font-size: var(--iconFontSize);
|
|
10
|
-
font-size: calc(var(--iconFontSize) * var(--ipc-player-size-scale, 1));
|
|
11
|
-
color: var(--iconColor);
|
|
12
|
-
}
|
|
1
|
+
.ipc-player-plugin-vertical-screen-wrap {
|
|
2
|
+
background-color: red;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.ipc-player-plugin-vertical-screen-icon {
|
|
6
|
+
color: var(--iconColor);
|
|
7
|
+
font-size: calc(var(--iconPlayerSize) * var(--ipc-player-size-scale, 1)) !important;
|
|
13
8
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import React, { useContext } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { View } from '@ray-js/ray';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import { VoiceIntercom as Component } from '../voiceIntercom';
|
|
6
6
|
import { useComponentHideState } from '../../ui/hooks';
|
|
@@ -21,7 +21,7 @@ export function VoiceIntercom(props) {
|
|
|
21
21
|
const {
|
|
22
22
|
event
|
|
23
23
|
} = useContext(UIEventContext);
|
|
24
|
-
return /*#__PURE__*/React.createElement(
|
|
24
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
25
25
|
className: clsx('ipc-player-plugin-full-screen-voice', {
|
|
26
26
|
'ipc-player-plugin-full-screen-voice-hide': shouldHide || isPtzActive || fullResolutionActive
|
|
27
27
|
})
|
package/lib/plugins/index.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
export * from './battery';
|
|
2
|
+
export * from './battery/batteryFull';
|
|
2
3
|
export * from './screenshot';
|
|
3
4
|
export * from './tempHumidity';
|
|
4
5
|
export * from './recordVideo';
|
|
5
6
|
export * from './fullScreen';
|
|
6
|
-
export * from './
|
|
7
|
+
export * from './videoBitKBP';
|
|
7
8
|
export * from './voiceIntercom';
|
|
8
9
|
export * from './muted';
|
|
9
10
|
export * from './ptz';
|
|
10
11
|
export * from './resolution';
|
|
12
|
+
export * from './smallIntercom';
|
package/lib/plugins/index.js
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
|
+
// 非全屏电池插件
|
|
1
2
|
export * from './battery';
|
|
3
|
+
// 全屏电池插件
|
|
4
|
+
export * from './battery/batteryFull';
|
|
2
5
|
export * from './screenshot';
|
|
3
6
|
export * from './tempHumidity';
|
|
4
7
|
export * from './recordVideo';
|
|
5
8
|
export * from './fullScreen';
|
|
6
|
-
export * from './
|
|
9
|
+
export * from './videoBitKBP';
|
|
7
10
|
export * from './voiceIntercom';
|
|
8
11
|
export * from './muted';
|
|
9
12
|
export * from './ptz';
|
|
10
|
-
export * from './resolution';
|
|
13
|
+
export * from './resolution';
|
|
14
|
+
export * from './smallIntercom';
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { View, Text } from '@ray-js/ray';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import clsx from 'clsx';
|
|
3
4
|
import { useStore } from '../../ctx/store';
|
|
4
5
|
import './muted.less';
|
|
5
6
|
export const Muted = props => {
|
|
6
7
|
const {
|
|
7
8
|
mute,
|
|
8
|
-
setMute
|
|
9
|
+
setMute,
|
|
10
|
+
className
|
|
9
11
|
} = props;
|
|
10
12
|
const {
|
|
11
13
|
isMuted
|
|
@@ -13,6 +15,7 @@ export const Muted = props => {
|
|
|
13
15
|
isMuted: mute
|
|
14
16
|
});
|
|
15
17
|
return /*#__PURE__*/React.createElement(View, {
|
|
18
|
+
className: clsx(className),
|
|
16
19
|
onClick: () => {
|
|
17
20
|
// IPCPlayerContext.setMuted({
|
|
18
21
|
// mute: !isMuted,
|
|
@@ -24,9 +27,6 @@ export const Muted = props => {
|
|
|
24
27
|
// },
|
|
25
28
|
// });
|
|
26
29
|
setMute(!isMuted);
|
|
27
|
-
},
|
|
28
|
-
style: {
|
|
29
|
-
display: 'flex'
|
|
30
30
|
}
|
|
31
31
|
}, isMuted ? /*#__PURE__*/React.createElement(Text, {
|
|
32
32
|
className: "ipc-player-plugin-muted-text-icon icon-panel icon-panel-mute-off"
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
+
.muteIconBox {
|
|
2
|
+
display: flex;
|
|
3
|
+
justify-content: center;
|
|
4
|
+
align-items: center;
|
|
5
|
+
width: calc(var(--iconBoxSize) * var(--ipc-player-size-scale, 1));
|
|
6
|
+
height: calc(var(--iconBoxSize) * var(--ipc-player-size-scale, 1));
|
|
7
|
+
}
|
|
1
8
|
.ipc-player-plugin-muted-text-icon {
|
|
2
9
|
color: var(--iconColor);
|
|
3
|
-
font-size: calc(var(--
|
|
10
|
+
font-size: calc(var(--iconPlayerSize) * var(--ipc-player-size-scale, 1)) !important;
|
|
4
11
|
}
|
package/lib/plugins/ptz/ptz.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
import { View, Text } from '@ray-js/ray';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
|
-
import React
|
|
4
|
+
import React from 'react';
|
|
5
5
|
import { useStore, updateAtom } from '../../ctx/store';
|
|
6
6
|
import { ptzControlId } from '../../ui/constant';
|
|
7
7
|
import './ptz.less';
|
|
@@ -12,43 +12,30 @@ export const Ptz = props => {
|
|
|
12
12
|
screenType: screenTypeAtom,
|
|
13
13
|
ptzActive,
|
|
14
14
|
addContent,
|
|
15
|
-
deleteContent
|
|
15
|
+
deleteContent,
|
|
16
|
+
className
|
|
16
17
|
} = props;
|
|
17
18
|
const {
|
|
18
19
|
screenType,
|
|
19
|
-
isPtzActive
|
|
20
|
+
isPtzActive,
|
|
21
|
+
brandColor
|
|
20
22
|
} = useStore({
|
|
21
23
|
screenType: screenTypeAtom,
|
|
22
|
-
isPtzActive: ptzActive
|
|
24
|
+
isPtzActive: ptzActive,
|
|
25
|
+
brandColor: props.brandColor
|
|
23
26
|
});
|
|
24
|
-
useEffect(() => {
|
|
25
|
-
// init();
|
|
26
|
-
}, []);
|
|
27
|
-
|
|
28
|
-
// const init = () => {
|
|
29
|
-
// IPCPlayerContext.isMuted({
|
|
30
|
-
// success: res => {
|
|
31
|
-
// setIsMuted(res);
|
|
32
|
-
// },
|
|
33
|
-
// fail: res => {
|
|
34
|
-
// console.log('res===isMuted err', res);
|
|
35
|
-
// },
|
|
36
|
-
// });
|
|
37
|
-
// };
|
|
38
|
-
|
|
39
27
|
if (screenType === 'vertical') {
|
|
40
28
|
return null;
|
|
41
29
|
}
|
|
42
30
|
return /*#__PURE__*/React.createElement(View, {
|
|
31
|
+
className: clsx(className),
|
|
43
32
|
onClick: () => {
|
|
44
33
|
if (!isPtzActive) {
|
|
45
34
|
// 添加ptz空间
|
|
46
35
|
addContent('absolute', {
|
|
47
36
|
id: ptzControlId,
|
|
48
37
|
content: props => {
|
|
49
|
-
return /*#__PURE__*/React.createElement(
|
|
50
|
-
className: "ipc-player-plugin-full-screen-ptz-control"
|
|
51
|
-
}, /*#__PURE__*/React.createElement(PtzControl, props));
|
|
38
|
+
return /*#__PURE__*/React.createElement(PtzControl, props);
|
|
52
39
|
},
|
|
53
40
|
absoluteContentClassName: 'ipc-player-plugin-full-screen-ptz-control-warp',
|
|
54
41
|
initProps: _objectSpread({}, props)
|
|
@@ -57,11 +44,11 @@ export const Ptz = props => {
|
|
|
57
44
|
deleteContent('absolute', ptzControlId);
|
|
58
45
|
}
|
|
59
46
|
updateAtom(ptzActive, !isPtzActive);
|
|
60
|
-
},
|
|
61
|
-
style: {
|
|
62
|
-
display: 'flex'
|
|
63
47
|
}
|
|
64
48
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
65
|
-
className: clsx('
|
|
49
|
+
className: clsx('icon-panel', 'icon-panel-ptz', 'ipc-player-plugin-ptz-text-icon'),
|
|
50
|
+
style: _objectSpread({}, isPtzActive && {
|
|
51
|
+
color: brandColor
|
|
52
|
+
})
|
|
66
53
|
}));
|
|
67
54
|
};
|
package/lib/plugins/ptz/ptz.less
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
.ipc-player-plugin-ptz-text-icon {
|
|
2
2
|
color: var(--iconColor);
|
|
3
|
-
font-size: calc(var(--
|
|
3
|
+
font-size: calc(var(--iconPlayerSize) * var(--ipc-player-size-scale, 1)) !important;
|
|
4
4
|
}
|
|
5
|
-
|
|
6
|
-
.ipc-ptz-active {
|
|
7
|
-
color: var(--iconActiveColor);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
5
|
// .ipc-player-plugin-full-screen-ptz {
|
|
11
6
|
// position: absolute;
|
|
12
7
|
// top: 60%;
|
|
@@ -35,7 +30,7 @@
|
|
|
35
30
|
}
|
|
36
31
|
|
|
37
32
|
.arrow-icon-wrapper {
|
|
38
|
-
font-size:
|
|
33
|
+
font-size: 25px;
|
|
39
34
|
color: #707070;
|
|
40
35
|
}
|
|
41
36
|
|
|
@@ -1,13 +1,43 @@
|
|
|
1
|
-
import React, { useContext } from 'react';
|
|
1
|
+
import React, { useContext, useEffect, useRef } from 'react';
|
|
2
2
|
import { CoverView } from '@ray-js/ray';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
|
+
import _find from 'lodash/find';
|
|
5
|
+
import _get from 'lodash/get';
|
|
4
6
|
import IpcPtzZoom from '@ray-js/ipc-ptz-zoom';
|
|
7
|
+
import IpcUtils from '@ray-js/ray-ipc-utils';
|
|
5
8
|
import { useComponentHideState } from '../../ui/hooks';
|
|
6
9
|
import { UIEventContext } from '../../ui/context';
|
|
7
10
|
import { useStore } from '../../ctx/store';
|
|
11
|
+
import { getEnumRangeIsValid } from '../../utils/device';
|
|
8
12
|
import { startTimeToHideAllComponent, pauseTimeToHideAllComponent } from '../../ui/constant';
|
|
9
|
-
import './ptz.less';
|
|
13
|
+
import Styles from './ptz.less';
|
|
14
|
+
const getPtzData = devId => {
|
|
15
|
+
return [{
|
|
16
|
+
type: 'top',
|
|
17
|
+
show: getEnumRangeIsValid(devId, 'ptz_control', '0'),
|
|
18
|
+
dpValue: '0',
|
|
19
|
+
icon: 'ptz-arrow'
|
|
20
|
+
}, {
|
|
21
|
+
type: 'right',
|
|
22
|
+
show: getEnumRangeIsValid(devId, 'ptz_control', '2'),
|
|
23
|
+
dpValue: '2',
|
|
24
|
+
icon: 'ptz-arrow'
|
|
25
|
+
}, {
|
|
26
|
+
type: 'left',
|
|
27
|
+
show: getEnumRangeIsValid(devId, 'ptz_control', '6'),
|
|
28
|
+
dpValue: '6',
|
|
29
|
+
icon: 'ptz-arrow'
|
|
30
|
+
}, {
|
|
31
|
+
type: 'bottom',
|
|
32
|
+
show: getEnumRangeIsValid(devId, 'ptz_control', '4'),
|
|
33
|
+
dpValue: '4',
|
|
34
|
+
icon: 'ptz-arrow'
|
|
35
|
+
}];
|
|
36
|
+
};
|
|
10
37
|
export const PtzControl = props => {
|
|
38
|
+
const {
|
|
39
|
+
devId
|
|
40
|
+
} = props;
|
|
11
41
|
const {
|
|
12
42
|
screenType,
|
|
13
43
|
brandColor
|
|
@@ -19,6 +49,16 @@ export const PtzControl = props => {
|
|
|
19
49
|
const {
|
|
20
50
|
event
|
|
21
51
|
} = useContext(UIEventContext);
|
|
52
|
+
const ptzTimeId = useRef(null);
|
|
53
|
+
const ptzData = useRef(getPtzData(devId));
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
return () => {
|
|
56
|
+
if (ptzTimeId.current) {
|
|
57
|
+
clearInterval(ptzTimeId.current);
|
|
58
|
+
ptzTimeId.current = null;
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
}, []);
|
|
22
62
|
return /*#__PURE__*/React.createElement(CoverView, {
|
|
23
63
|
className: clsx('ipc-player-plugin-full-screen-ptz-control', {
|
|
24
64
|
'ipc-player-plugin-full-screen-ptz-control-hide': shouldHide
|
|
@@ -26,40 +66,44 @@ export const PtzControl = props => {
|
|
|
26
66
|
}, /*#__PURE__*/React.createElement(IpcPtzZoom, {
|
|
27
67
|
ptzSize: "172px",
|
|
28
68
|
zoomData: [],
|
|
29
|
-
ptzData:
|
|
30
|
-
|
|
31
|
-
// show: getEnumRangeIsValid('ptz_control', '0'),
|
|
32
|
-
show: true,
|
|
33
|
-
dpValue: '0',
|
|
34
|
-
icon: 'ptz-arrow'
|
|
35
|
-
}, {
|
|
36
|
-
type: 'right',
|
|
37
|
-
// show: getEnumRangeIsValid('ptz_control', '2'),
|
|
38
|
-
show: true,
|
|
39
|
-
dpValue: '2',
|
|
40
|
-
icon: 'ptz-arrow'
|
|
41
|
-
}, {
|
|
42
|
-
type: 'left',
|
|
43
|
-
// show: getEnumRangeIsValid('ptz_control', '6'),
|
|
44
|
-
show: true,
|
|
45
|
-
dpValue: '6',
|
|
46
|
-
icon: 'ptz-arrow'
|
|
47
|
-
}, {
|
|
48
|
-
type: 'bottom',
|
|
49
|
-
// show: getEnumRangeIsValid('ptz_control', '4'),
|
|
50
|
-
show: true,
|
|
51
|
-
dpValue: '4',
|
|
52
|
-
icon: 'ptz-arrow'
|
|
53
|
-
}],
|
|
54
|
-
onTouchPtzStart: data => {
|
|
55
|
-
console.log(data, 'data');
|
|
69
|
+
ptzData: ptzData.current,
|
|
70
|
+
onTouchPtzStart: async data => {
|
|
56
71
|
event.emit(pauseTimeToHideAllComponent);
|
|
72
|
+
const {
|
|
73
|
+
type
|
|
74
|
+
} = data;
|
|
75
|
+
const dpData = await IpcUtils.getDpIdByCode(devId, 'ptz_control');
|
|
76
|
+
if (dpData.code === 0) {
|
|
77
|
+
const ptzControlId = dpData.data;
|
|
78
|
+
const sndDpValue = _get(_find(ptzData.current, {
|
|
79
|
+
type
|
|
80
|
+
}), 'dpValue', null);
|
|
81
|
+
IpcUtils.publishDps(devId, {
|
|
82
|
+
[ptzControlId]: sndDpValue
|
|
83
|
+
});
|
|
84
|
+
ptzTimeId.current = setInterval(() => {
|
|
85
|
+
IpcUtils.publishDps(devId, {
|
|
86
|
+
[ptzControlId]: sndDpValue
|
|
87
|
+
});
|
|
88
|
+
}, 1000);
|
|
89
|
+
}
|
|
57
90
|
},
|
|
58
|
-
onTouchPtzEnd: () => {
|
|
59
|
-
|
|
91
|
+
onTouchPtzEnd: async () => {
|
|
92
|
+
const ptzStopData = await IpcUtils.getDpIdByCode(devId, 'ptz_stop');
|
|
93
|
+
if (ptzStopData.code === 0) {
|
|
94
|
+
const ptzStopId = ptzStopData.data;
|
|
95
|
+
IpcUtils.publishDps(devId, {
|
|
96
|
+
[ptzStopId]: true
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
if (ptzTimeId.current) {
|
|
100
|
+
clearInterval(ptzTimeId.current);
|
|
101
|
+
ptzTimeId.current = null;
|
|
102
|
+
}
|
|
60
103
|
event.emit(startTimeToHideAllComponent);
|
|
61
104
|
},
|
|
62
105
|
brandColor: brandColor,
|
|
63
|
-
iconClassName:
|
|
106
|
+
iconClassName: Styles['arrow-icon-wrapper'],
|
|
107
|
+
darkMode: true
|
|
64
108
|
}));
|
|
65
109
|
};
|