@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.
Files changed (64) hide show
  1. package/lib/ctx/ctx.composition.js +19 -9
  2. package/lib/ctx/ctx.d.ts +5 -3
  3. package/lib/ctx/ctx.js +43 -22
  4. package/lib/ctx/store.d.ts +1 -1
  5. package/lib/ctx/store.js +1 -1
  6. package/lib/i18n/index.d.ts +12 -0
  7. package/lib/i18n/strings.d.ts +6 -0
  8. package/lib/i18n/strings.js +8 -2
  9. package/lib/interface.d.ts +11 -7
  10. package/lib/plugins/battery/battery.composition.d.ts +47 -5
  11. package/lib/plugins/battery/battery.composition.js +4 -0
  12. package/lib/plugins/battery/battery.js +9 -9
  13. package/lib/plugins/battery/battery.less +4 -14
  14. package/lib/plugins/battery/batteryFull.d.ts +13 -0
  15. package/lib/plugins/battery/batteryFull.js +46 -0
  16. package/lib/plugins/fullScreen/fullScreen.js +11 -7
  17. package/lib/plugins/fullScreen/fullScreen.less +7 -7
  18. package/lib/plugins/fullScreen/verticalScreen.d.ts +1 -1
  19. package/lib/plugins/fullScreen/verticalScreen.js +8 -5
  20. package/lib/plugins/fullScreen/verticalScreen.less +7 -12
  21. package/lib/plugins/index.d.ts +3 -1
  22. package/lib/plugins/index.js +6 -2
  23. package/lib/plugins/muted/muted.js +4 -4
  24. package/lib/plugins/muted/muted.less +8 -1
  25. package/lib/plugins/ptz/ptz.js +5 -21
  26. package/lib/plugins/ptz/ptz.less +1 -1
  27. package/lib/plugins/ptz/ptzControl.js +1 -3
  28. package/lib/plugins/recordVideo/recordVideo.js +8 -7
  29. package/lib/plugins/recordVideo/recordVideo.less +2 -2
  30. package/lib/plugins/resolution/fullResolutionControl.js +0 -1
  31. package/lib/plugins/resolution/resolution.js +6 -3
  32. package/lib/plugins/resolution/resolution.less +4 -3
  33. package/lib/plugins/screenshot/screenshot.js +40 -16
  34. package/lib/plugins/screenshot/screenshot.less +28 -23
  35. package/lib/plugins/smallIntercom/index.d.ts +1 -0
  36. package/lib/plugins/smallIntercom/index.js +1 -0
  37. package/lib/plugins/smallIntercom/smallIntercom.d.ts +6 -0
  38. package/lib/plugins/smallIntercom/smallIntercom.js +49 -0
  39. package/lib/plugins/smallIntercom/smallIntercom.less +50 -0
  40. package/lib/plugins/tempHumidity/tempHumidity.d.ts +1 -1
  41. package/lib/plugins/tempHumidity/tempHumidity.js +12 -4
  42. package/lib/plugins/videoBitKBP/index.d.ts +1 -0
  43. package/lib/plugins/videoBitKBP/index.js +1 -0
  44. package/lib/plugins/{videoBitKbps/videoBitKbps.d.ts → videoBitKBP/videoBitKBP.d.ts} +2 -2
  45. package/lib/plugins/{videoBitKbps/videoBitKbps.js → videoBitKBP/videoBitKBP.js} +14 -7
  46. package/lib/plugins/{videoBitKbps/videoBitKbps.less → videoBitKBP/videoBitKBP.less} +4 -5
  47. package/lib/ui/bottomLeftContent.d.ts +8 -0
  48. package/lib/ui/{topContent.js → bottomLeftContent.js} +10 -9
  49. package/lib/ui/bottomRightContent.d.ts +8 -0
  50. package/lib/ui/bottomRightContent.js +33 -0
  51. package/lib/ui/constant.d.ts +1 -0
  52. package/lib/ui/constant.js +2 -1
  53. package/lib/ui/hooks.d.ts +1 -1
  54. package/lib/ui/hooks.js +4 -3
  55. package/lib/ui/{bottomContent.d.ts → topLeftContent.d.ts} +2 -2
  56. package/lib/ui/topLeftContent.js +37 -0
  57. package/lib/ui/{topContent.d.ts → topRightContent.d.ts} +2 -2
  58. package/lib/ui/{bottomContent.js → topRightContent.js} +10 -9
  59. package/lib/ui/ui.d.ts +3 -0
  60. package/lib/ui/ui.js +97 -37
  61. package/lib/ui/ui.less +162 -25
  62. package/package.json +6 -8
  63. package/lib/plugins/videoBitKbps/index.d.ts +0 -1
  64. 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, VideoBitKbps, Muted, Resolution, Ptz } from '../plugins';
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 topContent = [{
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: 'VideoBitKbps',
20
- content: VideoBitKbps
23
+ id: 'VideoBitKBP',
24
+ content: VideoBitKBP
21
25
  }];
22
- const absoluteContent = [];
23
- const bottomContent = [{
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
- defaultTopContent: topContent,
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
- defaultTopContent?: ComponentConfig[];
6
- defaultBottomContent?: ComponentConfig[];
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, defaultTopContent, defaultBottomContent, defaultAbsoluteContent, authorizeStatus, toast, getMemoryState, setMuteMemoryState, }: Depend) => UseCtx;
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
- defaultTopContent,
10
- defaultBottomContent,
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
- initTopContent,
21
- initBottomContent,
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 [topContent] = useAtom(initTopContent || defaultTopContent || []);
59
- const [bottomContent] = useAtom(initBottomContent || defaultBottomContent || []);
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
- topContent,
232
- bottomContent,
237
+ topLeftContent,
238
+ topRightContent,
239
+ bottomLeftContent,
240
+ bottomRightContent,
233
241
  absoluteContent,
234
- addContent: (type, config) => {
235
- function createNewData(originData, newData) {
236
- if (newData instanceof Array) return [...originData, ...newData];
237
- return [...originData, newData];
238
- }
239
- if (type === 'top') {
240
- updateAtom(topContent, prevValue => createNewData(prevValue, config));
241
- } else if (type === 'bottom') {
242
- updateAtom(bottomContent, prevValue => createNewData(prevValue, config));
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 === 'top') {
249
- updateAtom(topContent, prevValue => prevValue.filter(item => item.id !== id));
250
- } else if (type === 'bottom') {
251
- updateAtom(bottomContent, prevValue => prevValue.filter(item => item.id !== id));
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
  }
@@ -1,6 +1,6 @@
1
1
  import { RetAtom } from '../interface';
2
2
  export { getDefaultStore } from 'jotai';
3
- export declare const topContent: import("jotai").PrimitiveAtom<never[]> & {
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 topContent = atom([]);
4
+ export const topLeftContent = atom([]);
5
5
  export const useAtom = defaultValue => {
6
6
  const ref = useRef();
7
7
  if (!ref.current) {
@@ -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;
@@ -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;
@@ -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
  };
@@ -26,13 +26,15 @@ export declare const enum PlayState {
26
26
  }
27
27
  export type UseCtx = (options: {
28
28
  devId: string;
29
- initTopContent?: ComponentConfig[];
30
- initBottomContent?: ComponentConfig[];
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
- topContent: RetAtom<ComponentConfig[]>;
49
- bottomContent: RetAtom<ComponentConfig[]>;
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: 'top' | 'bottom' | 'absolute', config: ComponentConfig<T> | ComponentConfig<T>[]) => void;
64
- deleteContent: (type: 'top' | 'bottom' | 'absolute', id: string) => void;
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
- topContent: import("../..").RetAtom<import("../..").ComponentConfig<any & Record<string, any>>[]>;
20
- bottomContent: import("../..").RetAtom<import("../..").ComponentConfig<any & Record<string, any>>[]>;
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" | "top" | "bottom", config: import("../..").ComponentConfig<T> | import("../..").ComponentConfig<T>[]) => void;
35
- deleteContent: (type: "absolute" | "top" | "bottom", id: string) => void;
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 store = useStore({
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('ipc-player-plugin-battery', {
28
- 'ipc-player-plugin-battery-relative': store.screenType === 'full',
29
- 'ipc-player-plugin-battery-absolute': store.screenType === 'vertical'
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.1);
8
- backdrop-filter: blur(10px);
9
- &.ipc-player-plugin-battery-absolute {
10
- position: absolute;
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('top', {
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-warp',
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('top', verticalScreenId);
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: "ipc-player-plugin-full-screen icon-panel icon-panel-landscape",
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(--iconFontSize) * var(--ipc-player-size-scale, 1));
7
+ font-size: calc(var(--iconPlayerSize) * var(--ipc-player-size-scale, 1)) !important;
8
8
  }
9
9
 
10
- .ipc-player-plugin-full-screen-voice-warp {
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(10px * var(--ipc-player-size-scale, 1));;
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: "ipc-player-plugin-vertical-screen",
13
+ className: clsx(className),
11
14
  onClick: onClick
12
- }, /*#__PURE__*/React.createElement(View, {
13
- className: "icon-panel icon-panel-left-arrow ipc-player-plugin-vertical-screen-icon"
15
+ }, /*#__PURE__*/React.createElement(Text, {
16
+ className: clsx('icon-panel', 'icon-panel-left-arrow', 'ipc-player-plugin-vertical-screen-icon')
14
17
  }));
15
18
  }