@ray-js/ipc-player-integration 0.0.5 → 0.0.6

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.
@@ -0,0 +1,14 @@
1
+ import { ClarityType } from '@ray-js/ray-ipc-utils/lib/interface';
2
+ import { IntercomMode } from '../ports.output';
3
+ export type { Toast, IntercomMode } from '../ports.output';
4
+ export type createPlayContext = (devId: string) => IpcContext;
5
+ export type AuthorizeStatus = (type: string) => Promise<boolean>;
6
+ export type GetMemoryState = (devId: string) => Promise<{
7
+ mute: boolean;
8
+ intercomMode: IntercomMode;
9
+ isIntercomSupported: boolean;
10
+ resolution: ClarityType;
11
+ resolutionList: [ClarityType.HD, ClarityType.SD];
12
+ }>;
13
+ export type SetMuteMemoryState = (devId: string, value: boolean) => void;
14
+ export type SetResolutionMemoryState = (devId: string, value: ClarityType) => void;
@@ -5,6 +5,8 @@ type Ctx = ReturnType<UseCtx>;
5
5
  export declare function initPlayerWidgets(ctx: Ctx, options: {
6
6
  verticalResolutionCustomClick?: boolean;
7
7
  hideHorizontalMenu?: boolean;
8
+ hideScreenShotMenu?: boolean;
9
+ hideRecordVideoMenu?: boolean;
8
10
  directionControlProps?: Partial<React.ComponentProps<typeof FullScreen>['directionControlProps']>;
9
11
  }): Promise<void>;
10
12
  export {};
@@ -8,12 +8,26 @@ export async function initPlayerWidgets(ctx, options) {
8
8
  ctx.addContent('topRight', defaultTopRightContent);
9
9
  const newDefaultBottomLeftContent = _cloneDeep(defaultBottomLeftContent);
10
10
  const resolutionIndex = newDefaultBottomLeftContent.findIndex(item => item.id === 'Resolution');
11
+ const screenShotIndex = newDefaultBottomLeftContent.findIndex(item => item.id === 'Screenshot');
12
+ const recordVideoIndex = newDefaultBottomLeftContent.findIndex(item => item.id === 'RecordVideo');
11
13
  if (resolutionIndex !== -1) {
12
14
  // @ts-ignore
13
15
  newDefaultBottomLeftContent[resolutionIndex].initProps = {
14
16
  verticalResolutionCustomClick: options.verticalResolutionCustomClick
15
17
  };
16
18
  }
19
+ if (screenShotIndex !== -1) {
20
+ // @ts-ignore
21
+ newDefaultBottomLeftContent[screenShotIndex].initProps = {
22
+ hideScreenShotMenu: options.hideScreenShotMenu
23
+ };
24
+ }
25
+ if (recordVideoIndex !== -1) {
26
+ // @ts-ignore
27
+ newDefaultBottomLeftContent[recordVideoIndex].initProps = {
28
+ hideRecordVideoMenu: options.hideRecordVideoMenu
29
+ };
30
+ }
17
31
  ctx.addContent('bottomLeft', newDefaultBottomLeftContent);
18
32
  const newDefaultBottomRightContent = _cloneDeep(defaultBottomRightContent);
19
33
  const fullScreenIndex = newDefaultBottomRightContent.findIndex(item => item.id === 'FullScreen');
@@ -0,0 +1,30 @@
1
+ export declare function getDpValue<T extends string>(options: {
2
+ devId: string;
3
+ dps: T[];
4
+ }): Promise<Record<T, number | string | boolean>>;
5
+ export interface IDpCode {
6
+ code: string;
7
+ dpId: number;
8
+ value: string;
9
+ time: number;
10
+ type: string;
11
+ }
12
+ type ReturnDeviceInfo = Parameters<Parameters<typeof ty.device.getDeviceInfo>[0]['success']>[0];
13
+ export declare function getDeviceInfo(devId: string): Promise<ReturnDeviceInfo>;
14
+ export type Schema = {
15
+ code: string;
16
+ id: number;
17
+ name: string;
18
+ } & {
19
+ [K: string]: any;
20
+ };
21
+ export declare function getDpSchemaByCodes<T extends string>(devId: string, dpCodes: T[]): Promise<Record<T, Schema>>;
22
+ export declare function getDpSchemaByCodesSync<T extends string>(devId: string, dpCodes: T[]): Record<T, Schema> | null;
23
+ export declare const showMathPowValue: (value: any, scale: any) => string | 0;
24
+ /**
25
+ * 根据DpCode获取枚举型DP的range是否包含对应项
26
+ * @param result: {code: number, msg: string}
27
+ */
28
+ export declare const getEnumRangeIsValid: (devId: any, dpCode: any, rangValue: any) => Promise<any>;
29
+ export declare function hasDpCode(devId: string, code: string): Promise<boolean>;
30
+ export {};
@@ -1,6 +1,8 @@
1
1
  import React from 'react';
2
2
  import { ComponentConfigProps } from '../../interface';
3
3
  import './recordVideo.less';
4
- type Props = ComponentConfigProps;
5
- export declare function RecordVideo(props: Props): React.JSX.Element;
4
+ type Props = ComponentConfigProps & {
5
+ hideRecordVideoMenu?: boolean;
6
+ };
7
+ export declare function RecordVideo(props: Props): React.JSX.Element | null;
6
8
  export {};
@@ -83,7 +83,8 @@ export function RecordVideo(props) {
83
83
  setRecordingDisabled,
84
84
  devId,
85
85
  className,
86
- toast
86
+ toast,
87
+ hideRecordVideoMenu
87
88
  } = props;
88
89
  const {
89
90
  recording,
@@ -270,6 +271,7 @@ export function RecordVideo(props) {
270
271
  }
271
272
  return true;
272
273
  };
274
+ if (hideRecordVideoMenu) return null;
273
275
  return /*#__PURE__*/React.createElement(View, {
274
276
  onClick: () => handRecordVideo(),
275
277
  className: clsx(className, ''),
@@ -1,6 +1,8 @@
1
1
  import React from 'react';
2
2
  import { ComponentConfigProps } from '../../interface';
3
3
  import './screenshot.less';
4
- type Props = ComponentConfigProps;
5
- export declare function Screenshot(props: Props): React.JSX.Element;
4
+ type Props = ComponentConfigProps & {
5
+ hideScreenShotMenu?: boolean;
6
+ };
7
+ export declare function Screenshot(props: Props): React.JSX.Element | null;
6
8
  export {};
@@ -17,7 +17,8 @@ export function Screenshot(props) {
17
17
  deleteContent,
18
18
  devId,
19
19
  toast,
20
- className
20
+ className,
21
+ hideScreenShotMenu
21
22
  } = props;
22
23
  const {
23
24
  screenType,
@@ -177,6 +178,7 @@ export function Screenshot(props) {
177
178
  }
178
179
  });
179
180
  });
181
+ if (hideScreenShotMenu) return null;
180
182
  return /*#__PURE__*/React.createElement(View, {
181
183
  className: clsx(className),
182
184
  onClick: handClick
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/ipc-player-integration",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "description": "IPC 融合播放器",
5
5
  "main": "lib/index",
6
6
  "files": [
@@ -35,11 +35,11 @@
35
35
  "ahooks": "^3.1.6"
36
36
  },
37
37
  "dependencies": {
38
- "@ray-js/ipc-ptz-zoom": "0.0.2",
38
+ "@ray-js/ipc-ptz-zoom": "^0.0.2",
39
39
  "@ray-js/panel-sdk": "^1.13.1",
40
40
  "@ray-js/direction-control": "^0.0.8",
41
- "@ray-js/ray-ipc-player": "2.0.20",
42
- "@ray-js/ray-ipc-utils": "1.1.1",
41
+ "@ray-js/ray-ipc-player": "^2.0.20",
42
+ "@ray-js/ray-ipc-utils": "^1.1.3",
43
43
  "@ray-js/svg": "0.2.0",
44
44
  "clsx": "^1.2.1",
45
45
  "jotai": "^2.10.2"
@@ -47,9 +47,9 @@
47
47
  "devDependencies": {
48
48
  "@commitlint/cli": "^7.2.1",
49
49
  "@commitlint/config-conventional": "^9.0.1",
50
- "@ray-js/cli": "^1.4.9",
51
- "@ray-js/direction-control": "0.0.7",
52
- "@ray-js/ray": "^1.4.9",
50
+ "@ray-js/cli": "^1.7.13",
51
+ "@ray-js/direction-control": "^0.0.7",
52
+ "@ray-js/ray": "^1.7.13",
53
53
  "@testing-library/react-hooks": "^8.0.1",
54
54
  "@types/jest": "^29.5.14",
55
55
  "ahooks": "^3.8.4",