@ray-js/ipc-player-integration 0.0.1-beta-59 → 0.0.1-beta-61

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 (118) hide show
  1. package/lib/ctx/ctx.composition.d.ts +1 -1
  2. package/lib/ctx/ctx.composition.js +3 -4
  3. package/lib/ctx/ctx.js +6 -12
  4. package/lib/features/index.d.ts +1 -0
  5. package/lib/features/index.js +1 -0
  6. package/lib/{utils/plugins → features/initPlayerWidgets}/index.d.ts +1 -1
  7. package/lib/{utils/plugins → features/initPlayerWidgets}/index.js +4 -2
  8. package/lib/i18n/index.d.ts +8 -0
  9. package/lib/i18n/strings.d.ts +4 -0
  10. package/lib/i18n/strings.js +6 -2
  11. package/lib/index.d.ts +3 -1
  12. package/lib/index.js +4 -2
  13. package/lib/interface.d.ts +5 -1
  14. package/lib/ports.output.js +1 -1
  15. package/lib/res/index.d.ts +2 -0
  16. package/lib/res/index.js +2 -0
  17. package/lib/res/player_ptz_control_tip.png +0 -0
  18. package/lib/ui/constant.d.ts +1 -0
  19. package/lib/ui/constant.js +1 -0
  20. package/lib/ui/ui.d.ts +1 -0
  21. package/lib/ui/ui.js +42 -21
  22. package/lib/utils/device/index.js +2 -28
  23. package/lib/{plugins → widgets}/battery/battery.composition.d.ts +6 -2
  24. package/lib/{plugins/index.js → widgets/index.d.ts} +2 -3
  25. package/lib/{plugins/index.d.ts → widgets/index.js} +1 -0
  26. package/lib/{plugins → widgets}/moveInteractiveControl/moveInteractiveControl.js +0 -1
  27. package/lib/{plugins → widgets}/ptz/ptz.js +0 -2
  28. package/lib/{plugins → widgets}/ptz/ptz.less +9 -0
  29. package/lib/{plugins → widgets}/ptz/ptzControl.js +36 -9
  30. package/lib/widgets/ptzControlTip/index.d.ts +1 -0
  31. package/lib/widgets/ptzControlTip/index.js +1 -0
  32. package/lib/widgets/ptzControlTip/ptzControlTip.d.ts +6 -0
  33. package/lib/widgets/ptzControlTip/ptzControlTip.js +45 -0
  34. package/lib/widgets/ptzControlTip/ptzControlTip.less +42 -0
  35. package/lib/{plugins → widgets}/recordVideo/recordVideo.js +2 -3
  36. package/lib/{plugins → widgets}/screenshot/screenshot.js +3 -7
  37. package/lib/{plugins → widgets}/tempHumidity/tempHumidity.js +0 -2
  38. package/lib/{plugins → widgets}/videoBitKBP/videoBitKBP.js +2 -2
  39. package/package.json +3 -3
  40. /package/lib/{plugins → widgets}/battery/battery.composition.js +0 -0
  41. /package/lib/{plugins → widgets}/battery/battery.d.ts +0 -0
  42. /package/lib/{plugins → widgets}/battery/battery.js +0 -0
  43. /package/lib/{plugins → widgets}/battery/battery.less +0 -0
  44. /package/lib/{plugins → widgets}/battery/batteryFull.d.ts +0 -0
  45. /package/lib/{plugins → widgets}/battery/batteryFull.js +0 -0
  46. /package/lib/{plugins → widgets}/battery/index.d.ts +0 -0
  47. /package/lib/{plugins → widgets}/battery/index.js +0 -0
  48. /package/lib/{plugins → widgets}/fullScreen/constant.d.ts +0 -0
  49. /package/lib/{plugins → widgets}/fullScreen/constant.js +0 -0
  50. /package/lib/{plugins → widgets}/fullScreen/fullScreen.d.ts +0 -0
  51. /package/lib/{plugins → widgets}/fullScreen/fullScreen.js +0 -0
  52. /package/lib/{plugins → widgets}/fullScreen/fullScreen.less +0 -0
  53. /package/lib/{plugins → widgets}/fullScreen/fullTravelRouteControl.d.ts +0 -0
  54. /package/lib/{plugins → widgets}/fullScreen/fullTravelRouteControl.js +0 -0
  55. /package/lib/{plugins → widgets}/fullScreen/fullVoiceIntercom.d.ts +0 -0
  56. /package/lib/{plugins → widgets}/fullScreen/fullVoiceIntercom.js +0 -0
  57. /package/lib/{plugins → widgets}/fullScreen/index.d.ts +0 -0
  58. /package/lib/{plugins → widgets}/fullScreen/index.js +0 -0
  59. /package/lib/{plugins → widgets}/fullScreen/verticalScreen.d.ts +0 -0
  60. /package/lib/{plugins → widgets}/fullScreen/verticalScreen.js +0 -0
  61. /package/lib/{plugins → widgets}/fullScreen/verticalScreen.less +0 -0
  62. /package/lib/{plugins → widgets}/fullSmallIntercom/fullSmallIntercom.d.ts +0 -0
  63. /package/lib/{plugins → widgets}/fullSmallIntercom/fullSmallIntercom.js +0 -0
  64. /package/lib/{plugins → widgets}/fullSmallIntercom/fullSmallIntercom.less +0 -0
  65. /package/lib/{plugins → widgets}/fullSmallIntercom/index.d.ts +0 -0
  66. /package/lib/{plugins → widgets}/fullSmallIntercom/index.js +0 -0
  67. /package/lib/{plugins → widgets}/moveInteractiveControl/controlButton.d.ts +0 -0
  68. /package/lib/{plugins → widgets}/moveInteractiveControl/controlButton.js +0 -0
  69. /package/lib/{plugins → widgets}/moveInteractiveControl/controlButton.less +0 -0
  70. /package/lib/{plugins → widgets}/moveInteractiveControl/index.d.ts +0 -0
  71. /package/lib/{plugins → widgets}/moveInteractiveControl/index.js +0 -0
  72. /package/lib/{plugins → widgets}/moveInteractiveControl/moveInteractiveControl.d.ts +0 -0
  73. /package/lib/{plugins → widgets}/moveInteractiveControl/moveInteractiveControl.less +0 -0
  74. /package/lib/{plugins → widgets}/moveInteractiveControl/moveInteractiveControlUI.d.ts +0 -0
  75. /package/lib/{plugins → widgets}/moveInteractiveControl/moveInteractiveControlUI.js +0 -0
  76. /package/lib/{plugins → widgets}/moveInteractiveControl/moveInteractiveControlUI.less +0 -0
  77. /package/lib/{plugins → widgets}/muted/index.d.ts +0 -0
  78. /package/lib/{plugins → widgets}/muted/index.js +0 -0
  79. /package/lib/{plugins → widgets}/muted/muted.d.ts +0 -0
  80. /package/lib/{plugins → widgets}/muted/muted.js +0 -0
  81. /package/lib/{plugins → widgets}/muted/muted.less +0 -0
  82. /package/lib/{plugins → widgets}/ptz/index.d.ts +0 -0
  83. /package/lib/{plugins → widgets}/ptz/index.js +0 -0
  84. /package/lib/{plugins → widgets}/ptz/ptz.d.ts +0 -0
  85. /package/lib/{plugins → widgets}/ptz/ptzControl.d.ts +0 -0
  86. /package/lib/{plugins → widgets}/recordVideo/index.d.ts +0 -0
  87. /package/lib/{plugins → widgets}/recordVideo/index.js +0 -0
  88. /package/lib/{plugins → widgets}/recordVideo/recordVideo.d.ts +0 -0
  89. /package/lib/{plugins → widgets}/recordVideo/recordVideo.less +0 -0
  90. /package/lib/{plugins → widgets}/resolution/fullResolutionControl.d.ts +0 -0
  91. /package/lib/{plugins → widgets}/resolution/fullResolutionControl.js +0 -0
  92. /package/lib/{plugins → widgets}/resolution/index.d.ts +0 -0
  93. /package/lib/{plugins → widgets}/resolution/index.js +0 -0
  94. /package/lib/{plugins → widgets}/resolution/resolution.d.ts +0 -0
  95. /package/lib/{plugins → widgets}/resolution/resolution.js +0 -0
  96. /package/lib/{plugins → widgets}/resolution/resolution.less +0 -0
  97. /package/lib/{plugins → widgets}/screenshot/index.d.ts +0 -0
  98. /package/lib/{plugins → widgets}/screenshot/index.js +0 -0
  99. /package/lib/{plugins → widgets}/screenshot/screenshot.d.ts +0 -0
  100. /package/lib/{plugins → widgets}/screenshot/screenshot.less +0 -0
  101. /package/lib/{plugins → widgets}/tempHumidity/index.d.ts +0 -0
  102. /package/lib/{plugins → widgets}/tempHumidity/index.js +0 -0
  103. /package/lib/{plugins → widgets}/tempHumidity/tempHumidity.d.ts +0 -0
  104. /package/lib/{plugins → widgets}/tempHumidity/tempHumidity.less +0 -0
  105. /package/lib/{plugins → widgets}/verticalSmallIntercom/index.d.ts +0 -0
  106. /package/lib/{plugins → widgets}/verticalSmallIntercom/index.js +0 -0
  107. /package/lib/{plugins → widgets}/verticalSmallIntercom/verticalSmallIntercom.d.ts +0 -0
  108. /package/lib/{plugins → widgets}/verticalSmallIntercom/verticalSmallIntercom.js +0 -0
  109. /package/lib/{plugins → widgets}/verticalSmallIntercom/verticalSmallIntercom.less +0 -0
  110. /package/lib/{plugins → widgets}/videoBitKBP/index.d.ts +0 -0
  111. /package/lib/{plugins → widgets}/videoBitKBP/index.js +0 -0
  112. /package/lib/{plugins → widgets}/videoBitKBP/videoBitKBP.d.ts +0 -0
  113. /package/lib/{plugins → widgets}/videoBitKBP/videoBitKBP.less +0 -0
  114. /package/lib/{plugins → widgets}/voiceIntercom/index.d.ts +0 -0
  115. /package/lib/{plugins → widgets}/voiceIntercom/index.js +0 -0
  116. /package/lib/{plugins → widgets}/voiceIntercom/voiceIntercom.d.ts +0 -0
  117. /package/lib/{plugins → widgets}/voiceIntercom/voiceIntercom.js +0 -0
  118. /package/lib/{plugins → widgets}/voiceIntercom/voiceIntercom.less +0 -0
@@ -1,4 +1,4 @@
1
- import { FullScreen } from '../plugins';
1
+ import { FullScreen } from '../widgets';
2
2
  import { ComponentConfig } from '../interface';
3
3
  export declare const defaultTopLeftContent: ComponentConfig[];
4
4
  export declare const defaultTopRightContent: ComponentConfig[];
@@ -1,10 +1,10 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
3
  const _excluded = ["title", "duration"];
4
- import IPCUtils from '@ray-js/ray-ipc-utils';
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, RecordVideo, FullScreen, VideoBitKBP, Muted, Resolution, Ptz } from '../plugins';
7
+ import { FullSmallIntercom, VerticalSmallIntercom, BatteryFull, Battery, Screenshot, TempHumidity, RecordVideo, FullScreen, VideoBitKBP, Muted, Resolution, Ptz } from '../widgets';
8
8
  import { authorizeStatus } from '../utils/authorize';
9
9
  const createPlayContext = ty.createIpcPlayerContext;
10
10
  // const createPlayContext = () => null;
@@ -72,7 +72,7 @@ const getMemoryState = devId => {
72
72
  isIntercomSupported: false
73
73
  };
74
74
  return new Promise(resolve => {
75
- IPCUtils.getCameraConfigInfo(devId).then(res => {
75
+ getCameraConfigInfo(devId).then(res => {
76
76
  if (res.code === -1) {
77
77
  return resolve(defaultValue);
78
78
  }
@@ -113,7 +113,6 @@ const setResolutionMemoryState = (devId, value) => {
113
113
  const newData = originStorage ? _objectSpread({}, originStorage) : null;
114
114
  if (newData) {
115
115
  newData.cachedResolution = value;
116
- console.log(newData, 'newData');
117
116
  // @ts-ignore
118
117
  ty.setStorageSync({
119
118
  key: storageKey,
package/lib/ctx/ctx.js CHANGED
@@ -32,7 +32,8 @@ export const createUseCtx = _ref => {
32
32
  initBottomLeftContent,
33
33
  initBottomRightContent,
34
34
  initAbsoluteContent,
35
- saveToAlbum = SAVE_TO_ALBUM
35
+ saveToAlbum = SAVE_TO_ALBUM,
36
+ showPtzControlTip = false
36
37
  } = _ref2;
37
38
  const streamStatus = useRef();
38
39
  // 全屏、竖屏
@@ -43,7 +44,8 @@ export const createUseCtx = _ref => {
43
44
 
44
45
  // 录像是否不可点击
45
46
  const [recordingDisabled, setRecordingDisabled] = useAtom(false);
46
-
47
+ // 是否展示ptz player控制提示框
48
+ const [ptzControlTipDisabled, setPtzControlTipDisabled] = useAtom(showPtzControlTip);
47
49
  // 静音 true 代表静音 false 代表不静音
48
50
  const [mute] = useAtom(true);
49
51
 
@@ -89,7 +91,6 @@ export const createUseCtx = _ref => {
89
91
  if (!devId) return;
90
92
  try {
91
93
  const res = await getMemoryState(devId);
92
- console.log('==== getMemoryState ====xghazh', res);
93
94
  setResolutionList(res.resolutionList);
94
95
  _setResolution(res.resolution, true);
95
96
  _setMute(res.mute, true);
@@ -104,7 +105,6 @@ export const createUseCtx = _ref => {
104
105
  if (devId && _playState === PlayState.PLAYING) {
105
106
  // 获取缓存的值且同步
106
107
  getMemoryState(devId).then(res => {
107
- console.log('PlayingMemoryState', res);
108
108
  setResolutionList(res.resolutionList);
109
109
  // 传true表示值即可,会取播放器的值
110
110
  _setResolution(res.resolution, true);
@@ -194,7 +194,6 @@ export const createUseCtx = _ref => {
194
194
  clarity: target === ClarityType.HD ? 'hd' : 'normal',
195
195
  success: () => {
196
196
  setResolutionMemoryState(devId, target);
197
- console.log('setClarity success', target);
198
197
  updateAtom(resolution, target);
199
198
  resolve(true);
200
199
  },
@@ -214,6 +213,7 @@ export const createUseCtx = _ref => {
214
213
  screenType,
215
214
  recording,
216
215
  recordingDisabled,
216
+ ptzControlTipDisabled,
217
217
  mute,
218
218
  resolution,
219
219
  resolutionList,
@@ -222,6 +222,7 @@ export const createUseCtx = _ref => {
222
222
  intercomSupported,
223
223
  playState,
224
224
  setPlayState,
225
+ setPtzControlTipDisabled,
225
226
  setBrandColor,
226
227
  setVerticalMic,
227
228
  setIntercom: async target => {
@@ -286,9 +287,7 @@ export const createUseCtx = _ref => {
286
287
  const {
287
288
  platform
288
289
  } = getSystemInfoSync();
289
- console.log(platform, 'platform');
290
290
  openAppSystemSettingPage({
291
- // scope: platform === 'ios' ? 'App-Settings' : 'App-Settings-Permission',
292
291
  scope: 'App-Settings',
293
292
  success: () => {
294
293
  console.log('跳转成功');
@@ -370,12 +369,7 @@ export const createUseCtx = _ref => {
370
369
  isShowGlobal: true,
371
370
  success: res => {
372
371
  if (res.confirm) {
373
- const {
374
- platform
375
- } = getSystemInfoSync();
376
- console.log(platform, 'platform');
377
372
  openAppSystemSettingPage({
378
- // scope: platform === 'ios' ? 'App-Settings' : 'App-Settings-Permission',
379
373
  scope: 'App-Settings',
380
374
  success: () => {
381
375
  console.log('跳转成功');
@@ -0,0 +1 @@
1
+ export * from './initPlayerWidgets';
@@ -0,0 +1 @@
1
+ export * from './initPlayerWidgets';
@@ -1,6 +1,6 @@
1
1
  import { UseCtx } from '../../interface';
2
2
  type Ctx = ReturnType<UseCtx>;
3
- export declare function initPlayerPlugins(ctx: Ctx, options: {
3
+ export declare function initPlayerWidgets(ctx: Ctx, options: {
4
4
  verticalResolutionCustomClick?: boolean;
5
5
  hideHorizontalMenu?: boolean;
6
6
  throttleTime?: number;
@@ -1,14 +1,15 @@
1
1
  import _cloneDeep from 'lodash/cloneDeep';
2
2
  import { defaultTopLeftContent, defaultTopRightContent, defaultBottomLeftContent, defaultBottomRightContent } from '../../ctx';
3
3
  import { hasDpCode } from '../../utils/device';
4
- import { MoveInteractiveControlButton } from '../../plugins/moveInteractiveControl';
4
+ import { MoveInteractiveControlButton } from '../../widgets/moveInteractiveControl';
5
5
  // 根据当前 dp 信息决定设置哪些 plugin
6
- export async function initPlayerPlugins(ctx, options) {
6
+ export async function initPlayerWidgets(ctx, options) {
7
7
  ctx.addContent('topLeft', defaultTopLeftContent);
8
8
  ctx.addContent('topRight', defaultTopRightContent);
9
9
  const newDefaultBottomLeftContent = _cloneDeep(defaultBottomLeftContent);
10
10
  const resolutionIndex = newDefaultBottomLeftContent.findIndex(item => item.id === 'Resolution');
11
11
  if (resolutionIndex !== -1) {
12
+ // @ts-ignore
12
13
  newDefaultBottomLeftContent[resolutionIndex].initProps = {
13
14
  verticalResolutionCustomClick: options.verticalResolutionCustomClick
14
15
  };
@@ -17,6 +18,7 @@ export async function initPlayerPlugins(ctx, options) {
17
18
  const newDefaultBottomRightContent = _cloneDeep(defaultBottomRightContent);
18
19
  const fullScreenIndex = newDefaultBottomRightContent.findIndex(item => item.id === 'FullScreen');
19
20
  if (fullScreenIndex !== -1) {
21
+ // @ts-ignore
20
22
  newDefaultBottomRightContent[fullScreenIndex].initProps = {
21
23
  hideHorizontalMenu: options.hideHorizontalMenu,
22
24
  throttleTime: options.throttleTime
@@ -20,6 +20,8 @@ declare const Strings: kit.I18N<{
20
20
  ipc_player_authorize_confirm_text: string;
21
21
  ipc_player_error_record_tip: string;
22
22
  ipc_player_change_resolution_success: string;
23
+ ipc_player_ptz_control_tip: string;
24
+ ipc_player_ptz_close_control_tip: string;
23
25
  };
24
26
  zh: {
25
27
  ipc_player_resolution_HD: string;
@@ -41,6 +43,8 @@ declare const Strings: kit.I18N<{
41
43
  ipc_player_authorize_confirm_text: string;
42
44
  ipc_player_error_record_tip: string;
43
45
  ipc_player_change_resolution_success: string;
46
+ ipc_player_ptz_control_tip: string;
47
+ ipc_player_ptz_close_control_tip: string;
44
48
  };
45
49
  }, {
46
50
  ipc_player_resolution_HD: string;
@@ -62,6 +66,8 @@ declare const Strings: kit.I18N<{
62
66
  ipc_player_authorize_confirm_text: string;
63
67
  ipc_player_error_record_tip: string;
64
68
  ipc_player_change_resolution_success: string;
69
+ ipc_player_ptz_control_tip: string;
70
+ ipc_player_ptz_close_control_tip: string;
65
71
  } | {
66
72
  ipc_player_resolution_HD: string;
67
73
  ipc_player_resolution_SD: string;
@@ -82,5 +88,7 @@ declare const Strings: kit.I18N<{
82
88
  ipc_player_authorize_confirm_text: string;
83
89
  ipc_player_error_record_tip: string;
84
90
  ipc_player_change_resolution_success: string;
91
+ ipc_player_ptz_control_tip: string;
92
+ ipc_player_ptz_close_control_tip: string;
85
93
  }>;
86
94
  export default Strings;
@@ -19,6 +19,8 @@ declare const _default: {
19
19
  ipc_player_authorize_confirm_text: string;
20
20
  ipc_player_error_record_tip: string;
21
21
  ipc_player_change_resolution_success: string;
22
+ ipc_player_ptz_control_tip: string;
23
+ ipc_player_ptz_close_control_tip: string;
22
24
  };
23
25
  zh: {
24
26
  ipc_player_resolution_HD: string;
@@ -40,6 +42,8 @@ declare const _default: {
40
42
  ipc_player_authorize_confirm_text: string;
41
43
  ipc_player_error_record_tip: string;
42
44
  ipc_player_change_resolution_success: string;
45
+ ipc_player_ptz_control_tip: string;
46
+ ipc_player_ptz_close_control_tip: string;
43
47
  };
44
48
  };
45
49
  export default _default;
@@ -18,7 +18,9 @@ export default {
18
18
  ipc_player_authorize_cancel_text: 'Cancel',
19
19
  ipc_player_authorize_confirm_text: 'Go to Settings',
20
20
  ipc_player_error_record_tip: 'The recording has failed, please try again later.',
21
- ipc_player_change_resolution_success: '切换成功'
21
+ ipc_player_change_resolution_success: 'Switch successful',
22
+ ipc_player_ptz_control_tip: 'Swipe up, down, left, or right to control the PTZ direction.',
23
+ ipc_player_ptz_close_control_tip: 'Close'
22
24
  },
23
25
  zh: {
24
26
  ipc_player_resolution_HD: '高清',
@@ -39,6 +41,8 @@ export default {
39
41
  ipc_player_authorize_cancel_text: '取消',
40
42
  ipc_player_authorize_confirm_text: '去设置',
41
43
  ipc_player_error_record_tip: '录制出错了,请稍后再试',
42
- ipc_player_change_resolution_success: '切换成功'
44
+ ipc_player_change_resolution_success: '切换成功',
45
+ ipc_player_ptz_control_tip: '上下左右滑动,控制云台方向',
46
+ ipc_player_ptz_close_control_tip: '关闭'
43
47
  }
44
48
  };
package/lib/index.d.ts CHANGED
@@ -1,4 +1,6 @@
1
1
  export * from './ui';
2
2
  export * from './ctx';
3
- export * from './plugins';
4
3
  export * from './interface';
4
+ import * as Widgets from './widgets';
5
+ import * as Features from './features';
6
+ export { Widgets, Features };
package/lib/index.js CHANGED
@@ -1,4 +1,6 @@
1
1
  export * from './ui';
2
2
  export * from './ctx';
3
- export * from './plugins';
4
- export * from './interface';
3
+ export * from './interface';
4
+ import * as Widgets from './widgets';
5
+ import * as Features from './features';
6
+ export { Widgets, Features };
@@ -42,11 +42,13 @@ export type UseCtx = (options: {
42
42
  initBottomRightContent?: ComponentConfig[];
43
43
  initAbsoluteContent?: ComponentConfig[];
44
44
  saveToAlbum?: 0 | 1;
45
+ showPtzControlTip?: boolean;
45
46
  }) => {
46
47
  devId: string;
47
48
  brandColor: RetAtom<string>;
48
49
  verticalMic: RetAtom<boolean>;
49
50
  saveToAlbum: 0 | 1;
51
+ showPtzControlTip: boolean;
50
52
  screenType: RetAtom<ScreenType>;
51
53
  recording: RetAtom<boolean>;
52
54
  recordingDisabled: RetAtom<boolean>;
@@ -63,8 +65,10 @@ export type UseCtx = (options: {
63
65
  bottomLeftContent: RetAtom<ComponentConfig[]>;
64
66
  bottomRightContent: RetAtom<ComponentConfig[]>;
65
67
  absoluteContent: RetAtom<ComponentConfig[]>;
68
+ showPtzControlTip: RetAtom<boolean>;
69
+ setShowPtzControlTip: (value: boolean) => void;
66
70
  setBrandColor: (color: string) => void;
67
- setVerticalMic: (color: boolean) => void;
71
+ setVerticalMic: (value: boolean) => void;
68
72
  setScreenType: (type: ScreenType) => void;
69
73
  setRecordingDisabled: (type: boolean) => void;
70
74
  setResolution: (type: string) => void;
@@ -1,6 +1,6 @@
1
1
  export { IntercomMode } from '@ray-js/ray-ipc-utils/lib/interface';
2
2
 
3
- // plugin 获取电池电量 todo
3
+ // plugin 获取电池电量
4
4
 
5
5
  // plugin 获取是否支持Ptz
6
6
 
@@ -0,0 +1,2 @@
1
+ import playerPtzControlTip from './player_ptz_control_tip.png';
2
+ export { playerPtzControlTip };
@@ -0,0 +1,2 @@
1
+ import playerPtzControlTip from './player_ptz_control_tip.png';
2
+ export { playerPtzControlTip };
@@ -7,6 +7,7 @@ export declare const voiceIntercomId = "voiceIntercomId";
7
7
  export declare const fullTravelRouteControlId = "fullTravelRouteControl";
8
8
  export declare const verticalScreenId = "verticalScreenId";
9
9
  export declare const ptzControlId = "ptzControlId";
10
+ export declare const ptzControlTipId = "ptzControlTipId";
10
11
  export declare const fullResolutionId = "fullResolutionId";
11
12
  export declare const batteryId = "Battery";
12
13
  export declare const fullSmallIntercomId = "FullSmallIntercom";
@@ -7,6 +7,7 @@ export const voiceIntercomId = 'voiceIntercomId';
7
7
  export const fullTravelRouteControlId = 'fullTravelRouteControl';
8
8
  export const verticalScreenId = 'verticalScreenId';
9
9
  export const ptzControlId = 'ptzControlId';
10
+ export const ptzControlTipId = 'ptzControlTipId';
10
11
  export const fullResolutionId = 'fullResolutionId';
11
12
  export const batteryId = 'Battery';
12
13
  export const fullSmallIntercomId = 'FullSmallIntercom';
package/lib/ui/ui.d.ts CHANGED
@@ -24,6 +24,7 @@ type Props = {
24
24
  CSSVariable?: Partial<CSSVariable>;
25
25
  brandColor?: string;
26
26
  verticalMic?: boolean;
27
+ landscapeMode?: 'fill' | 'standard';
27
28
  eventRef?: React.RefObject<EventInstance>;
28
29
  onPlayerTap?: (data: any) => void;
29
30
  extend?: Record<string, any>;
package/lib/ui/ui.js CHANGED
@@ -51,6 +51,7 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
51
51
  brandColor = '#FF592A',
52
52
  verticalMic = true,
53
53
  eventRef: eventRefProp,
54
+ landscapeMode = 'standard',
54
55
  onPlayerTap,
55
56
  extend = {}
56
57
  } = props;
@@ -81,12 +82,13 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
81
82
  }
82
83
  useImperativeHandle(eventRefProp, () => eventRef.current, [eventRef.current]);
83
84
  const timer = useRef();
85
+ const [scaleMultiple, setScaleMultiple] = useState(1);
86
+ const [currentZoomLevel, setCurrentZoomLevel] = useState(1);
84
87
  useEffect(() => {
85
88
  setBrandColor(brandColor);
86
89
  setVerticalMic(verticalMic);
87
90
  }, []);
88
91
  const refreshBottomLeft = value => {
89
- console.log(value, '++++++++++++++----sadbjasbdjbsj');
90
92
  event.current.emit(startTimeToHideAllComponent);
91
93
  event.current.emit(showAllComponent);
92
94
  event.current.emit(playerTap);
@@ -107,11 +109,21 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
107
109
  deviceType
108
110
  } = systemInfo.current;
109
111
  // 针对pad 暂不支持横屏,且在ios pad模式下 会触发onResize事件, 待解决
112
+
110
113
  if (deviceType === 'pad') {
111
114
  setScreenType('vertical');
112
115
  } else {
113
116
  setScreenType(type === 'landscape' ? 'full' : 'vertical');
114
117
  }
118
+
119
+ // 若为全屏模式并且要求按宽填充,即横屏时充满,主动设置模式为-1即可
120
+ if (type === 'landscape' && landscapeMode === 'fill') {
121
+ console.log('横屏时充满');
122
+ setScaleMultiple(-1);
123
+ } else {
124
+ // 将屏幕播放比例设为1
125
+ setScaleMultiple(1);
126
+ }
115
127
  } catch (err) {
116
128
  console.log(err, 'err');
117
129
  }
@@ -207,7 +219,25 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
207
219
  /**
208
220
  * 视频流加载状态封装
209
221
  */
210
-
222
+ const onChangeStreamStatus = useMemoizedFn(code => {
223
+ var _props$onPlayStatus;
224
+ const playStateMap = {
225
+ [PlayerStreamStatus.PreviewSuccess]: PlayState.PLAYING,
226
+ // 播放中
227
+ [PlayerStreamStatus.PAUSE]: PlayState.PAUSE // 暂停
228
+ };
229
+ // 合并为三种状态 连接中 暂停 播放中
230
+ const playState = playStateMap[code] || PlayState.CONNECTING;
231
+ if (playState !== PlayState.PLAYING) {
232
+ setScaleMultiple(currentZoomLevel);
233
+ }
234
+ setPlayState(playState);
235
+ (_props$onPlayStatus = props.onPlayStatus) === null || _props$onPlayStatus === void 0 || _props$onPlayStatus.call(props, {
236
+ playState,
237
+ playCode: code
238
+ });
239
+ instance.changeStreamStatus(code);
240
+ });
211
241
  const disablePlayerTap = useRef(false);
212
242
  const handDisablePlayerTap = value => {
213
243
  disablePlayerTap.current = !!value;
@@ -274,34 +304,25 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
274
304
  height: screenType === 'vertical' ? (style === null || style === void 0 ? void 0 : style.height) || '100%' : '100vh'
275
305
  })
276
306
  }, /*#__PURE__*/React.createElement(IPCPlayer, _extends({
277
- objectFit: "",
278
307
  defaultMute: mute,
279
308
  devId: devId,
280
309
  onlineStatus: deviceOnline,
281
310
  ipcPlayerContext: instance.IPCPlayerInstance,
282
- onChangeStreamStatus: code => {
283
- var _props$onPlayStatus;
284
- const playStateMap = {
285
- [PlayerStreamStatus.PreviewSuccess]: PlayState.PLAYING,
286
- // 播放中
287
- [PlayerStreamStatus.PAUSE]: PlayState.PAUSE // 暂停
288
- };
289
- // 合并为三种状态 连接中 暂停 播放中
290
- const playState = playStateMap[code] || PlayState.CONNECTING;
291
- setPlayState(playState);
292
- (_props$onPlayStatus = props.onPlayStatus) === null || _props$onPlayStatus === void 0 || _props$onPlayStatus.call(props, {
293
- playState,
294
- playCode: code
295
- });
296
- instance.changeStreamStatus(code);
297
- }
298
- // onCtx={getIpcPlayer}
311
+ onChangeStreamStatus: onChangeStreamStatus
312
+ // onCtx={getIpcPlayerCtx}
299
313
  // onPlayerTap={handlePlayerClick}
300
314
  ,
301
315
  onCameraNotifyWeakNetwork: data => {
302
316
  console.log(`onCameraNotifyWeakNetwork: ${JSON.stringify(data)}`);
303
317
  },
304
- clarity: decodeClarityDic[resolution]
318
+ clarity: decodeClarityDic[resolution],
319
+ onZoomChange: data => {
320
+ const {
321
+ zoomLevel
322
+ } = data === null || data === void 0 ? void 0 : data.detail;
323
+ setCurrentZoomLevel(zoomLevel);
324
+ },
325
+ scaleMultiple: scaleMultiple
305
326
  // 安卓横屏问题
306
327
  // ptzControllable={screenType === 'vertical'}
307
328
  ,
@@ -1,7 +1,7 @@
1
1
  import "core-js/modules/esnext.iterator.constructor.js";
2
2
  import "core-js/modules/esnext.iterator.find.js";
3
3
  import "core-js/modules/esnext.iterator.for-each.js";
4
- import IpcUtils from '@ray-js/ray-ipc-utils';
4
+ import { getDevInfo } from '@ray-js/ray-ipc-utils';
5
5
  export function getDpValue(options) {
6
6
  return new Promise((resolve, reject) => {
7
7
  ty.device.getDeviceInfo({
@@ -90,32 +90,6 @@ export const showMathPowValue = (value, scale) => {
90
90
  }
91
91
  return v;
92
92
  };
93
- export const getDevInfo = deviceId => {
94
- return new Promise(resolve => {
95
- try {
96
- ty.device.getDeviceInfo({
97
- deviceId,
98
- success: res => {
99
- resolve({
100
- code: 0,
101
- data: res
102
- });
103
- },
104
- fail: err => {
105
- resolve({
106
- code: -1,
107
- msg: err
108
- });
109
- }
110
- });
111
- } catch (err) {
112
- resolve({
113
- code: -1,
114
- msg: String(err)
115
- });
116
- }
117
- });
118
- };
119
93
 
120
94
  /**
121
95
  * 根据DpCode获取枚举型DP的range是否包含对应项
@@ -123,7 +97,7 @@ export const getDevInfo = deviceId => {
123
97
  */
124
98
 
125
99
  export const getEnumRangeIsValid = async (devId, dpCode, rangValue) => {
126
- const infoData = await IpcUtils.getDevInfo(devId);
100
+ const infoData = await getDevInfo(devId);
127
101
  if (infoData.code === 0) {
128
102
  var _targetSchema$propert;
129
103
  const {
@@ -6,6 +6,7 @@ export declare const Battery: import("react").FunctionComponent<{
6
6
  brandColor: import("../..").RetAtom<string>;
7
7
  verticalMic: import("../..").RetAtom<boolean>;
8
8
  saveToAlbum: 0 | 1;
9
+ showPtzControlTip: boolean;
9
10
  screenType: import("../..").RetAtom<import("../..").ScreenType>;
10
11
  recording: import("../..").RetAtom<boolean>;
11
12
  recordingDisabled: import("../..").RetAtom<boolean>;
@@ -22,8 +23,9 @@ export declare const Battery: import("react").FunctionComponent<{
22
23
  bottomLeftContent: import("../..").RetAtom<import("../..").ComponentConfig<any & Record<string, any>>[]>;
23
24
  bottomRightContent: import("../..").RetAtom<import("../..").ComponentConfig<any & Record<string, any>>[]>;
24
25
  absoluteContent: import("../..").RetAtom<import("../..").ComponentConfig<any & Record<string, any>>[]>;
26
+ setShowPtzControlTip: (value: boolean) => void;
25
27
  setBrandColor: (color: string) => void;
26
- setVerticalMic: (color: boolean) => void;
28
+ setVerticalMic: (value: boolean) => void;
27
29
  setScreenType: (type: import("../..").ScreenType) => void;
28
30
  setRecordingDisabled: (type: boolean) => void;
29
31
  setResolution: (type: string) => void;
@@ -51,6 +53,7 @@ export declare const BatteryFull: import("react").FunctionComponent<{
51
53
  brandColor: import("../..").RetAtom<string>;
52
54
  verticalMic: import("../..").RetAtom<boolean>;
53
55
  saveToAlbum: 0 | 1;
56
+ showPtzControlTip: boolean;
54
57
  screenType: import("../..").RetAtom<import("../..").ScreenType>;
55
58
  recording: import("../..").RetAtom<boolean>;
56
59
  recordingDisabled: import("../..").RetAtom<boolean>;
@@ -67,8 +70,9 @@ export declare const BatteryFull: import("react").FunctionComponent<{
67
70
  bottomLeftContent: import("../..").RetAtom<import("../..").ComponentConfig<any & Record<string, any>>[]>;
68
71
  bottomRightContent: import("../..").RetAtom<import("../..").ComponentConfig<any & Record<string, any>>[]>;
69
72
  absoluteContent: import("../..").RetAtom<import("../..").ComponentConfig<any & Record<string, any>>[]>;
73
+ setShowPtzControlTip: (value: boolean) => void;
70
74
  setBrandColor: (color: string) => void;
71
- setVerticalMic: (color: boolean) => void;
75
+ setVerticalMic: (value: boolean) => void;
72
76
  setScreenType: (type: import("../..").ScreenType) => void;
73
77
  setRecordingDisabled: (type: boolean) => void;
74
78
  setResolution: (type: string) => void;
@@ -1,6 +1,4 @@
1
- // 非全屏电池插件
2
1
  export * from './battery';
3
- // 全屏电池插件
4
2
  export * from './battery/batteryFull';
5
3
  export * from './screenshot';
6
4
  export * from './tempHumidity';
@@ -13,4 +11,5 @@ export * from './ptz';
13
11
  export * from './resolution';
14
12
  export * from './fullSmallIntercom';
15
13
  export * from './verticalSmallIntercom';
16
- export * from './moveInteractiveControl';
14
+ export * from './moveInteractiveControl';
15
+ export * from './ptzControlTip';
@@ -12,3 +12,4 @@ export * from './resolution';
12
12
  export * from './fullSmallIntercom';
13
13
  export * from './verticalSmallIntercom';
14
14
  export * from './moveInteractiveControl';
15
+ export * from './ptzControlTip';
@@ -31,7 +31,6 @@ export function MoveInteractiveControl(props) {
31
31
  dpCodes: [TYPE_CODE, STATE_CODE],
32
32
  listenDpChange: false
33
33
  });
34
- console.log('state', state);
35
34
  const [schemaInfo] = useSchemaInfo(devId, [TYPE_CODE]);
36
35
  const menu = useMemo(() => {
37
36
  if (!schemaInfo || !(schemaInfo !== null && schemaInfo !== void 0 && schemaInfo[TYPE_CODE])) {
@@ -40,8 +40,6 @@ export const Ptz = props => {
40
40
  }
41
41
  }, [screenType]);
42
42
  const onPtz = useMemoizedFn(() => {
43
- console.log(isPtzActive, 'isPtzActive');
44
- console.log(hasContent('absolute', ptzControlId), 'hasContent');
45
43
  if (!isPtzActive) {
46
44
  showContent('bottomLeft', 'FullSmallIntercom');
47
45
  if (!hasContent('absolute', ptzControlId)) {
@@ -60,4 +60,13 @@
60
60
  color: #707070;
61
61
  }
62
62
 
63
+ .ipc-player-plugin-ptz-control-tip-wrap {
64
+ position: absolute;
65
+ z-index: 1000;
66
+ top: 0;
67
+ left: 0;
68
+ right: 0;
69
+ bottom: 0;
70
+ }
71
+
63
72