@ray-js/ipc-player-integration 0.0.25 → 0.0.27
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/features/initPlayerWidgets/index.d.ts +1 -0
- package/lib/features/initPlayerWidgets/index.js +2 -1
- package/lib/widgets/fullScreen/fullScreen.less +3 -3
- package/lib/widgets/resolution/resolution.d.ts +2 -1
- package/lib/widgets/resolution/resolution.js +5 -1
- package/lib/widgets/voiceIntercom/voiceIntercom.d.ts +3 -0
- package/lib/widgets/voiceIntercom/voiceIntercom.js +29 -6
- package/lib/widgets/voiceIntercom/voiceIntercom.less +16 -2
- package/package.json +2 -2
|
@@ -7,6 +7,7 @@ export declare function initPlayerWidgets(ctx: Ctx, options: {
|
|
|
7
7
|
hideHorizontalMenu?: boolean;
|
|
8
8
|
hideScreenShotMenu?: boolean;
|
|
9
9
|
hideRecordVideoMenu?: boolean;
|
|
10
|
+
hideResolutionMenu?: boolean;
|
|
10
11
|
hideKbsMenu?: boolean;
|
|
11
12
|
directionControlProps?: Partial<React.ComponentProps<typeof FullScreen>['directionControlProps']>;
|
|
12
13
|
}): Promise<void>;
|
|
@@ -21,7 +21,8 @@ export async function initPlayerWidgets(ctx, options) {
|
|
|
21
21
|
if (resolutionIndex !== -1) {
|
|
22
22
|
// @ts-ignore
|
|
23
23
|
newDefaultBottomLeftContent[resolutionIndex].initProps = {
|
|
24
|
-
verticalResolutionCustomClick: options.verticalResolutionCustomClick
|
|
24
|
+
verticalResolutionCustomClick: options.verticalResolutionCustomClick,
|
|
25
|
+
hideResolutionMenu: options.hideResolutionMenu
|
|
25
26
|
};
|
|
26
27
|
}
|
|
27
28
|
if (screenShotIndex !== -1) {
|
|
@@ -13,14 +13,14 @@
|
|
|
13
13
|
top: 50%;
|
|
14
14
|
transform: translateY(-50%);
|
|
15
15
|
right: calc(50px * var(--ipc-player-size-scale, 1));
|
|
16
|
-
z-index:
|
|
16
|
+
z-index: 348;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
.ipc-player-plugin-remote-control-wrap {
|
|
20
20
|
position: absolute;
|
|
21
21
|
bottom: calc(24px * var(--ipc-player-size-scale, 1));
|
|
22
22
|
right: calc(50px * var(--ipc-player-size-scale, 1));
|
|
23
|
-
z-index:
|
|
23
|
+
z-index: 348;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
.ipc-player-plugin-full-screen-voice {
|
|
@@ -34,4 +34,4 @@
|
|
|
34
34
|
.ipc-plugin-full-travel-route-control {
|
|
35
35
|
// width: calc(172px * var(--ipc-player-size-scale, 1));
|
|
36
36
|
// height: calc(172px * var(--ipc-player-size-scale, 1));
|
|
37
|
-
}
|
|
37
|
+
}
|
|
@@ -5,6 +5,7 @@ export type ChangeResolutionWhenClick = ScreenType[];
|
|
|
5
5
|
type Props = ComponentConfigProps & {
|
|
6
6
|
className?: string;
|
|
7
7
|
verticalResolutionCustomClick?: boolean;
|
|
8
|
+
hideResolutionMenu?: boolean;
|
|
8
9
|
};
|
|
9
|
-
export declare const Resolution: (props: Props) => React.JSX.Element;
|
|
10
|
+
export declare const Resolution: (props: Props) => React.JSX.Element | null;
|
|
10
11
|
export {};
|
|
@@ -16,7 +16,8 @@ export const Resolution = props => {
|
|
|
16
16
|
addContent,
|
|
17
17
|
hasContent,
|
|
18
18
|
className,
|
|
19
|
-
verticalResolutionCustomClick
|
|
19
|
+
verticalResolutionCustomClick,
|
|
20
|
+
hideResolutionMenu
|
|
20
21
|
} = props;
|
|
21
22
|
const {
|
|
22
23
|
resolution,
|
|
@@ -54,6 +55,9 @@ export const Resolution = props => {
|
|
|
54
55
|
event.emit(pauseTimeToHideAllComponent);
|
|
55
56
|
return true;
|
|
56
57
|
});
|
|
58
|
+
if (hideResolutionMenu) {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
57
61
|
return /*#__PURE__*/React.createElement(View, {
|
|
58
62
|
onClick: onResolution,
|
|
59
63
|
className: clsx(className)
|
|
@@ -52,11 +52,14 @@ export declare const VoiceIntercom: React.ForwardRefExoticComponent<{
|
|
|
52
52
|
style?: React.CSSProperties | undefined;
|
|
53
53
|
intercomClassName?: string | undefined;
|
|
54
54
|
iconClassName?: string | undefined;
|
|
55
|
+
iconImageClassName?: string | undefined;
|
|
56
|
+
icon?: string | React.ReactNode;
|
|
55
57
|
widthScale?: number | undefined;
|
|
56
58
|
heightScale?: number | undefined;
|
|
57
59
|
onTouchStart?: TouchEventHandler['onTouchStart'];
|
|
58
60
|
onTouchEnd?: TouchEventHandler['onTouchEnd'];
|
|
59
61
|
talkingColor?: string | undefined;
|
|
62
|
+
bgColor?: string | undefined;
|
|
60
63
|
mode?: "circle" | "verticalSmall" | "fullSmall" | undefined;
|
|
61
64
|
disabled?: boolean | undefined;
|
|
62
65
|
} & React.RefAttributes<unknown>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
import React, { useRef, useContext, useState, useEffect, forwardRef, useImperativeHandle } from 'react';
|
|
3
|
-
import { View, getSystemInfoSync } from '@ray-js/ray';
|
|
3
|
+
import { View, Image, getSystemInfoSync } from '@ray-js/ray';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import Svg from '@ray-js/svg';
|
|
6
6
|
import { useStore, getDefaultStore, updateAtom } from '../../ctx/store';
|
|
@@ -15,6 +15,8 @@ export const VoiceIntercom = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
15
15
|
style,
|
|
16
16
|
intercomClassName,
|
|
17
17
|
iconClassName,
|
|
18
|
+
iconImageClassName,
|
|
19
|
+
icon,
|
|
18
20
|
// recording: recordingAtom,
|
|
19
21
|
// intercom: intercomAtom,
|
|
20
22
|
// intercomMode: intercomModeAtom,
|
|
@@ -28,6 +30,7 @@ export const VoiceIntercom = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
28
30
|
widthScale = 0.11,
|
|
29
31
|
heightScale = 0.12,
|
|
30
32
|
talkingColor = '#ffffff',
|
|
33
|
+
bgColor,
|
|
31
34
|
disabled = false
|
|
32
35
|
} = props;
|
|
33
36
|
const [frame, setFrame] = useState(0);
|
|
@@ -178,9 +181,14 @@ export const VoiceIntercom = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
178
181
|
const animationFactor = Math.sin((frame + index) / 5) * 20; // 使用正弦波来模拟动态变化
|
|
179
182
|
return [50, 130, 180, 130, 50][index] + animationFactor; // 可以根据需求修改此逻辑
|
|
180
183
|
};
|
|
184
|
+
|
|
185
|
+
// 渲染对讲中的动画
|
|
186
|
+
|
|
187
|
+
// 渲染非对讲状态的图标
|
|
188
|
+
|
|
181
189
|
return /*#__PURE__*/React.createElement(View, {
|
|
182
190
|
style: _objectSpread(_objectSpread({}, style), mode === 'circle' && {
|
|
183
|
-
background: radialGradient(brandColor)
|
|
191
|
+
background: bgColor || radialGradient(brandColor)
|
|
184
192
|
}),
|
|
185
193
|
className: clsx({
|
|
186
194
|
'ipc-player-plugin-voice-intercom': mode === 'circle',
|
|
@@ -188,7 +196,7 @@ export const VoiceIntercom = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
188
196
|
}, intercomClassName),
|
|
189
197
|
onTouchStart: handTouchStart,
|
|
190
198
|
onTouchEnd: onTouchEnd
|
|
191
|
-
}, intercom ? /*#__PURE__*/React.createElement(View, {
|
|
199
|
+
}, intercom ? (() => /*#__PURE__*/React.createElement(View, {
|
|
192
200
|
className: clsx({
|
|
193
201
|
'ipc-player-plugin-voice-small-ing-intercom': mode !== 'circle'
|
|
194
202
|
})
|
|
@@ -206,7 +214,22 @@ export const VoiceIntercom = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
206
214
|
rx: index === 0 || index === 4 ? 1 : 2 // 控制圆角
|
|
207
215
|
,
|
|
208
216
|
ry: index === 0 || index === 4 ? 1 : 2
|
|
209
|
-
})))) :
|
|
210
|
-
|
|
211
|
-
|
|
217
|
+
})))))() : (() => {
|
|
218
|
+
if (icon) {
|
|
219
|
+
if (typeof icon === 'string') {
|
|
220
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
221
|
+
className: clsx('icon-image-default-container', iconClassName)
|
|
222
|
+
}, /*#__PURE__*/React.createElement(Image, {
|
|
223
|
+
src: icon,
|
|
224
|
+
className: clsx('icon-image-default-size', iconImageClassName)
|
|
225
|
+
}));
|
|
226
|
+
}
|
|
227
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
228
|
+
className: clsx('icon-image-default-container', iconClassName)
|
|
229
|
+
}, icon);
|
|
230
|
+
}
|
|
231
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
232
|
+
className: clsx('icon-panel', 'icon-panel-one-way-intercom', mode === 'circle' && 'intercom-default-size', mode !== 'circle' && 'ipc-player-plugin-voice-small-intercom', iconClassName)
|
|
233
|
+
});
|
|
234
|
+
})());
|
|
212
235
|
});
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
@size: 24px;
|
|
2
2
|
|
|
3
3
|
.ipc-player-plugin-voice-intercom {
|
|
4
|
-
background: var(
|
|
4
|
+
background: var(
|
|
5
|
+
--ipc-player-plugin-voice-bg,
|
|
6
|
+
radial-gradient(77% 77% at 34% 28%, #ff997c 0%, #ff592a 99%)
|
|
7
|
+
);
|
|
5
8
|
width: calc(72px * var(--ipc-player-size-scale, 1));
|
|
6
9
|
height: calc(72px * var(--ipc-player-size-scale, 1));
|
|
7
10
|
border-radius: 50%;
|
|
@@ -51,4 +54,15 @@
|
|
|
51
54
|
.intercom-ing-small-size {
|
|
52
55
|
width: calc(var(--iconPlayerSize) * var(--ipc-player-size-scale, 1));
|
|
53
56
|
height: calc(var(--iconPlayerSize) * var(--ipc-player-size-scale, 1));
|
|
54
|
-
}
|
|
57
|
+
}
|
|
58
|
+
.icon-image-default-container {
|
|
59
|
+
width: 100%;
|
|
60
|
+
height: 100%;
|
|
61
|
+
display: flex;
|
|
62
|
+
justify-content: center;
|
|
63
|
+
align-items: center;
|
|
64
|
+
}
|
|
65
|
+
.icon-image-default-size {
|
|
66
|
+
width: 42%;
|
|
67
|
+
height: 42%;
|
|
68
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ray-js/ipc-player-integration",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.27",
|
|
4
4
|
"description": "IPC 融合播放器",
|
|
5
5
|
"main": "lib/index",
|
|
6
6
|
"files": [
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@ray-js/ipc-ptz-zoom": "^0.0.2",
|
|
39
39
|
"@ray-js/panel-sdk": "^1.13.1",
|
|
40
40
|
"@ray-js/direction-control": "^0.0.8",
|
|
41
|
-
"@ray-js/ray-ipc-player": "^2.0.
|
|
41
|
+
"@ray-js/ray-ipc-player": "^2.0.31",
|
|
42
42
|
"@ray-js/ray-ipc-utils": "^1.1.10",
|
|
43
43
|
"@ray-js/svg": "0.2.0",
|
|
44
44
|
"clsx": "^1.2.1",
|