@ray-js/ipc-player-integration 0.0.50-beta.0 → 0.0.50-beta.2
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/README.md +11 -11
- package/lib/ctx/ctx.composition.js +5 -5
- package/lib/features/initPlayerWidgets/index.d.ts +0 -3
- package/lib/features/initPlayerWidgets/index.js +1 -2
- package/lib/hooks/useBattery/index.js +7 -1
- package/lib/iconfont/iconfont.css +127 -7
- package/lib/iconfont/iconfont.js +10 -10
- package/lib/iconfont/iconfont.json +233 -23
- package/lib/iconfont/iconfont.ttf +0 -0
- package/lib/iconfont/iconfont.woff +0 -0
- package/lib/iconfont/iconfont.woff2 +0 -0
- package/lib/interface.d.ts +1 -1
- package/lib/interface.js +1 -1
- package/lib/ports.output.d.ts +13 -0
- package/lib/ports.output.js +13 -0
- package/lib/ui/bottomLeftContent.js +141 -27
- package/lib/ui/bottomRightContent.d.ts +6 -1
- package/lib/ui/bottomRightContent.js +43 -5
- package/lib/ui/ui.js +58 -4
- package/lib/ui/ui.less +17 -0
- package/lib/widgets/battery/battery.js +11 -3
- package/lib/widgets/battery/battery.less +11 -0
- package/lib/widgets/battery/batteryFull.js +11 -3
- package/lib/widgets/zoomTurntable/constants.d.ts +44 -12
- package/lib/widgets/zoomTurntable/constants.js +61 -17
- package/lib/widgets/zoomTurntable/lensModel.test.js +1 -1
- package/lib/widgets/zoomTurntable/lensSkill.d.ts +1 -1
- package/lib/widgets/zoomTurntable/lensSkill.js +1 -1
- package/lib/widgets/zoomTurntable/turntable/index.js +4 -1
- package/lib/widgets/zoomTurntable/turntable/rjs/index.rjs +138 -9
- package/lib/widgets/zoomTurntable/turntable/rjs/index.tyml +1 -0
- package/lib/widgets/zoomTurntable/useLensZoom.d.ts +3 -4
- package/lib/widgets/zoomTurntable/useLensZoom.js +94 -12
- package/lib/widgets/zoomTurntable/zoomTurntableDock.js +76 -4
- package/lib/widgets/zoomTurntable/zoomTurntableEntry.d.ts +0 -3
- package/lib/widgets/zoomTurntable/zoomTurntableEntry.js +20 -5
- package/lib/widgets/zoomTurntable/zoomTurntableEntry.less +11 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -260,17 +260,17 @@ instance.addContent('absolute', {
|
|
|
260
260
|
|
|
261
261
|
Convenient device-state access (all exported from the package root):
|
|
262
262
|
|
|
263
|
-
| Hook | Signature
|
|
264
|
-
| ---------------- |
|
|
265
|
-
| `useBattery` | `(devId) => { batteryValue, batteryCharging }` | Battery level / charging state |
|
|
266
|
-
| `usePtz` | `(devId) => boolean`
|
|
267
|
-
| `useTemperature` | `(devId) => number`
|
|
268
|
-
| `useHumidity` | `() => number`
|
|
269
|
-
| `useSignal4G` | `(devId) => { dpValue, signalKey }`
|
|
270
|
-
| `useDpState` | —
|
|
271
|
-
| `useDpSupport` | —
|
|
272
|
-
| `useSchemaInfo` | —
|
|
273
|
-
| `useMemoizedFn` | —
|
|
263
|
+
| Hook | Signature | Description |
|
|
264
|
+
| ---------------- | ------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
265
|
+
| `useBattery` | `(devId) => { batteryValue, batteryCharging, powerMode, solarCharging }` | Battery level / charging state. `powerMode` is the raw `wireless_powermode` DP (`0` battery / `1` wired charging / `2` solar charging); `batteryCharging` is `true` for both charging modes |
|
|
266
|
+
| `usePtz` | `(devId) => boolean` | Whether PTZ is supported |
|
|
267
|
+
| `useTemperature` | `(devId) => number` | Temperature |
|
|
268
|
+
| `useHumidity` | `() => number` | Humidity |
|
|
269
|
+
| `useSignal4G` | `(devId) => { dpValue, signalKey }` | 4G signal strength |
|
|
270
|
+
| `useDpState` | — | Read/write DP state |
|
|
271
|
+
| `useDpSupport` | — | DP support check |
|
|
272
|
+
| `useSchemaInfo` | — | Device schema info |
|
|
273
|
+
| `useMemoizedFn` | — | Stable function reference |
|
|
274
274
|
|
|
275
275
|
### `Utils` & device helpers
|
|
276
276
|
|
|
@@ -47,6 +47,11 @@ export const defaultBottomLeftContent = [{
|
|
|
47
47
|
}, {
|
|
48
48
|
id: 'Siren',
|
|
49
49
|
content: Siren
|
|
50
|
+
}, /* 焦距转盘入口:仅多镜头设备(ipc_multi_zoom 上报值 cnt > 1)会真正渲染 */
|
|
51
|
+
{
|
|
52
|
+
id: 'ZoomTurntableEntry',
|
|
53
|
+
content: ZoomTurntableEntry,
|
|
54
|
+
hidden: true
|
|
50
55
|
}, /* TryExperience 必须紧跟 Muted,在 VerticalSmallIntercom 之前 */
|
|
51
56
|
{
|
|
52
57
|
id: 'TryExperience',
|
|
@@ -68,11 +73,6 @@ export const defaultBottomLeftContent = [{
|
|
|
68
73
|
id: 'RealTimeMagnification',
|
|
69
74
|
content: RealTimeMagnification,
|
|
70
75
|
hidden: true
|
|
71
|
-
}, /* 焦距转盘入口:仅多镜头设备(ipc_multi_zoom 上报值 cnt > 1)会真正渲染 */
|
|
72
|
-
{
|
|
73
|
-
id: 'ZoomTurntableEntry',
|
|
74
|
-
content: ZoomTurntableEntry,
|
|
75
|
-
hidden: true
|
|
76
76
|
}];
|
|
77
77
|
export const defaultBottomRightContent = [{
|
|
78
78
|
id: 'SwitchLayout',
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ComponentConfig, UseCtx, WidgetId } from '../../interface';
|
|
3
3
|
import { FullScreen } from '../../widgets';
|
|
4
|
-
import type { ZoomSkill } from '../../widgets/zoomTurntable/lensSkill';
|
|
5
4
|
type Ctx = ReturnType<UseCtx>;
|
|
6
5
|
export type InitPlayerWidgetsOptions = {
|
|
7
6
|
verticalResolutionCustomClick?: boolean;
|
|
@@ -18,8 +17,6 @@ export type InitPlayerWidgetsOptions = {
|
|
|
18
17
|
* 仅为功能开关;实际渲染还要 ipc_multi_zoom 解析出 cnt > 1,单镜头设备传 true 也不出现。
|
|
19
18
|
*/
|
|
20
19
|
showZoomTurntable?: boolean;
|
|
21
|
-
/** 调试用:直接注入镜头能力(ZoomSkill),跳过 ipc_multi_zoom DP 解析 */
|
|
22
|
-
mockZoomSkill?: ZoomSkill | boolean;
|
|
23
20
|
directionControlProps?: Partial<React.ComponentProps<typeof FullScreen>['directionControlProps']>;
|
|
24
21
|
hideSmartImageQualityState?: boolean;
|
|
25
22
|
topLeftContent?: ComponentConfig[];
|
|
@@ -60,8 +60,7 @@ export async function initPlayerWidgets(ctx, options) {
|
|
|
60
60
|
newDefaultBottomLeftContent[zoomTurntableIndex].hidden = false;
|
|
61
61
|
// @ts-ignore
|
|
62
62
|
newDefaultBottomLeftContent[zoomTurntableIndex].initProps = {
|
|
63
|
-
showZoomTurntable: true
|
|
64
|
-
mockZoomSkill: options.mockZoomSkill
|
|
63
|
+
showZoomTurntable: true
|
|
65
64
|
};
|
|
66
65
|
}
|
|
67
66
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
2
|
import { useDpState } from '../useDpState';
|
|
3
3
|
import { addZero } from '../../utils';
|
|
4
|
+
import { PowerMode } from '../../ports.output';
|
|
4
5
|
const POWER_MODE_DP_CODE = 'wireless_powermode';
|
|
5
6
|
const POWER_VALUE_DP_CODE = 'wireless_electricity';
|
|
6
7
|
const POWER_CALC_METHOD_DP_CODE = 'battery_report_cap';
|
|
@@ -42,9 +43,14 @@ export const useBattery = devId => {
|
|
|
42
43
|
return undefined;
|
|
43
44
|
};
|
|
44
45
|
const batteryInfo = useMemo(() => {
|
|
46
|
+
const powerMode = dpState[POWER_MODE_DP_CODE];
|
|
47
|
+
const solarCharging = powerMode === PowerMode.Solar;
|
|
45
48
|
return {
|
|
46
49
|
batteryValue: getEleValue(dpState[POWER_VALUE_DP_CODE], dpState[POWER_CALC_METHOD_DP_CODE]),
|
|
47
|
-
|
|
50
|
+
// 有线充电与太阳能充电都属于充电中
|
|
51
|
+
batteryCharging: powerMode === PowerMode.Charging || solarCharging,
|
|
52
|
+
powerMode,
|
|
53
|
+
solarCharging
|
|
48
54
|
};
|
|
49
55
|
}, [dpState]);
|
|
50
56
|
return batteryInfo;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
@font-face {
|
|
2
2
|
font-family: "icon-panel"; /* Project id 4727767 */
|
|
3
|
-
src: url('iconfont.woff2?t=
|
|
4
|
-
url('iconfont.woff?t=
|
|
5
|
-
url('iconfont.ttf?t=
|
|
3
|
+
src: url('iconfont.woff2?t=1787047721746') format('woff2'),
|
|
4
|
+
url('iconfont.woff?t=1787047721746') format('woff'),
|
|
5
|
+
url('iconfont.ttf?t=1787047721746') format('truetype');
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
.icon-panel {
|
|
@@ -13,6 +13,130 @@
|
|
|
13
13
|
-moz-osx-font-smoothing: grayscale;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
.icon-panel-solar:before {
|
|
17
|
+
content: "\e6ee";
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.icon-panel-a-rongqi722:before {
|
|
21
|
+
content: "\e6ed";
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.icon-panel-favorite:before {
|
|
25
|
+
content: "\e6e9";
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.icon-panel-album1:before {
|
|
29
|
+
content: "\e6e5";
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.icon-panel-grain:before {
|
|
33
|
+
content: "\e6e6";
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.icon-panel-pump:before {
|
|
37
|
+
content: "\e6e7";
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.icon-panel-favorites2:before {
|
|
41
|
+
content: "\e6e8";
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.icon-panel-bird-identification:before {
|
|
45
|
+
content: "\e6e4";
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.icon-panel-pir-close:before {
|
|
49
|
+
content: "\e6e2";
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.icon-panel-pir-open:before {
|
|
53
|
+
content: "\e6e3";
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.icon-panel-Access-Stop:before {
|
|
57
|
+
content: "\e6e1";
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.icon-panel-uvb1:before {
|
|
61
|
+
content: "\e6f3";
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.icon-panel-uva:before {
|
|
65
|
+
content: "\e6f4";
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.icon-panel-circle:before {
|
|
69
|
+
content: "\e6f2";
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.icon-panel-heat-light:before {
|
|
73
|
+
content: "\e6f1";
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.icon-panel-exhaust:before {
|
|
77
|
+
content: "\e6ea";
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.icon-panel-atomization:before {
|
|
81
|
+
content: "\e6eb";
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.icon-panel-spray:before {
|
|
85
|
+
content: "\e6ec";
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.icon-panel-intake:before {
|
|
89
|
+
content: "\e6ef";
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.icon-panel-heat-pad:before {
|
|
93
|
+
content: "\e6f0";
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.icon-panel-location:before {
|
|
97
|
+
content: "\e6ab";
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.icon-panel-weight:before {
|
|
101
|
+
content: "\e6e0";
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.icon-panel-energy:before {
|
|
105
|
+
content: "\e6de";
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.icon-panel-air-setting:before {
|
|
109
|
+
content: "\e6df";
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.icon-panel-a-zu1:before {
|
|
113
|
+
content: "\e6dd";
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.icon-panel-zhuapai2:before {
|
|
117
|
+
content: "\e6dc";
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.icon-panel-zhuapai1:before {
|
|
121
|
+
content: "\e6db";
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.icon-panel-zhuapai:before {
|
|
125
|
+
content: "\e6da";
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.icon-panel-xingxing_mian:before {
|
|
129
|
+
content: "\e617";
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.icon-panel-anti-flicker-off:before {
|
|
133
|
+
content: "\e6d9";
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.icon-panel-left-arrow-center:before {
|
|
137
|
+
content: "\e6d8";
|
|
138
|
+
}
|
|
139
|
+
|
|
16
140
|
.icon-panel-v-alarm-light-siren:before {
|
|
17
141
|
content: "\e6d5";
|
|
18
142
|
}
|
|
@@ -209,10 +333,6 @@
|
|
|
209
333
|
content: "\e6ac";
|
|
210
334
|
}
|
|
211
335
|
|
|
212
|
-
.icon-panel-a-dingweixiao:before {
|
|
213
|
-
content: "\e6ab";
|
|
214
|
-
}
|
|
215
|
-
|
|
216
336
|
.icon-panel-zujifenxiang:before {
|
|
217
337
|
content: "\e6aa";
|
|
218
338
|
}
|