@ray-js/ipc-player-integration 0.0.29-beta.8 → 0.0.29
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.d.ts +9 -3
- package/lib/ctx/ctx.composition.js +40 -1
- package/lib/ctx/ctx.js +5 -0
- package/lib/ctx/multiCameraCtx.d.ts +31 -1
- package/lib/ctx/multiCameraCtx.js +60 -16
- package/lib/features/initPlayerWidgets/index.d.ts +7 -1
- package/lib/features/initPlayerWidgets/index.js +14 -11
- package/lib/i18n/index.d.ts +4 -0
- package/lib/i18n/strings.d.ts +2 -0
- package/lib/i18n/strings.js +4 -2
- package/lib/iconfont/iconfont.css +126 -6
- package/lib/iconfont/iconfont.js +13 -13
- package/lib/iconfont/iconfont.json +217 -7
- package/lib/iconfont/iconfont.ttf +0 -0
- package/lib/iconfont/iconfont.woff +0 -0
- package/lib/iconfont/iconfont.woff2 +0 -0
- package/lib/index.d.ts +2 -1
- package/lib/index.js +2 -1
- package/lib/interface.d.ts +43 -2
- package/lib/ui/constant.d.ts +1 -0
- package/lib/ui/constant.js +1 -0
- package/lib/ui/ui.d.ts +1 -0
- package/lib/ui/ui.js +144 -34
- package/lib/ui/ui.less +2 -2
- package/lib/utils/index.d.ts +2 -0
- package/lib/utils/index.js +12 -1
- package/lib/utils/videoSplitHelper.d.ts +18 -0
- package/lib/utils/videoSplitHelper.js +48 -0
- package/lib/widgets/flowLowTip/flowLowTip.d.ts +8 -0
- package/lib/widgets/flowLowTip/flowLowTip.js +65 -0
- package/lib/widgets/flowLowTip/flowLowTip.less +73 -0
- package/lib/widgets/flowLowTip/index.d.ts +1 -0
- package/lib/widgets/flowLowTip/index.js +1 -0
- package/lib/widgets/fullScreen/fullScreen.js +2 -3
- package/lib/widgets/fullScreen/fullVoiceIntercom.js +1 -1
- package/lib/widgets/fullScreen/verticalScreen.js +1 -1
- package/lib/widgets/index.d.ts +2 -0
- package/lib/widgets/index.js +3 -1
- package/lib/widgets/multiCamera/index.less +23 -0
- package/lib/widgets/multiCamera/moveablePtzControl.js +16 -7
- package/lib/widgets/multiCamera/tileActions.js +2 -2
- package/lib/widgets/toggleVerticalFull/index.d.ts +1 -0
- package/lib/widgets/toggleVerticalFull/index.js +1 -0
- package/lib/widgets/toggleVerticalFull/toggleVerticalFull.d.ts +8 -0
- package/lib/widgets/toggleVerticalFull/toggleVerticalFull.js +32 -0
- package/lib/widgets/toggleVerticalFull/toggleVerticalFull.less +4 -0
- package/lib/widgets/voiceIntercom/voiceIntercom.js +12 -20
- package/lib/widgets/voiceIntercom/voiceIntercom.less +85 -0
- package/package.json +4 -4
- package/lib/features/initPlayerWidgets/multiCamera.d.ts +0 -8
- package/lib/features/initPlayerWidgets/multiCamera.js +0 -78
- package/lib/widgets/battery/battery.composition.d.ts +0 -159
- package/lib/widgets/voiceIntercom/voiceIntercom.d.ts +0 -95
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import { FullScreen } from '../widgets';
|
|
1
|
+
import { FullScreen, ToggleVerticalFull } from '../widgets';
|
|
2
2
|
import { ComponentConfig } from '../interface';
|
|
3
3
|
export declare const defaultTopLeftContent: ComponentConfig[];
|
|
4
4
|
export declare const defaultTopRightContent: ComponentConfig[];
|
|
5
5
|
export declare const defaultBottomLeftContent: ComponentConfig[];
|
|
6
|
-
export declare const defaultBottomRightContent: {
|
|
6
|
+
export declare const defaultBottomRightContent: ({
|
|
7
|
+
id: string;
|
|
8
|
+
content: typeof ToggleVerticalFull;
|
|
9
|
+
hidden: boolean;
|
|
10
|
+
} | {
|
|
7
11
|
id: string;
|
|
8
12
|
content: typeof FullScreen;
|
|
9
|
-
|
|
13
|
+
hidden?: undefined;
|
|
14
|
+
})[];
|
|
15
|
+
export declare const multiCameraAbsoluteContent: ComponentConfig[];
|
|
10
16
|
export declare const useCtx: import("../interface").UseCtx;
|
|
@@ -4,8 +4,10 @@ const _excluded = ["title", "duration"];
|
|
|
4
4
|
import { getCameraConfigInfo } from '@ray-js/ray-ipc-utils';
|
|
5
5
|
import { IntercomMode, MuteMode, ClarityType } from '@ray-js/ray-ipc-utils/lib/interface';
|
|
6
6
|
import { createUseCtx } from './ctx';
|
|
7
|
-
import { FullSmallIntercom, VerticalSmallIntercom, BatteryFull, Battery, Screenshot, TempHumidity, Signal4G, RecordVideo, FullScreen, VideoBitKBP, Muted, Resolution, Ptz } from '../widgets';
|
|
7
|
+
import { FullSmallIntercom, VerticalSmallIntercom, BatteryFull, Battery, Screenshot, TempHumidity, Signal4G, RecordVideo, FullScreen, VideoBitKBP, Muted, Resolution, Ptz, MultiPtz, TileTip, PtzMoveableTip, LandscapeTip, TileActions, MoveablePtzControl, SwitchLayout, ToggleVerticalFull } from '../widgets';
|
|
8
8
|
import { authorizeStatus } from '../utils/authorize';
|
|
9
|
+
import { landscapeTipId, moveablePtzControlId, multiPtzId, ptzMoveableTipId, tileActionsId, tileTipId } from '../ui/constant';
|
|
10
|
+
import { multiPrefix } from '../widgets/multiCamera/constants';
|
|
9
11
|
const createPlayContext = ty.createIpcPlayerContext;
|
|
10
12
|
// const createPlayContext = () => null;
|
|
11
13
|
|
|
@@ -45,15 +47,52 @@ export const defaultBottomLeftContent = [{
|
|
|
45
47
|
}, {
|
|
46
48
|
id: 'Ptz',
|
|
47
49
|
content: Ptz
|
|
50
|
+
}, {
|
|
51
|
+
id: multiPtzId,
|
|
52
|
+
content: MultiPtz,
|
|
53
|
+
hidden: true
|
|
48
54
|
}, {
|
|
49
55
|
id: 'Resolution',
|
|
50
56
|
content: Resolution
|
|
51
57
|
}];
|
|
52
58
|
export const defaultBottomRightContent = [{
|
|
59
|
+
id: 'SwitchLayout',
|
|
60
|
+
content: SwitchLayout,
|
|
61
|
+
hidden: true
|
|
62
|
+
}, {
|
|
63
|
+
id: 'ToggleVerticalFull',
|
|
64
|
+
content: ToggleVerticalFull,
|
|
65
|
+
hidden: true
|
|
66
|
+
}, {
|
|
53
67
|
id: 'FullScreen',
|
|
54
68
|
content: FullScreen
|
|
55
69
|
}];
|
|
56
70
|
const absoluteContent = [];
|
|
71
|
+
export const multiCameraAbsoluteContent = [{
|
|
72
|
+
id: tileTipId,
|
|
73
|
+
content: TileTip,
|
|
74
|
+
absoluteContentClassName: `${multiPrefix}-tile-tip-wrap`,
|
|
75
|
+
hidden: true
|
|
76
|
+
}, {
|
|
77
|
+
id: ptzMoveableTipId,
|
|
78
|
+
content: PtzMoveableTip,
|
|
79
|
+
absoluteContentClassName: `${multiPrefix}-tile-tip-wrap`,
|
|
80
|
+
hidden: true
|
|
81
|
+
}, {
|
|
82
|
+
id: landscapeTipId,
|
|
83
|
+
content: LandscapeTip,
|
|
84
|
+
absoluteContentClassName: `${multiPrefix}-tile-tip-wrap`,
|
|
85
|
+
hidden: true
|
|
86
|
+
}, {
|
|
87
|
+
id: tileActionsId,
|
|
88
|
+
absoluteContentClassName: `${multiPrefix}-actions-wrap`,
|
|
89
|
+
content: TileActions
|
|
90
|
+
}, {
|
|
91
|
+
id: moveablePtzControlId,
|
|
92
|
+
content: MoveablePtzControl,
|
|
93
|
+
absoluteNoCoverView: true,
|
|
94
|
+
hidden: true
|
|
95
|
+
}];
|
|
57
96
|
const toast = _ref => {
|
|
58
97
|
let {
|
|
59
98
|
title,
|
package/lib/ctx/ctx.js
CHANGED
|
@@ -43,6 +43,9 @@ export const createUseCtx = _ref => {
|
|
|
43
43
|
// 全屏、竖屏
|
|
44
44
|
const [screenType, setScreenType] = useAtom('vertical');
|
|
45
45
|
|
|
46
|
+
// 是否处于竖屏填充布局
|
|
47
|
+
const [isVerticalFullLayout, setIsVerticalFullLayout] = useAtom(false);
|
|
48
|
+
|
|
46
49
|
// 录像中
|
|
47
50
|
const [recording] = useAtom(false);
|
|
48
51
|
|
|
@@ -244,6 +247,8 @@ export const createUseCtx = _ref => {
|
|
|
244
247
|
verticalMic,
|
|
245
248
|
saveToAlbum,
|
|
246
249
|
screenType,
|
|
250
|
+
isVerticalFullLayout,
|
|
251
|
+
setIsVerticalFullLayout,
|
|
247
252
|
recording,
|
|
248
253
|
recordingDisabled,
|
|
249
254
|
ptzControlTipDisabled,
|
|
@@ -1,4 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { MultiCameraLayoutStyle, MultiCameraLenInfo, MultiCameraScreenMode, VideoSplitProtocol } from '../interface';
|
|
3
|
+
interface MultiCameraViewLenName {
|
|
4
|
+
index: number;
|
|
5
|
+
name: string;
|
|
6
|
+
}
|
|
7
|
+
interface MultiCameraViewDataSource {
|
|
8
|
+
selectedVideoBorderColor?: string;
|
|
9
|
+
localizerLineColor?: string;
|
|
10
|
+
localizeCrosshairColor?: string;
|
|
11
|
+
localizerTip?: string;
|
|
12
|
+
lenNames?: MultiCameraViewLenName[];
|
|
13
|
+
}
|
|
2
14
|
interface Props {
|
|
3
15
|
devId: string;
|
|
4
16
|
IPCPlayerInstance: IpcContext;
|
|
@@ -32,6 +44,14 @@ export declare const useMultiCameraCtx: (props: Props) => {
|
|
|
32
44
|
* 选中镜头信息
|
|
33
45
|
*/
|
|
34
46
|
selectedLenInfo: import("../interface").RetAtom<MultiCameraLenInfo>;
|
|
47
|
+
/**
|
|
48
|
+
* 本轮点击周期内是否触发了镜头选中事件
|
|
49
|
+
*/
|
|
50
|
+
selectVideoFiredRef: import("react").MutableRefObject<boolean>;
|
|
51
|
+
/**
|
|
52
|
+
* 最新选中镜头信息(同步引用,避免依赖渲染时机)
|
|
53
|
+
*/
|
|
54
|
+
selectedLenInfoRef: import("react").MutableRefObject<MultiCameraLenInfo>;
|
|
35
55
|
/**
|
|
36
56
|
* ptz状态
|
|
37
57
|
*/
|
|
@@ -44,11 +64,17 @@ export declare const useMultiCameraCtx: (props: Props) => {
|
|
|
44
64
|
* ipcPlayer extendProps
|
|
45
65
|
*/
|
|
46
66
|
extendProps: {
|
|
47
|
-
type: number
|
|
67
|
+
type: number;
|
|
48
68
|
onSelectVideoIndex: (this: any, event: any) => void;
|
|
49
69
|
onLayoutStatusChanged: (this: any, event: any) => void;
|
|
50
70
|
onLocalizerViewLocated: (this: any, event: any) => Promise<void>;
|
|
51
71
|
onSwipeAtVideoIndex: (this: any, event: any) => Promise<void>;
|
|
72
|
+
} | {
|
|
73
|
+
type?: undefined;
|
|
74
|
+
onSelectVideoIndex?: undefined;
|
|
75
|
+
onLayoutStatusChanged?: undefined;
|
|
76
|
+
onLocalizerViewLocated?: undefined;
|
|
77
|
+
onSwipeAtVideoIndex?: undefined;
|
|
52
78
|
};
|
|
53
79
|
/**
|
|
54
80
|
* 设置布局样式
|
|
@@ -74,5 +100,9 @@ export declare const useMultiCameraCtx: (props: Props) => {
|
|
|
74
100
|
* 获取下一个布局样式
|
|
75
101
|
*/
|
|
76
102
|
getNextLayoutStyle: (this: unknown) => Promise<MultiCameraLayoutStyle>;
|
|
103
|
+
/**
|
|
104
|
+
* 设置多目镜头视图数据
|
|
105
|
+
*/
|
|
106
|
+
setViewData: (this: unknown, dataSource: MultiCameraViewDataSource) => void;
|
|
77
107
|
};
|
|
78
108
|
export {};
|
|
@@ -1,17 +1,30 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
1
2
|
import { getDpIdByCode, publishDps } from '@ray-js/ray-ipc-utils';
|
|
2
3
|
import { useMemoizedFn } from 'ahooks';
|
|
3
4
|
import { useMemo, useRef } from 'react';
|
|
4
5
|
import { MultiCameraLayoutStyle, MultiCameraScreenMode } from '../interface';
|
|
5
6
|
import { useDpSupport } from '../hooks';
|
|
6
7
|
import { GUN_BALL, MULTI_GUN_BALL, MULTI_PTZ_CONTROL, MULTI_ZOOM_CONTROL, PTZ_CONTROL, ZOOM_CONTROL } from '../utils/content/dpCode';
|
|
8
|
+
import { getLensSupportDirections, isSwipeDirectionSupported } from '../utils';
|
|
7
9
|
import { useAtom } from './store';
|
|
8
10
|
const DEFAULT_VIDEO_SPLIT_PROTOCOL = {
|
|
9
11
|
total_split_num: 1,
|
|
10
12
|
split_info: [],
|
|
11
|
-
align_info:
|
|
13
|
+
align_info: {
|
|
14
|
+
align_group: [],
|
|
15
|
+
linked_group: [],
|
|
16
|
+
localizer_group: []
|
|
17
|
+
},
|
|
12
18
|
p_v: 3
|
|
13
19
|
};
|
|
14
20
|
const DP_CODES = [PTZ_CONTROL, GUN_BALL, ZOOM_CONTROL, MULTI_GUN_BALL, MULTI_PTZ_CONTROL, MULTI_ZOOM_CONTROL];
|
|
21
|
+
const DEFAULT_SELECTED_LEN_INFO = {
|
|
22
|
+
index: 1,
|
|
23
|
+
videoName: '',
|
|
24
|
+
supportPTZ: false,
|
|
25
|
+
supportLocalizer: false,
|
|
26
|
+
supportZoom: false
|
|
27
|
+
};
|
|
15
28
|
/**
|
|
16
29
|
* 多目摄像头相关状态、方法维护
|
|
17
30
|
*/
|
|
@@ -33,17 +46,15 @@ export const useMultiCameraCtx = props => {
|
|
|
33
46
|
const ptzTimerRef = useRef(null);
|
|
34
47
|
const [layoutStyleAtom, setLayoutStyle] = useAtom(isSupport ? MultiCameraLayoutStyle.tile : MultiCameraLayoutStyle.pip);
|
|
35
48
|
const [screenModeAtom, setScreenMode] = useAtom(isSupport ? MultiCameraScreenMode.full : MultiCameraScreenMode.short);
|
|
36
|
-
const [selectedLenInfoAtom, setSelectedLenInfo] = useAtom(
|
|
37
|
-
index: 1,
|
|
38
|
-
videoName: '',
|
|
39
|
-
supportPTZ: false,
|
|
40
|
-
supportLocalizer: false,
|
|
41
|
-
supportZoom: false
|
|
42
|
-
});
|
|
49
|
+
const [selectedLenInfoAtom, setSelectedLenInfo] = useAtom(DEFAULT_SELECTED_LEN_INFO);
|
|
43
50
|
const [nextLayoutStyleAtom, setNextLayoutStyle] = useAtom(MultiCameraLayoutStyle.invalid);
|
|
44
51
|
const [ptzStatusAtom, setPtzStatus] = useAtom(false);
|
|
52
|
+
const selectVideoFiredRef = useRef(false);
|
|
53
|
+
const selectedLenInfoRef = useRef(DEFAULT_SELECTED_LEN_INFO);
|
|
45
54
|
const handleSelectVideoIndex = useMemoizedFn(event => {
|
|
46
55
|
console.info('onSelectVideoIndex', JSON.stringify(event === null || event === void 0 ? void 0 : event.detail));
|
|
56
|
+
selectVideoFiredRef.current = true;
|
|
57
|
+
selectedLenInfoRef.current = event.detail;
|
|
47
58
|
setSelectedLenInfo(event.detail);
|
|
48
59
|
});
|
|
49
60
|
const handleLayoutStatusChanged = useMemoizedFn(event => {
|
|
@@ -120,17 +131,27 @@ export const useMultiCameraCtx = props => {
|
|
|
120
131
|
if (!isStop) {
|
|
121
132
|
// 1. 先停止之前的PTZ控制(如果有)
|
|
122
133
|
await stopPtz();
|
|
134
|
+
const directionValue = Number(direction);
|
|
135
|
+
if (!isSwipeDirectionSupported(videoSplitProtocol, index, directionValue)) {
|
|
136
|
+
const supportDirections = getLensSupportDirections(videoSplitProtocol, index);
|
|
137
|
+
console.info('onSwipeAtVideoIndex direction not supported', {
|
|
138
|
+
index,
|
|
139
|
+
direction,
|
|
140
|
+
supportDirections
|
|
141
|
+
});
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
123
144
|
|
|
124
145
|
// 2. 构建新方向的PTZ配置
|
|
125
146
|
const ptzConfig = dpSupportMap.ipc_multi_ptz_control ? {
|
|
126
147
|
code: 'ipc_multi_ptz_control',
|
|
127
148
|
value: JSON.stringify({
|
|
128
149
|
index,
|
|
129
|
-
direction: String(
|
|
150
|
+
direction: String(directionValue)
|
|
130
151
|
})
|
|
131
152
|
} : dpSupportMap.ptz_control ? {
|
|
132
153
|
code: 'ptz_control',
|
|
133
|
-
value: String(
|
|
154
|
+
value: String(directionValue)
|
|
134
155
|
} : null;
|
|
135
156
|
if (!ptzConfig) return;
|
|
136
157
|
|
|
@@ -154,15 +175,15 @@ export const useMultiCameraCtx = props => {
|
|
|
154
175
|
}
|
|
155
176
|
});
|
|
156
177
|
const extendProps = useMemo(() => {
|
|
157
|
-
return {
|
|
158
|
-
|
|
159
|
-
|
|
178
|
+
return isSupport ? {
|
|
179
|
+
type: 4,
|
|
180
|
+
// 表示多目摄像头
|
|
160
181
|
onSelectVideoIndex: handleSelectVideoIndex,
|
|
161
182
|
onLayoutStatusChanged: handleLayoutStatusChanged,
|
|
162
183
|
onLocalizerViewLocated: handleLocalizerViewLocated,
|
|
163
184
|
onSwipeAtVideoIndex: handleSwipeAtVideoIndex
|
|
164
|
-
};
|
|
165
|
-
}, [
|
|
185
|
+
} : {};
|
|
186
|
+
}, [isSupport]);
|
|
166
187
|
const _setLayoutStyle = useMemoizedFn(style => {
|
|
167
188
|
var _IPCPlayerInstance$sw;
|
|
168
189
|
IPCPlayerInstance === null || IPCPlayerInstance === void 0 || (_IPCPlayerInstance$sw = IPCPlayerInstance.switchLayoutStyle) === null || _IPCPlayerInstance$sw === void 0 || _IPCPlayerInstance$sw.call(IPCPlayerInstance, {
|
|
@@ -214,6 +235,17 @@ export const useMultiCameraCtx = props => {
|
|
|
214
235
|
}
|
|
215
236
|
});
|
|
216
237
|
});
|
|
238
|
+
const setViewData = useMemoizedFn(dataSource => {
|
|
239
|
+
var _IPCPlayerInstance$se;
|
|
240
|
+
IPCPlayerInstance === null || IPCPlayerInstance === void 0 || (_IPCPlayerInstance$se = IPCPlayerInstance.setMultiCameraViewDataSource) === null || _IPCPlayerInstance$se === void 0 || _IPCPlayerInstance$se.call(IPCPlayerInstance, _objectSpread(_objectSpread({}, dataSource), {}, {
|
|
241
|
+
success: () => {
|
|
242
|
+
console.info('setMultiCameraViewDataSource success', JSON.stringify(dataSource));
|
|
243
|
+
},
|
|
244
|
+
fail: err => {
|
|
245
|
+
console.error('setMultiCameraViewDataSource fail', err);
|
|
246
|
+
}
|
|
247
|
+
}));
|
|
248
|
+
});
|
|
217
249
|
return {
|
|
218
250
|
/**
|
|
219
251
|
* 是否支持多目
|
|
@@ -239,6 +271,14 @@ export const useMultiCameraCtx = props => {
|
|
|
239
271
|
* 选中镜头信息
|
|
240
272
|
*/
|
|
241
273
|
selectedLenInfo: selectedLenInfoAtom,
|
|
274
|
+
/**
|
|
275
|
+
* 本轮点击周期内是否触发了镜头选中事件
|
|
276
|
+
*/
|
|
277
|
+
selectVideoFiredRef,
|
|
278
|
+
/**
|
|
279
|
+
* 最新选中镜头信息(同步引用,避免依赖渲染时机)
|
|
280
|
+
*/
|
|
281
|
+
selectedLenInfoRef,
|
|
242
282
|
/**
|
|
243
283
|
* ptz状态
|
|
244
284
|
*/
|
|
@@ -274,6 +314,10 @@ export const useMultiCameraCtx = props => {
|
|
|
274
314
|
/**
|
|
275
315
|
* 获取下一个布局样式
|
|
276
316
|
*/
|
|
277
|
-
getNextLayoutStyle
|
|
317
|
+
getNextLayoutStyle,
|
|
318
|
+
/**
|
|
319
|
+
* 设置多目镜头视图数据
|
|
320
|
+
*/
|
|
321
|
+
setViewData
|
|
278
322
|
};
|
|
279
323
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { UseCtx, WidgetId } from '../../interface';
|
|
2
|
+
import { ComponentConfig, UseCtx, WidgetId } from '../../interface';
|
|
3
3
|
import { FullScreen } from '../../widgets';
|
|
4
4
|
type Ctx = ReturnType<UseCtx>;
|
|
5
5
|
export type InitPlayerWidgetsOptions = {
|
|
@@ -9,7 +9,13 @@ export type InitPlayerWidgetsOptions = {
|
|
|
9
9
|
hideRecordVideoMenu?: boolean;
|
|
10
10
|
hideResolutionMenu?: boolean;
|
|
11
11
|
hideKbsMenu?: boolean;
|
|
12
|
+
showToggleVerticalFull?: boolean;
|
|
12
13
|
directionControlProps?: Partial<React.ComponentProps<typeof FullScreen>['directionControlProps']>;
|
|
14
|
+
topLeftContent?: ComponentConfig[];
|
|
15
|
+
topRightContent?: ComponentConfig[];
|
|
16
|
+
bottomLeftContent?: ComponentConfig[];
|
|
17
|
+
bottomRightContent?: ComponentConfig[];
|
|
18
|
+
absoluteContent?: ComponentConfig[];
|
|
13
19
|
};
|
|
14
20
|
export declare function initPlayerWidgets(ctx: Ctx, options: InitPlayerWidgetsOptions): Promise<boolean>;
|
|
15
21
|
export declare function updatePlayerWidgetProps(ctx: Ctx, area: 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'absolute', widgetId: WidgetId, newProps: Record<string, any>): Promise<void>;
|
|
@@ -1,19 +1,13 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
import _cloneDeep from 'lodash/cloneDeep';
|
|
3
|
-
import { defaultTopLeftContent, defaultTopRightContent, defaultBottomLeftContent, defaultBottomRightContent } from '../../ctx';
|
|
3
|
+
import { defaultTopLeftContent, defaultTopRightContent, defaultBottomLeftContent, defaultBottomRightContent, multiCameraAbsoluteContent } from '../../ctx';
|
|
4
4
|
import { hasDpCode } from '../../utils/device';
|
|
5
5
|
import { MoveInteractiveControlButton } from '../../widgets/moveInteractiveControl';
|
|
6
|
-
import { initMultiCameraPlayerWidgets } from './multiCamera';
|
|
7
6
|
// 根据当前 dp 信息决定设置哪些 plugin
|
|
8
7
|
export async function initPlayerWidgets(ctx, options) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
return true;
|
|
13
|
-
}
|
|
14
|
-
ctx.addContent('topLeft', defaultTopLeftContent);
|
|
15
|
-
const newDefaultBottomLeftContent = _cloneDeep(defaultBottomLeftContent);
|
|
16
|
-
const newDefaultTopRightContent = _cloneDeep(defaultTopRightContent);
|
|
8
|
+
ctx.addContent('topLeft', options.topLeftContent || defaultTopLeftContent);
|
|
9
|
+
const newDefaultBottomLeftContent = _cloneDeep(options.bottomLeftContent || defaultBottomLeftContent);
|
|
10
|
+
const newDefaultTopRightContent = _cloneDeep(options.topRightContent || defaultTopRightContent);
|
|
17
11
|
const videoKbsIndex = newDefaultTopRightContent.findIndex(item => item.id === 'VideoBitKBP');
|
|
18
12
|
if (videoKbsIndex !== -1) {
|
|
19
13
|
newDefaultTopRightContent[videoKbsIndex].initProps = {
|
|
@@ -44,7 +38,7 @@ export async function initPlayerWidgets(ctx, options) {
|
|
|
44
38
|
};
|
|
45
39
|
}
|
|
46
40
|
ctx.addContent('bottomLeft', newDefaultBottomLeftContent);
|
|
47
|
-
const newDefaultBottomRightContent = _cloneDeep(defaultBottomRightContent);
|
|
41
|
+
const newDefaultBottomRightContent = _cloneDeep(options.bottomRightContent || defaultBottomRightContent);
|
|
48
42
|
const fullScreenIndex = newDefaultBottomRightContent.findIndex(item => item.id === 'FullScreen');
|
|
49
43
|
if (fullScreenIndex !== -1) {
|
|
50
44
|
// @ts-ignore
|
|
@@ -64,6 +58,15 @@ export async function initPlayerWidgets(ctx, options) {
|
|
|
64
58
|
}, -1);
|
|
65
59
|
}
|
|
66
60
|
});
|
|
61
|
+
|
|
62
|
+
// 初始化多目设备控件
|
|
63
|
+
if (ctx.multiCameraCtx.isSupport) {
|
|
64
|
+
ctx.hideContent('bottomLeft', 'Ptz'); // 隐藏单路云台
|
|
65
|
+
ctx.showContent('bottomRight', 'SwitchLayout'); // 多目默认展示切换竖屏组件
|
|
66
|
+
ctx.addContent('absolute', multiCameraAbsoluteContent);
|
|
67
|
+
} else if (options.showToggleVerticalFull) {
|
|
68
|
+
ctx.showContent('bottomRight', 'ToggleVerticalFull');
|
|
69
|
+
}
|
|
67
70
|
return true;
|
|
68
71
|
}
|
|
69
72
|
export async function updatePlayerWidgetProps(ctx, area, widgetId, newProps) {
|
package/lib/i18n/index.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ declare const Strings: kit.I18N<{
|
|
|
27
27
|
ipc_player_tip_next: string;
|
|
28
28
|
ipc_player_tip_confirm: string;
|
|
29
29
|
ipc_player_ptz_moveable_tip_text: string;
|
|
30
|
+
ipc_player_flow_low_tip: string;
|
|
30
31
|
};
|
|
31
32
|
zh: {
|
|
32
33
|
ipc_player_resolution_HD: string;
|
|
@@ -55,6 +56,7 @@ declare const Strings: kit.I18N<{
|
|
|
55
56
|
ipc_player_tip_next: string;
|
|
56
57
|
ipc_player_tip_confirm: string;
|
|
57
58
|
ipc_player_ptz_moveable_tip_text: string;
|
|
59
|
+
ipc_player_flow_low_tip: string;
|
|
58
60
|
};
|
|
59
61
|
}, {
|
|
60
62
|
ipc_player_resolution_HD: string;
|
|
@@ -83,6 +85,7 @@ declare const Strings: kit.I18N<{
|
|
|
83
85
|
ipc_player_tip_next: string;
|
|
84
86
|
ipc_player_tip_confirm: string;
|
|
85
87
|
ipc_player_ptz_moveable_tip_text: string;
|
|
88
|
+
ipc_player_flow_low_tip: string;
|
|
86
89
|
} | {
|
|
87
90
|
ipc_player_resolution_HD: string;
|
|
88
91
|
ipc_player_resolution_SD: string;
|
|
@@ -110,5 +113,6 @@ declare const Strings: kit.I18N<{
|
|
|
110
113
|
ipc_player_tip_next: string;
|
|
111
114
|
ipc_player_tip_confirm: string;
|
|
112
115
|
ipc_player_ptz_moveable_tip_text: string;
|
|
116
|
+
ipc_player_flow_low_tip: string;
|
|
113
117
|
}>;
|
|
114
118
|
export default Strings;
|
package/lib/i18n/strings.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ declare const _default: {
|
|
|
26
26
|
ipc_player_tip_next: string;
|
|
27
27
|
ipc_player_tip_confirm: string;
|
|
28
28
|
ipc_player_ptz_moveable_tip_text: string;
|
|
29
|
+
ipc_player_flow_low_tip: string;
|
|
29
30
|
};
|
|
30
31
|
zh: {
|
|
31
32
|
ipc_player_resolution_HD: string;
|
|
@@ -54,6 +55,7 @@ declare const _default: {
|
|
|
54
55
|
ipc_player_tip_next: string;
|
|
55
56
|
ipc_player_tip_confirm: string;
|
|
56
57
|
ipc_player_ptz_moveable_tip_text: string;
|
|
58
|
+
ipc_player_flow_low_tip: string;
|
|
57
59
|
};
|
|
58
60
|
};
|
|
59
61
|
export default _default;
|
package/lib/i18n/strings.js
CHANGED
|
@@ -25,7 +25,8 @@ export default {
|
|
|
25
25
|
ipc_player_tile_tip_text_step2: 'Click here to switch the multiple viewing modes of the lens',
|
|
26
26
|
ipc_player_tip_next: 'Next',
|
|
27
27
|
ipc_player_tip_confirm: 'Got it',
|
|
28
|
-
ipc_player_ptz_moveable_tip_text: 'Hold the middle to drag the direction control area'
|
|
28
|
+
ipc_player_ptz_moveable_tip_text: 'Hold the middle to drag the direction control area',
|
|
29
|
+
ipc_player_flow_low_tip: 'The device’s remaining data is below 200MB. Please recharge as soon as possible.'
|
|
29
30
|
},
|
|
30
31
|
zh: {
|
|
31
32
|
ipc_player_resolution_HD: '高清',
|
|
@@ -53,6 +54,7 @@ export default {
|
|
|
53
54
|
ipc_player_tile_tip_text_step2: '点击此处可切换镜头的多种查看方式',
|
|
54
55
|
ipc_player_tip_next: '下一步',
|
|
55
56
|
ipc_player_tip_confirm: '知道了',
|
|
56
|
-
ipc_player_ptz_moveable_tip_text: '长按中间可拖动方向控制区域'
|
|
57
|
+
ipc_player_ptz_moveable_tip_text: '长按中间可拖动方向控制区域',
|
|
58
|
+
ipc_player_flow_low_tip: '设备当前剩余流量不足200M,请尽快充值'
|
|
57
59
|
}
|
|
58
60
|
};
|
|
@@ -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=1772529309738') format('woff2'),
|
|
4
|
+
url('iconfont.woff?t=1772529309738') format('woff'),
|
|
5
|
+
url('iconfont.ttf?t=1772529309738') format('truetype');
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
.icon-panel {
|
|
@@ -13,14 +13,134 @@
|
|
|
13
13
|
-moz-osx-font-smoothing: grayscale;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
.icon-panel-
|
|
17
|
-
content: "\
|
|
16
|
+
.icon-panel-tip-right-arrow:before {
|
|
17
|
+
content: "\e697";
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.icon-panel-tip-circle:before {
|
|
21
|
+
content: "\e698";
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.icon-panel-night-light:before {
|
|
25
|
+
content: "\e60e";
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.icon-panel-feed-reminder:before {
|
|
29
|
+
content: "\e60c";
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.icon-panel-baby-core:before {
|
|
33
|
+
content: "\e611";
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.icon-panel-door-close-small:before {
|
|
37
|
+
content: "\e6671";
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.icon-panel-door-close-large:before {
|
|
41
|
+
content: "\e6672";
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.icon-panel-door-open-small:before {
|
|
45
|
+
content: "\e6673";
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.icon-panel-door-open-large:before {
|
|
49
|
+
content: "\e6674";
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.icon-panel-common-error:before {
|
|
53
|
+
content: "\e696";
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.icon-panel-traffic-top-up:before {
|
|
57
|
+
content: "\e693";
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.icon-panel-elevator-up:before {
|
|
61
|
+
content: "\e6666";
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.icon-panel-elevator-down:before {
|
|
65
|
+
content: "\e6667";
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.icon-panel-access-elevator:before {
|
|
69
|
+
content: "\e6668";
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.icon-panel-elevator-updown:before {
|
|
73
|
+
content: "\e6669";
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.icon-panel-traffic-unauthorized:before {
|
|
77
|
+
content: "\e692";
|
|
18
78
|
}
|
|
19
79
|
|
|
20
|
-
.icon-panel-
|
|
80
|
+
.icon-panel-traffic-low-data:before {
|
|
81
|
+
content: "\e691";
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.icon-panel-traffic-not-obtain:before {
|
|
85
|
+
content: "\e690";
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.icon-panel-swimming-anomaly:before {
|
|
89
|
+
content: "\e67a";
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.icon-panel-feed-fish:before {
|
|
93
|
+
content: "\e67b";
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.icon-panel-water-temp:before {
|
|
97
|
+
content: "\e67c";
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.icon-panel-fun-fish-TV:before {
|
|
101
|
+
content: "\e67d";
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.icon-panel-fish-care-expert:before {
|
|
105
|
+
content: "\e67e";
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.icon-panel-water-quality:before {
|
|
21
109
|
content: "\e68b";
|
|
22
110
|
}
|
|
23
111
|
|
|
112
|
+
.icon-panel-swimming-issue:before {
|
|
113
|
+
content: "\e68d";
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.icon-panel-fish-anomaly:before {
|
|
117
|
+
content: "\e68e";
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.icon-panel-a-AI-fish-healthcheck:before {
|
|
121
|
+
content: "\e68f";
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.icon-panel-favorites1:before {
|
|
125
|
+
content: "\e69f";
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.icon-panel-belly-up1:before {
|
|
129
|
+
content: "\e6a0";
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.icon-panel-favorite1:before {
|
|
133
|
+
content: "\e694";
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.icon-panel-replay1:before {
|
|
137
|
+
content: "\e695";
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.icon-panel-gun-ball:before {
|
|
141
|
+
content: "\e68c";
|
|
142
|
+
}
|
|
143
|
+
|
|
24
144
|
.icon-panel-thumbnail:before {
|
|
25
145
|
content: "\e67f";
|
|
26
146
|
}
|