@ray-js/ipc-player-integration 0.0.1-beta-57 → 0.0.1-beta-59
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/plugins/fullScreen/fullVoiceIntercom.js +1 -1
- package/lib/plugins/ptz/ptz.js +22 -14
- package/lib/plugins/ptz/ptz.less +1 -1
- package/lib/plugins/ptz/ptzControl.js +6 -1
- package/lib/plugins/resolution/resolution.less +1 -1
- package/lib/plugins/videoBitKBP/videoBitKBP.js +8 -3
- package/lib/plugins/videoBitKBP/videoBitKBP.less +8 -0
- package/lib/plugins/voiceIntercom/voiceIntercom.js +0 -1
- package/package.json +1 -1
|
@@ -43,7 +43,7 @@ export function FullVoiceIntercom(props) {
|
|
|
43
43
|
}
|
|
44
44
|
return /*#__PURE__*/React.createElement(View, {
|
|
45
45
|
className: clsx('ipc-player-plugin-full-screen-voice', {
|
|
46
|
-
'ipc-player-plugin-full-screen-voice-hide':
|
|
46
|
+
'ipc-player-plugin-full-screen-voice-hide': isPtzActive || shouldHide,
|
|
47
47
|
'ipc-player-plugin-full-screen-voice-disappear': screenType === 'vertical'
|
|
48
48
|
})
|
|
49
49
|
}, /*#__PURE__*/React.createElement(VoiceIntercom, _extends({}, props, {
|
package/lib/plugins/ptz/ptz.js
CHANGED
|
@@ -2,6 +2,7 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
|
2
2
|
import { View, Text } from '@ray-js/ray';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import React, { useEffect, useState, useContext } from 'react';
|
|
5
|
+
import { useMemoizedFn } from 'ahooks';
|
|
5
6
|
import { UIEventContext } from '../../ui/context';
|
|
6
7
|
import { usePtz } from '../../hooks';
|
|
7
8
|
import { useStore } from '../../ctx/store';
|
|
@@ -14,6 +15,7 @@ export const Ptz = props => {
|
|
|
14
15
|
screenType: screenTypeAtom,
|
|
15
16
|
addContent,
|
|
16
17
|
deleteContent,
|
|
18
|
+
hasContent,
|
|
17
19
|
showContent,
|
|
18
20
|
hideContent,
|
|
19
21
|
className,
|
|
@@ -37,14 +39,12 @@ export const Ptz = props => {
|
|
|
37
39
|
setIsPtzActive(false);
|
|
38
40
|
}
|
|
39
41
|
}, [screenType]);
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
if (!isPtzActive) {
|
|
47
|
-
showContent('bottomLeft', 'FullSmallIntercom');
|
|
42
|
+
const onPtz = useMemoizedFn(() => {
|
|
43
|
+
console.log(isPtzActive, 'isPtzActive');
|
|
44
|
+
console.log(hasContent('absolute', ptzControlId), 'hasContent');
|
|
45
|
+
if (!isPtzActive) {
|
|
46
|
+
showContent('bottomLeft', 'FullSmallIntercom');
|
|
47
|
+
if (!hasContent('absolute', ptzControlId)) {
|
|
48
48
|
// 添加ptz空间
|
|
49
49
|
addContent('absolute', {
|
|
50
50
|
id: ptzControlId,
|
|
@@ -54,14 +54,22 @@ export const Ptz = props => {
|
|
|
54
54
|
absoluteContentClassName: 'ipc-player-plugin-full-screen-ptz-control-wrap',
|
|
55
55
|
initProps: _objectSpread({}, props)
|
|
56
56
|
});
|
|
57
|
-
event.emit('ptzControlShow');
|
|
58
|
-
} else {
|
|
59
|
-
// deleteContent('absolute', ptzControlId);
|
|
60
|
-
hideContent('bottomLeft', 'FullSmallIntercom');
|
|
61
|
-
event.emit('ptzControlHide');
|
|
57
|
+
// event.emit('ptzControlShow');
|
|
62
58
|
}
|
|
63
|
-
|
|
59
|
+
event.emit('ptzControlShow');
|
|
60
|
+
} else {
|
|
61
|
+
// deleteContent('absolute', ptzControlId);
|
|
62
|
+
hideContent('bottomLeft', 'FullSmallIntercom');
|
|
63
|
+
event.emit('ptzControlHide');
|
|
64
64
|
}
|
|
65
|
+
setIsPtzActive(!isPtzActive);
|
|
66
|
+
});
|
|
67
|
+
if (screenType === 'vertical' || !supportPtz) {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
71
|
+
className: clsx(className),
|
|
72
|
+
onClick: onPtz
|
|
65
73
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
66
74
|
className: clsx('icon-panel', 'icon-panel-ptz', 'ipc-player-plugin-ptz-text-icon'),
|
|
67
75
|
style: _objectSpread({}, isPtzActive && {
|
package/lib/plugins/ptz/ptz.less
CHANGED
|
@@ -56,10 +56,15 @@ export const PtzControl = props => {
|
|
|
56
56
|
const onPtzControlHide = useMemoizedFn(() => {
|
|
57
57
|
setIsPtzActive(false);
|
|
58
58
|
});
|
|
59
|
+
const onPtzControlShow = useMemoizedFn(() => {
|
|
60
|
+
setIsPtzActive(true);
|
|
61
|
+
});
|
|
59
62
|
useEffect(() => {
|
|
60
63
|
event.on('ptzControlHide', onPtzControlHide);
|
|
64
|
+
event.on('ptzControlShow', onPtzControlShow);
|
|
61
65
|
return () => {
|
|
62
66
|
event.off('ptzControlHide', onPtzControlHide);
|
|
67
|
+
event.off('ptzControlShow', onPtzControlShow);
|
|
63
68
|
};
|
|
64
69
|
}, []);
|
|
65
70
|
useEffect(() => {
|
|
@@ -72,7 +77,7 @@ export const PtzControl = props => {
|
|
|
72
77
|
}, []);
|
|
73
78
|
return /*#__PURE__*/React.createElement(CoverView, {
|
|
74
79
|
className: clsx('ipc-player-plugin-full-screen-ptz-control', {
|
|
75
|
-
'ipc-player-plugin-full-screen-ptz-control-hide':
|
|
80
|
+
'ipc-player-plugin-full-screen-ptz-control-hide': !isPtzActive || shouldHide,
|
|
76
81
|
'ipc-player-plugin-full-screen-ptz-disappear': screenType === 'vertical'
|
|
77
82
|
})
|
|
78
83
|
}, /*#__PURE__*/React.createElement(IpcPtzZoom, {
|
|
@@ -21,7 +21,9 @@ export const VideoBitKBP = props => {
|
|
|
21
21
|
init();
|
|
22
22
|
timer = setInterval(() => {
|
|
23
23
|
init();
|
|
24
|
-
},
|
|
24
|
+
}, 3000);
|
|
25
|
+
} else {
|
|
26
|
+
clearInterval(timer);
|
|
25
27
|
}
|
|
26
28
|
return () => {
|
|
27
29
|
clearInterval(timer);
|
|
@@ -33,11 +35,14 @@ export const VideoBitKBP = props => {
|
|
|
33
35
|
setBitKBP(`${res.data.kbps}KB/S`);
|
|
34
36
|
}
|
|
35
37
|
};
|
|
36
|
-
if (bitKBP === '') {
|
|
38
|
+
if (bitKBP === '' || bitKBP === '0KB/S' || store.playState !== PlayState.PLAYING) {
|
|
37
39
|
return null;
|
|
38
40
|
}
|
|
39
41
|
return /*#__PURE__*/React.createElement(View, {
|
|
40
|
-
className: clsx(
|
|
42
|
+
className: clsx({
|
|
43
|
+
'ipc-player-plugin-videoBitKBP-container': true,
|
|
44
|
+
[className]: !!className
|
|
45
|
+
})
|
|
41
46
|
}, /*#__PURE__*/React.createElement(View, {
|
|
42
47
|
className: "ipc-player-plugin-videoBitKBP"
|
|
43
48
|
}, bitKBP));
|
|
@@ -1,6 +1,14 @@
|
|
|
1
|
+
.ipc-player-plugin-videoBitKBP-container {
|
|
2
|
+
min-width: calc(100px * var(--ipc-player-size-scale, 1));
|
|
3
|
+
display: flex;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
align-items: center;
|
|
6
|
+
}
|
|
1
7
|
.ipc-player-plugin-videoBitKBP {
|
|
2
8
|
display: flex;
|
|
3
9
|
align-items: center;
|
|
10
|
+
justify-content: center;
|
|
11
|
+
width: 100%;
|
|
4
12
|
height: calc(24px * var(--ipc-player-size-scale, 1));
|
|
5
13
|
padding: 0 calc(9px * var(--ipc-player-size-scale, 1));
|
|
6
14
|
border-radius: calc(24px * var(--ipc-player-size-scale, 1));
|