@ray-js/ipc-player-integration 0.0.1-beta-21 → 0.0.1-beta-22
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 +43 -22
- package/lib/ctx/store.d.ts +1 -1
- package/lib/ctx/store.js +1 -1
- package/lib/i18n/index.d.ts +12 -0
- package/lib/i18n/strings.d.ts +6 -0
- package/lib/i18n/strings.js +8 -2
- package/lib/interface.d.ts +11 -7
- 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 +11 -7
- package/lib/plugins/fullScreen/fullScreen.less +7 -7
- 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/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 +5 -21
- package/lib/plugins/ptz/ptz.less +1 -1
- package/lib/plugins/ptz/ptzControl.js +1 -3
- package/lib/plugins/recordVideo/recordVideo.js +8 -7
- package/lib/plugins/recordVideo/recordVideo.less +2 -2
- package/lib/plugins/resolution/fullResolutionControl.js +0 -1
- package/lib/plugins/resolution/resolution.js +6 -3
- package/lib/plugins/resolution/resolution.less +4 -3
- package/lib/plugins/screenshot/screenshot.js +40 -16
- package/lib/plugins/screenshot/screenshot.less +28 -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/ui/bottomLeftContent.d.ts +8 -0
- package/lib/ui/{topContent.js → bottomLeftContent.js} +10 -9
- 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/topLeftContent.js +37 -0
- package/lib/ui/{topContent.d.ts → topRightContent.d.ts} +2 -2
- package/lib/ui/{bottomContent.js → topRightContent.js} +10 -9
- package/lib/ui/ui.d.ts +3 -0
- package/lib/ui/ui.js +97 -37
- package/lib/ui/ui.less +162 -25
- package/package.json +6 -8
- package/lib/plugins/videoBitKbps/index.d.ts +0 -1
- package/lib/plugins/videoBitKbps/index.js +0 -1
|
@@ -4,23 +4,29 @@ const _excluded = ["title", "duration"];
|
|
|
4
4
|
import IPCUtils 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 { Battery, Screenshot, TempHumidity, RecordVideo, FullScreen,
|
|
7
|
+
import { SmallIntercom, BatteryFull, Battery, Screenshot, TempHumidity, RecordVideo, FullScreen, VideoBitKBP, Muted, Resolution, Ptz } from '../plugins';
|
|
8
8
|
import { authorizeStatus } from '../utils/authorize';
|
|
9
9
|
const createPlayContext = ty.createIpcPlayerContext;
|
|
10
10
|
// const createPlayContext = () => null;
|
|
11
11
|
|
|
12
|
-
const
|
|
12
|
+
const topLeftContent = [{
|
|
13
13
|
id: 'Battery',
|
|
14
14
|
content: Battery
|
|
15
|
+
}];
|
|
16
|
+
const topRightContent = [{
|
|
17
|
+
id: 'BatteryFull',
|
|
18
|
+
content: BatteryFull
|
|
15
19
|
}, {
|
|
16
20
|
id: 'TempHumidity',
|
|
17
21
|
content: TempHumidity
|
|
18
22
|
}, {
|
|
19
|
-
id: '
|
|
20
|
-
content:
|
|
23
|
+
id: 'VideoBitKBP',
|
|
24
|
+
content: VideoBitKBP
|
|
21
25
|
}];
|
|
22
|
-
const
|
|
23
|
-
|
|
26
|
+
const bottomLeftContent = [{
|
|
27
|
+
id: 'SmallIntercom',
|
|
28
|
+
content: SmallIntercom
|
|
29
|
+
}, {
|
|
24
30
|
id: 'Screenshot',
|
|
25
31
|
content: Screenshot
|
|
26
32
|
}, {
|
|
@@ -35,10 +41,12 @@ const bottomContent = [{
|
|
|
35
41
|
}, {
|
|
36
42
|
id: 'Resolution',
|
|
37
43
|
content: Resolution
|
|
38
|
-
}
|
|
44
|
+
}];
|
|
45
|
+
const bottomRightContent = [{
|
|
39
46
|
id: 'FullScreen',
|
|
40
47
|
content: FullScreen
|
|
41
48
|
}];
|
|
49
|
+
const absoluteContent = [];
|
|
42
50
|
const toast = _ref => {
|
|
43
51
|
let {
|
|
44
52
|
title,
|
|
@@ -94,9 +102,11 @@ const setMuteMemoryState = (devId, value) => {
|
|
|
94
102
|
};
|
|
95
103
|
export const useCtx = createUseCtx({
|
|
96
104
|
createPlayContext,
|
|
97
|
-
|
|
105
|
+
defaultTopLeftContent: topLeftContent,
|
|
106
|
+
defaultTopRightContent: topRightContent,
|
|
107
|
+
defaultBottomLeftContent: bottomLeftContent,
|
|
108
|
+
defaultBottomRightContent: bottomRightContent,
|
|
98
109
|
defaultAbsoluteContent: absoluteContent,
|
|
99
|
-
defaultBottomContent: bottomContent,
|
|
100
110
|
authorizeStatus: authorizeStatus,
|
|
101
111
|
toast,
|
|
102
112
|
getMemoryState,
|
package/lib/ctx/ctx.d.ts
CHANGED
|
@@ -2,13 +2,15 @@ import { ComponentConfig, UseCtx } from '../interface';
|
|
|
2
2
|
import type { createPlayContext, AuthorizeStatus, Toast, GetMemoryState, SetMuteMemoryState } from './ports.output';
|
|
3
3
|
type Depend = {
|
|
4
4
|
createPlayContext: createPlayContext;
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
defaultTopLeftContent?: ComponentConfig[];
|
|
6
|
+
defaultTopRightContent?: ComponentConfig[];
|
|
7
|
+
defaultBottomLeftContent?: ComponentConfig[];
|
|
8
|
+
defaultBottomRightContent?: ComponentConfig[];
|
|
7
9
|
defaultAbsoluteContent?: ComponentConfig[];
|
|
8
10
|
authorizeStatus: AuthorizeStatus;
|
|
9
11
|
toast: Toast;
|
|
10
12
|
getMemoryState: GetMemoryState;
|
|
11
13
|
setMuteMemoryState: SetMuteMemoryState;
|
|
12
14
|
};
|
|
13
|
-
export declare const createUseCtx: ({ createPlayContext,
|
|
15
|
+
export declare const createUseCtx: ({ createPlayContext, defaultTopLeftContent, defaultTopRightContent, defaultBottomLeftContent, defaultBottomRightContent, defaultAbsoluteContent, authorizeStatus, toast, getMemoryState, setMuteMemoryState, }: Depend) => UseCtx;
|
|
14
16
|
export {};
|
package/lib/ctx/ctx.js
CHANGED
|
@@ -6,8 +6,10 @@ const SAVE_TO_ALBUM = 1;
|
|
|
6
6
|
export const createUseCtx = _ref => {
|
|
7
7
|
let {
|
|
8
8
|
createPlayContext,
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
defaultTopLeftContent,
|
|
10
|
+
defaultTopRightContent,
|
|
11
|
+
defaultBottomLeftContent,
|
|
12
|
+
defaultBottomRightContent,
|
|
11
13
|
defaultAbsoluteContent,
|
|
12
14
|
authorizeStatus,
|
|
13
15
|
toast,
|
|
@@ -17,8 +19,10 @@ export const createUseCtx = _ref => {
|
|
|
17
19
|
return _ref2 => {
|
|
18
20
|
let {
|
|
19
21
|
devId,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
initTopLeftContent,
|
|
23
|
+
initTopRightContent,
|
|
24
|
+
initBottomLeftContent,
|
|
25
|
+
initBottomRightContent,
|
|
22
26
|
initAbsoluteContent,
|
|
23
27
|
saveToAlbum = SAVE_TO_ALBUM
|
|
24
28
|
} = _ref2;
|
|
@@ -55,8 +59,10 @@ export const createUseCtx = _ref => {
|
|
|
55
59
|
const setPlayState = useCallback(value => {
|
|
56
60
|
updateAtom(playState, value);
|
|
57
61
|
}, [playState]);
|
|
58
|
-
const [
|
|
59
|
-
const [
|
|
62
|
+
const [topLeftContent] = useAtom(initTopLeftContent || defaultTopLeftContent || []);
|
|
63
|
+
const [topRightContent] = useAtom(initTopRightContent || defaultTopRightContent || []);
|
|
64
|
+
const [bottomLeftContent] = useAtom(initBottomLeftContent || defaultBottomLeftContent || []);
|
|
65
|
+
const [bottomRightContent] = useAtom(initBottomRightContent || defaultBottomRightContent || []);
|
|
60
66
|
const [absoluteContent] = useAtom(initAbsoluteContent || defaultAbsoluteContent || []);
|
|
61
67
|
const {
|
|
62
68
|
_playState
|
|
@@ -228,27 +234,42 @@ export const createUseCtx = _ref => {
|
|
|
228
234
|
setPtzActive,
|
|
229
235
|
setFullResolutionActive,
|
|
230
236
|
setScreenType,
|
|
231
|
-
|
|
232
|
-
|
|
237
|
+
topLeftContent,
|
|
238
|
+
topRightContent,
|
|
239
|
+
bottomLeftContent,
|
|
240
|
+
bottomRightContent,
|
|
233
241
|
absoluteContent,
|
|
234
|
-
addContent: (type, config)
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
242
|
+
addContent: function (type, config) {
|
|
243
|
+
let position = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
244
|
+
// 组合数据, 保存到对应位置, 并去重
|
|
245
|
+
const createNewData = (originData, newData, position) => {
|
|
246
|
+
// 如果newData是数组, 则插入整个数组
|
|
247
|
+
if (Array.isArray(newData)) {
|
|
248
|
+
return [...originData.slice(0, position), ...newData, ...originData.slice(position)];
|
|
249
|
+
}
|
|
250
|
+
return [...originData.slice(0, position), newData, ...originData.slice(position)];
|
|
251
|
+
};
|
|
252
|
+
if (type === 'topLeft') {
|
|
253
|
+
updateAtom(topLeftContent, prevValue => createNewData(prevValue, config, position));
|
|
254
|
+
} else if (type === 'topRight') {
|
|
255
|
+
updateAtom(topRightContent, prevValue => createNewData(prevValue, config, position));
|
|
256
|
+
} else if (type === 'bottomLeft') {
|
|
257
|
+
updateAtom(bottomLeftContent, prevValue => createNewData(prevValue, config, position));
|
|
258
|
+
} else if (type === 'bottomRight') {
|
|
259
|
+
updateAtom(bottomRightContent, prevValue => createNewData(prevValue, config, position));
|
|
243
260
|
} else {
|
|
244
|
-
updateAtom(absoluteContent, prevValue => createNewData(prevValue, config));
|
|
261
|
+
updateAtom(absoluteContent, prevValue => createNewData(prevValue, config, position));
|
|
245
262
|
}
|
|
246
263
|
},
|
|
247
264
|
deleteContent: (type, id) => {
|
|
248
|
-
if (type === '
|
|
249
|
-
updateAtom(
|
|
250
|
-
} else if (type === '
|
|
251
|
-
updateAtom(
|
|
265
|
+
if (type === 'topLeft') {
|
|
266
|
+
updateAtom(topLeftContent, prevValue => prevValue.filter(item => item.id !== id));
|
|
267
|
+
} else if (type === 'topRight') {
|
|
268
|
+
updateAtom(topRightContent, prevValue => prevValue.filter(item => item.id !== id));
|
|
269
|
+
} else if (type === 'bottomLeft') {
|
|
270
|
+
updateAtom(bottomLeftContent, prevValue => prevValue.filter(item => item.id !== id));
|
|
271
|
+
} else if (type === 'bottomRight') {
|
|
272
|
+
updateAtom(bottomLeftContent, prevValue => prevValue.filter(item => item.id !== id));
|
|
252
273
|
} else {
|
|
253
274
|
updateAtom(absoluteContent, prevValue => prevValue.filter(item => item.id !== id));
|
|
254
275
|
}
|
package/lib/ctx/store.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RetAtom } from '../interface';
|
|
2
2
|
export { getDefaultStore } from 'jotai';
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const topLeftContent: import("jotai").PrimitiveAtom<never[]> & {
|
|
4
4
|
init: never[];
|
|
5
5
|
};
|
|
6
6
|
type Action<T> = T | ((prevValue: T) => T);
|
package/lib/ctx/store.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useRef } from 'react';
|
|
2
2
|
import { atom, useAtomValue, getDefaultStore } from 'jotai';
|
|
3
3
|
export { getDefaultStore } from 'jotai';
|
|
4
|
-
export const
|
|
4
|
+
export const topLeftContent = atom([]);
|
|
5
5
|
export const useAtom = defaultValue => {
|
|
6
6
|
const ref = useRef();
|
|
7
7
|
if (!ref.current) {
|
package/lib/i18n/index.d.ts
CHANGED
|
@@ -4,19 +4,31 @@ declare const Strings: kit.I18N<{
|
|
|
4
4
|
ipc_player_resolution_HD: string;
|
|
5
5
|
ipc_player_resolution_SD: string;
|
|
6
6
|
ipc_player_current_resolution_is_equal: string;
|
|
7
|
+
ipc_player_screenshot_success_tip: string;
|
|
8
|
+
ipc_player_recording_success_tip: string;
|
|
9
|
+
ipc_player_shot_or_record_check: string;
|
|
7
10
|
};
|
|
8
11
|
zh: {
|
|
9
12
|
ipc_player_resolution_HD: string;
|
|
10
13
|
ipc_player_resolution_SD: string;
|
|
11
14
|
ipc_player_current_resolution_is_equal: string;
|
|
15
|
+
ipc_player_screenshot_success_tip: string;
|
|
16
|
+
ipc_player_recording_success_tip: string;
|
|
17
|
+
ipc_player_shot_or_record_check: string;
|
|
12
18
|
};
|
|
13
19
|
}, {
|
|
14
20
|
ipc_player_resolution_HD: string;
|
|
15
21
|
ipc_player_resolution_SD: string;
|
|
16
22
|
ipc_player_current_resolution_is_equal: string;
|
|
23
|
+
ipc_player_screenshot_success_tip: string;
|
|
24
|
+
ipc_player_recording_success_tip: string;
|
|
25
|
+
ipc_player_shot_or_record_check: string;
|
|
17
26
|
} | {
|
|
18
27
|
ipc_player_resolution_HD: string;
|
|
19
28
|
ipc_player_resolution_SD: string;
|
|
20
29
|
ipc_player_current_resolution_is_equal: string;
|
|
30
|
+
ipc_player_screenshot_success_tip: string;
|
|
31
|
+
ipc_player_recording_success_tip: string;
|
|
32
|
+
ipc_player_shot_or_record_check: string;
|
|
21
33
|
}>;
|
|
22
34
|
export default Strings;
|
package/lib/i18n/strings.d.ts
CHANGED
|
@@ -3,11 +3,17 @@ declare const _default: {
|
|
|
3
3
|
ipc_player_resolution_HD: string;
|
|
4
4
|
ipc_player_resolution_SD: string;
|
|
5
5
|
ipc_player_current_resolution_is_equal: string;
|
|
6
|
+
ipc_player_screenshot_success_tip: string;
|
|
7
|
+
ipc_player_recording_success_tip: string;
|
|
8
|
+
ipc_player_shot_or_record_check: string;
|
|
6
9
|
};
|
|
7
10
|
zh: {
|
|
8
11
|
ipc_player_resolution_HD: string;
|
|
9
12
|
ipc_player_resolution_SD: string;
|
|
10
13
|
ipc_player_current_resolution_is_equal: string;
|
|
14
|
+
ipc_player_screenshot_success_tip: string;
|
|
15
|
+
ipc_player_recording_success_tip: string;
|
|
16
|
+
ipc_player_shot_or_record_check: string;
|
|
11
17
|
};
|
|
12
18
|
};
|
|
13
19
|
export default _default;
|
package/lib/i18n/strings.js
CHANGED
|
@@ -2,11 +2,17 @@ export default {
|
|
|
2
2
|
en: {
|
|
3
3
|
ipc_player_resolution_HD: 'HD',
|
|
4
4
|
ipc_player_resolution_SD: 'SD',
|
|
5
|
-
ipc_player_current_resolution_is_equal: 'Already at current clarity'
|
|
5
|
+
ipc_player_current_resolution_is_equal: 'Already at current clarity',
|
|
6
|
+
ipc_player_screenshot_success_tip: 'Screenshot saved to album',
|
|
7
|
+
ipc_player_recording_success_tip: 'Recording saved to album',
|
|
8
|
+
ipc_player_shot_or_record_check: 'View'
|
|
6
9
|
},
|
|
7
10
|
zh: {
|
|
8
11
|
ipc_player_resolution_HD: '高清',
|
|
9
12
|
ipc_player_resolution_SD: '标清',
|
|
10
|
-
ipc_player_current_resolution_is_equal: '已是当前清晰度'
|
|
13
|
+
ipc_player_current_resolution_is_equal: '已是当前清晰度',
|
|
14
|
+
ipc_player_screenshot_success_tip: '截图已保存在APP相册',
|
|
15
|
+
ipc_player_recording_success_tip: '录像已保存在APP相册',
|
|
16
|
+
ipc_player_shot_or_record_check: '查看'
|
|
11
17
|
}
|
|
12
18
|
};
|
package/lib/interface.d.ts
CHANGED
|
@@ -26,13 +26,15 @@ export declare const enum PlayState {
|
|
|
26
26
|
}
|
|
27
27
|
export type UseCtx = (options: {
|
|
28
28
|
devId: string;
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
initTopLeftContent?: ComponentConfig[];
|
|
30
|
+
initTopRightContent?: ComponentConfig[];
|
|
31
|
+
initBottomLeftContent?: ComponentConfig[];
|
|
32
|
+
initBottomRightContent?: ComponentConfig[];
|
|
31
33
|
initAbsoluteContent?: ComponentConfig[];
|
|
32
34
|
saveToAlbum?: 0 | 1;
|
|
33
35
|
}) => {
|
|
34
36
|
devId: string;
|
|
35
|
-
brandColor: string
|
|
37
|
+
brandColor: RetAtom<string>;
|
|
36
38
|
saveToAlbum: 0 | 1;
|
|
37
39
|
screenType: RetAtom<ScreenType>;
|
|
38
40
|
recording: RetAtom<boolean>;
|
|
@@ -45,8 +47,10 @@ export type UseCtx = (options: {
|
|
|
45
47
|
fullResolutionActive: RetAtom<boolean>;
|
|
46
48
|
playState: RetAtom<PlayState>;
|
|
47
49
|
IPCPlayerInstance: IpcContext;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
+
topLeftContent: RetAtom<ComponentConfig[]>;
|
|
51
|
+
topRightContent: RetAtom<ComponentConfig[]>;
|
|
52
|
+
bottomLeftContent: RetAtom<ComponentConfig[]>;
|
|
53
|
+
bottomRightContent: RetAtom<ComponentConfig[]>;
|
|
50
54
|
absoluteContent: RetAtom<ComponentConfig[]>;
|
|
51
55
|
setBrandColor: (color: string) => void;
|
|
52
56
|
setScreenType: (type: ScreenType) => void;
|
|
@@ -60,8 +64,8 @@ export type UseCtx = (options: {
|
|
|
60
64
|
changeStreamStatus: (value: PlayerStreamStatus) => void;
|
|
61
65
|
getStreamStatus: () => PlayerStreamStatus;
|
|
62
66
|
setPlayState: (value: PlayState) => void;
|
|
63
|
-
addContent: <T>(type: '
|
|
64
|
-
deleteContent: (type: '
|
|
67
|
+
addContent: <T>(type: 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'absolute', config: ComponentConfig<T> | ComponentConfig<T>[]) => void;
|
|
68
|
+
deleteContent: (type: 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'absolute', id: string) => void;
|
|
65
69
|
toast: Toast;
|
|
66
70
|
};
|
|
67
71
|
export type ComponentConfig<T = ReturnType<UseCtx> & Record<string, any>> = {
|
|
@@ -3,7 +3,7 @@ export declare const Battery: import("react").FunctionComponent<{
|
|
|
3
3
|
IPCPlayerContext: IpcContext;
|
|
4
4
|
} & {
|
|
5
5
|
devId: string;
|
|
6
|
-
brandColor: string
|
|
6
|
+
brandColor: import("../..").RetAtom<string>;
|
|
7
7
|
saveToAlbum: 0 | 1;
|
|
8
8
|
screenType: import("../..").RetAtom<import("../..").ScreenType>;
|
|
9
9
|
recording: import("../..").RetAtom<boolean>;
|
|
@@ -16,8 +16,10 @@ export declare const Battery: import("react").FunctionComponent<{
|
|
|
16
16
|
fullResolutionActive: import("../..").RetAtom<boolean>;
|
|
17
17
|
playState: import("../..").RetAtom<import("../..").PlayState>;
|
|
18
18
|
IPCPlayerInstance: IpcContext;
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
topLeftContent: import("../..").RetAtom<import("../..").ComponentConfig<any & Record<string, any>>[]>;
|
|
20
|
+
topRightContent: import("../..").RetAtom<import("../..").ComponentConfig<any & Record<string, any>>[]>;
|
|
21
|
+
bottomLeftContent: import("../..").RetAtom<import("../..").ComponentConfig<any & Record<string, any>>[]>;
|
|
22
|
+
bottomRightContent: import("../..").RetAtom<import("../..").ComponentConfig<any & Record<string, any>>[]>;
|
|
21
23
|
absoluteContent: import("../..").RetAtom<import("../..").ComponentConfig<any & Record<string, any>>[]>;
|
|
22
24
|
setBrandColor: (color: string) => void;
|
|
23
25
|
setScreenType: (type: import("../..").ScreenType) => void;
|
|
@@ -31,8 +33,48 @@ export declare const Battery: import("react").FunctionComponent<{
|
|
|
31
33
|
changeStreamStatus: (value: import("../..").PlayerStreamStatus) => void;
|
|
32
34
|
getStreamStatus: () => import("../..").PlayerStreamStatus;
|
|
33
35
|
setPlayState: (value: import("../..").PlayState) => void;
|
|
34
|
-
addContent: <T>(type: "absolute" | "
|
|
35
|
-
deleteContent: (type: "absolute" | "
|
|
36
|
+
addContent: <T>(type: "absolute" | "topLeft" | "topRight" | "bottomLeft" | "bottomRight", config: import("../..").ComponentConfig<T> | import("../..").ComponentConfig<T>[]) => void;
|
|
37
|
+
deleteContent: (type: "absolute" | "topLeft" | "topRight" | "bottomLeft" | "bottomRight", id: string) => void;
|
|
38
|
+
toast: import("../../ports.output").Toast;
|
|
39
|
+
} & {
|
|
40
|
+
className?: string | undefined;
|
|
41
|
+
}>;
|
|
42
|
+
export declare const BatteryFull: import("react").FunctionComponent<{
|
|
43
|
+
IPCPlayerContext: IpcContext;
|
|
44
|
+
} & {
|
|
45
|
+
devId: string;
|
|
46
|
+
brandColor: import("../..").RetAtom<string>;
|
|
47
|
+
saveToAlbum: 0 | 1;
|
|
48
|
+
screenType: import("../..").RetAtom<import("../..").ScreenType>;
|
|
49
|
+
recording: import("../..").RetAtom<boolean>;
|
|
50
|
+
mute: import("../..").RetAtom<boolean>;
|
|
51
|
+
intercom: import("../..").RetAtom<boolean>;
|
|
52
|
+
intercomMode: import("../..").RetAtom<import("@ray-js/ray-ipc-utils/lib/interface").IntercomMode>;
|
|
53
|
+
ptzActive: import("../..").RetAtom<boolean>;
|
|
54
|
+
resolution: import("../..").RetAtom<string>;
|
|
55
|
+
resolutionList: import("../..").RetAtom<string[]>;
|
|
56
|
+
fullResolutionActive: import("../..").RetAtom<boolean>;
|
|
57
|
+
playState: import("../..").RetAtom<import("../..").PlayState>;
|
|
58
|
+
IPCPlayerInstance: IpcContext;
|
|
59
|
+
topLeftContent: import("../..").RetAtom<import("../..").ComponentConfig<any & Record<string, any>>[]>;
|
|
60
|
+
topRightContent: import("../..").RetAtom<import("../..").ComponentConfig<any & Record<string, any>>[]>;
|
|
61
|
+
bottomLeftContent: import("../..").RetAtom<import("../..").ComponentConfig<any & Record<string, any>>[]>;
|
|
62
|
+
bottomRightContent: import("../..").RetAtom<import("../..").ComponentConfig<any & Record<string, any>>[]>;
|
|
63
|
+
absoluteContent: import("../..").RetAtom<import("../..").ComponentConfig<any & Record<string, any>>[]>;
|
|
64
|
+
setBrandColor: (color: string) => void;
|
|
65
|
+
setScreenType: (type: import("../..").ScreenType) => void;
|
|
66
|
+
setPtzActive: (type: boolean) => void;
|
|
67
|
+
setResolution: (type: string) => void;
|
|
68
|
+
setResolutionList: (type: string[]) => void;
|
|
69
|
+
setFullResolutionActive: (type: boolean) => void;
|
|
70
|
+
setRecording: (value: boolean) => Promise<boolean>;
|
|
71
|
+
setIntercom: (value: boolean) => Promise<boolean>;
|
|
72
|
+
setMute: (value: boolean) => Promise<boolean>;
|
|
73
|
+
changeStreamStatus: (value: import("../..").PlayerStreamStatus) => void;
|
|
74
|
+
getStreamStatus: () => import("../..").PlayerStreamStatus;
|
|
75
|
+
setPlayState: (value: import("../..").PlayState) => void;
|
|
76
|
+
addContent: <T>(type: "absolute" | "topLeft" | "topRight" | "bottomLeft" | "bottomRight", config: import("../..").ComponentConfig<T> | import("../..").ComponentConfig<T>[]) => void;
|
|
77
|
+
deleteContent: (type: "absolute" | "topLeft" | "topRight" | "bottomLeft" | "bottomRight", id: string) => void;
|
|
36
78
|
toast: import("../../ports.output").Toast;
|
|
37
79
|
} & {
|
|
38
80
|
className?: string | undefined;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { createBattery } from './battery';
|
|
2
|
+
import { createBatteryFull } from './batteryFull';
|
|
2
3
|
import { useBattery } from '../../hooks';
|
|
3
4
|
export const Battery = createBattery({
|
|
4
5
|
useBattery // todo
|
|
6
|
+
});
|
|
7
|
+
export const BatteryFull = createBatteryFull({
|
|
8
|
+
useBattery // todo
|
|
5
9
|
});
|
|
@@ -10,24 +10,24 @@ export const createBattery = _ref => {
|
|
|
10
10
|
return props => {
|
|
11
11
|
const {
|
|
12
12
|
className,
|
|
13
|
-
devId
|
|
14
|
-
screenType
|
|
13
|
+
devId
|
|
15
14
|
} = props;
|
|
16
|
-
const
|
|
15
|
+
const {
|
|
17
16
|
screenType
|
|
17
|
+
} = useStore({
|
|
18
|
+
screenType: props.screenType
|
|
18
19
|
});
|
|
19
20
|
const {
|
|
20
21
|
batteryValue,
|
|
21
22
|
batteryCharging
|
|
22
23
|
} = useBattery(devId);
|
|
23
|
-
if (batteryValue === undefined) {
|
|
24
|
+
if (batteryValue === undefined || screenType === 'full') {
|
|
24
25
|
return null;
|
|
25
26
|
}
|
|
26
27
|
return /*#__PURE__*/React.createElement(View, {
|
|
27
|
-
className: clsx(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}, className)
|
|
28
|
+
className: clsx(className)
|
|
29
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
30
|
+
className: "ipc-player-plugin-battery"
|
|
31
31
|
}, /*#__PURE__*/React.createElement(View, {
|
|
32
32
|
className: "ipc-player-plugin-battery-border"
|
|
33
33
|
}, /*#__PURE__*/React.createElement(View, {
|
|
@@ -41,6 +41,6 @@ export const createBattery = _ref => {
|
|
|
41
41
|
className: "ipc-player-plugin-battery-value-value"
|
|
42
42
|
}))), /*#__PURE__*/React.createElement(Text, {
|
|
43
43
|
className: "ipc-player-plugin-battery-text"
|
|
44
|
-
}, batteryValue, "%"));
|
|
44
|
+
}, batteryValue, "%")));
|
|
45
45
|
};
|
|
46
46
|
};
|
|
@@ -4,20 +4,10 @@
|
|
|
4
4
|
height: calc(24px * var(--ipc-player-size-scale, 1));
|
|
5
5
|
padding: 0 calc(9px * var(--ipc-player-size-scale, 1));
|
|
6
6
|
border-radius: calc(24px * var(--ipc-player-size-scale, 1));
|
|
7
|
-
background-color: rgba(255, 255, 255, 0.
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
top: 50%;
|
|
12
|
-
left: calc(16px * var(--ipc-player-size-scale, 1));
|
|
13
|
-
transform: translateY(-50%);
|
|
14
|
-
}
|
|
15
|
-
&.ipc-player-plugin-battery-relative {
|
|
16
|
-
position: relative;
|
|
17
|
-
top: 0;
|
|
18
|
-
left: 0;
|
|
19
|
-
transform: translateY(0);
|
|
20
|
-
}
|
|
7
|
+
background-color: rgba(255, 255, 255, 0.3);
|
|
8
|
+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
9
|
+
// backdrop-filter: blur(10px);
|
|
10
|
+
|
|
21
11
|
.ipc-player-plugin-battery-border {
|
|
22
12
|
position: relative;
|
|
23
13
|
width: calc(16px * var(--ipc-player-size-scale, 1));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { UseBattery } from '../../ports.output';
|
|
3
|
+
import { ComponentConfigProps } from '../../interface';
|
|
4
|
+
import './battery.less';
|
|
5
|
+
type Depend = {
|
|
6
|
+
useBattery: UseBattery;
|
|
7
|
+
};
|
|
8
|
+
type Props = ComponentConfigProps & {
|
|
9
|
+
className?: string;
|
|
10
|
+
};
|
|
11
|
+
type CreateBattery = (deps: Depend) => React.FunctionComponent<Props>;
|
|
12
|
+
export declare const createBatteryFull: CreateBattery;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View, Text } from '@ray-js/ray';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import { useStore } from '../../ctx/store';
|
|
5
|
+
import './battery.less';
|
|
6
|
+
export const createBatteryFull = _ref => {
|
|
7
|
+
let {
|
|
8
|
+
useBattery
|
|
9
|
+
} = _ref;
|
|
10
|
+
return props => {
|
|
11
|
+
const {
|
|
12
|
+
className,
|
|
13
|
+
devId
|
|
14
|
+
} = props;
|
|
15
|
+
const {
|
|
16
|
+
screenType
|
|
17
|
+
} = useStore({
|
|
18
|
+
screenType: props.screenType
|
|
19
|
+
});
|
|
20
|
+
const {
|
|
21
|
+
batteryValue,
|
|
22
|
+
batteryCharging
|
|
23
|
+
} = useBattery(devId);
|
|
24
|
+
if (batteryValue === undefined || screenType === 'vertical') {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
28
|
+
className: clsx(className)
|
|
29
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
30
|
+
className: "ipc-player-plugin-battery"
|
|
31
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
32
|
+
className: "ipc-player-plugin-battery-border"
|
|
33
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
34
|
+
className: "ipc-player-plugin-battery-border-1"
|
|
35
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
36
|
+
className: "ipc-player-plugin-battery-value-wrap"
|
|
37
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
38
|
+
style: {
|
|
39
|
+
width: `${batteryValue}%`
|
|
40
|
+
},
|
|
41
|
+
className: "ipc-player-plugin-battery-value-value"
|
|
42
|
+
}))), /*#__PURE__*/React.createElement(Text, {
|
|
43
|
+
className: "ipc-player-plugin-battery-text"
|
|
44
|
+
}, batteryValue, "%")));
|
|
45
|
+
};
|
|
46
|
+
};
|
|
@@ -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);
|
|
@@ -60,7 +62,7 @@ export function FullScreen(props) {
|
|
|
60
62
|
className: clsx('ipc-player-plugin-full-screen-voice')
|
|
61
63
|
}, /*#__PURE__*/React.createElement(VoiceIntercom, props));
|
|
62
64
|
},
|
|
63
|
-
absoluteContentClassName: 'ipc-player-plugin-full-screen-voice-
|
|
65
|
+
absoluteContentClassName: 'ipc-player-plugin-full-screen-voice-wrap',
|
|
64
66
|
initProps: _objectSpread({}, props)
|
|
65
67
|
});
|
|
66
68
|
};
|
|
@@ -79,7 +81,7 @@ export function FullScreen(props) {
|
|
|
79
81
|
});
|
|
80
82
|
ty.showMenuButton();
|
|
81
83
|
ty.showStatusBar();
|
|
82
|
-
deleteContent('
|
|
84
|
+
deleteContent('topLeft', verticalScreenId);
|
|
83
85
|
deleteContent('absolute', voiceIntercomId);
|
|
84
86
|
deleteContent('absolute', ptzControlId);
|
|
85
87
|
deleteContent('absolute', fullResolutionId);
|
|
@@ -108,7 +110,9 @@ export function FullScreen(props) {
|
|
|
108
110
|
};
|
|
109
111
|
if (screenType === 'full') return null;
|
|
110
112
|
return /*#__PURE__*/React.createElement(View, {
|
|
111
|
-
className:
|
|
113
|
+
className: clsx(className),
|
|
112
114
|
onClick: () => handClick('full')
|
|
113
|
-
}
|
|
115
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
116
|
+
className: clsx('icon-panel', 'icon-panel-landscape', 'ipc-player-plugin-full-screen')
|
|
117
|
+
}));
|
|
114
118
|
}
|
|
@@ -1,17 +1,17 @@
|
|
|
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
|
-
right: calc(
|
|
14
|
+
right: calc(36px * var(--ipc-player-size-scale, 1));;
|
|
15
15
|
z-index: 3;
|
|
16
16
|
}
|
|
17
17
|
|
|
@@ -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
|
}
|