@ray-js/ipc-player-integration 0.0.1-beta-58 → 0.0.1-beta-60

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 (115) hide show
  1. package/lib/ctx/ctx.composition.d.ts +1 -1
  2. package/lib/ctx/ctx.composition.js +1 -2
  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/res/index.d.ts +2 -0
  15. package/lib/res/index.js +2 -0
  16. package/lib/res/player_ptz_control_tip.png +0 -0
  17. package/lib/ui/constant.d.ts +1 -0
  18. package/lib/ui/constant.js +1 -0
  19. package/lib/ui/ui.js +0 -2
  20. package/lib/{plugins → widgets}/battery/battery.composition.d.ts +6 -2
  21. package/lib/{plugins → widgets}/fullScreen/fullVoiceIntercom.js +1 -1
  22. package/lib/{plugins/index.js → widgets/index.d.ts} +2 -3
  23. package/lib/{plugins/index.d.ts → widgets/index.js} +1 -0
  24. package/lib/{plugins → widgets}/moveInteractiveControl/moveInteractiveControl.js +0 -1
  25. package/lib/{plugins → widgets}/ptz/ptz.js +2 -5
  26. package/lib/{plugins → widgets}/ptz/ptz.less +9 -0
  27. package/lib/{plugins → widgets}/ptz/ptzControl.js +30 -3
  28. package/lib/widgets/ptzControlTip/index.d.ts +1 -0
  29. package/lib/widgets/ptzControlTip/index.js +1 -0
  30. package/lib/widgets/ptzControlTip/ptzControlTip.d.ts +6 -0
  31. package/lib/widgets/ptzControlTip/ptzControlTip.js +45 -0
  32. package/lib/widgets/ptzControlTip/ptzControlTip.less +42 -0
  33. package/lib/{plugins → widgets}/recordVideo/recordVideo.js +0 -1
  34. package/lib/{plugins → widgets}/screenshot/screenshot.js +1 -5
  35. package/lib/{plugins → widgets}/tempHumidity/tempHumidity.js +0 -2
  36. package/lib/{plugins → widgets}/videoBitKBP/videoBitKBP.js +4 -1
  37. package/lib/{plugins → widgets}/videoBitKBP/videoBitKBP.less +8 -0
  38. package/package.json +2 -2
  39. /package/lib/{plugins → widgets}/battery/battery.composition.js +0 -0
  40. /package/lib/{plugins → widgets}/battery/battery.d.ts +0 -0
  41. /package/lib/{plugins → widgets}/battery/battery.js +0 -0
  42. /package/lib/{plugins → widgets}/battery/battery.less +0 -0
  43. /package/lib/{plugins → widgets}/battery/batteryFull.d.ts +0 -0
  44. /package/lib/{plugins → widgets}/battery/batteryFull.js +0 -0
  45. /package/lib/{plugins → widgets}/battery/index.d.ts +0 -0
  46. /package/lib/{plugins → widgets}/battery/index.js +0 -0
  47. /package/lib/{plugins → widgets}/fullScreen/constant.d.ts +0 -0
  48. /package/lib/{plugins → widgets}/fullScreen/constant.js +0 -0
  49. /package/lib/{plugins → widgets}/fullScreen/fullScreen.d.ts +0 -0
  50. /package/lib/{plugins → widgets}/fullScreen/fullScreen.js +0 -0
  51. /package/lib/{plugins → widgets}/fullScreen/fullScreen.less +0 -0
  52. /package/lib/{plugins → widgets}/fullScreen/fullTravelRouteControl.d.ts +0 -0
  53. /package/lib/{plugins → widgets}/fullScreen/fullTravelRouteControl.js +0 -0
  54. /package/lib/{plugins → widgets}/fullScreen/fullVoiceIntercom.d.ts +0 -0
  55. /package/lib/{plugins → widgets}/fullScreen/index.d.ts +0 -0
  56. /package/lib/{plugins → widgets}/fullScreen/index.js +0 -0
  57. /package/lib/{plugins → widgets}/fullScreen/verticalScreen.d.ts +0 -0
  58. /package/lib/{plugins → widgets}/fullScreen/verticalScreen.js +0 -0
  59. /package/lib/{plugins → widgets}/fullScreen/verticalScreen.less +0 -0
  60. /package/lib/{plugins → widgets}/fullSmallIntercom/fullSmallIntercom.d.ts +0 -0
  61. /package/lib/{plugins → widgets}/fullSmallIntercom/fullSmallIntercom.js +0 -0
  62. /package/lib/{plugins → widgets}/fullSmallIntercom/fullSmallIntercom.less +0 -0
  63. /package/lib/{plugins → widgets}/fullSmallIntercom/index.d.ts +0 -0
  64. /package/lib/{plugins → widgets}/fullSmallIntercom/index.js +0 -0
  65. /package/lib/{plugins → widgets}/moveInteractiveControl/controlButton.d.ts +0 -0
  66. /package/lib/{plugins → widgets}/moveInteractiveControl/controlButton.js +0 -0
  67. /package/lib/{plugins → widgets}/moveInteractiveControl/controlButton.less +0 -0
  68. /package/lib/{plugins → widgets}/moveInteractiveControl/index.d.ts +0 -0
  69. /package/lib/{plugins → widgets}/moveInteractiveControl/index.js +0 -0
  70. /package/lib/{plugins → widgets}/moveInteractiveControl/moveInteractiveControl.d.ts +0 -0
  71. /package/lib/{plugins → widgets}/moveInteractiveControl/moveInteractiveControl.less +0 -0
  72. /package/lib/{plugins → widgets}/moveInteractiveControl/moveInteractiveControlUI.d.ts +0 -0
  73. /package/lib/{plugins → widgets}/moveInteractiveControl/moveInteractiveControlUI.js +0 -0
  74. /package/lib/{plugins → widgets}/moveInteractiveControl/moveInteractiveControlUI.less +0 -0
  75. /package/lib/{plugins → widgets}/muted/index.d.ts +0 -0
  76. /package/lib/{plugins → widgets}/muted/index.js +0 -0
  77. /package/lib/{plugins → widgets}/muted/muted.d.ts +0 -0
  78. /package/lib/{plugins → widgets}/muted/muted.js +0 -0
  79. /package/lib/{plugins → widgets}/muted/muted.less +0 -0
  80. /package/lib/{plugins → widgets}/ptz/index.d.ts +0 -0
  81. /package/lib/{plugins → widgets}/ptz/index.js +0 -0
  82. /package/lib/{plugins → widgets}/ptz/ptz.d.ts +0 -0
  83. /package/lib/{plugins → widgets}/ptz/ptzControl.d.ts +0 -0
  84. /package/lib/{plugins → widgets}/recordVideo/index.d.ts +0 -0
  85. /package/lib/{plugins → widgets}/recordVideo/index.js +0 -0
  86. /package/lib/{plugins → widgets}/recordVideo/recordVideo.d.ts +0 -0
  87. /package/lib/{plugins → widgets}/recordVideo/recordVideo.less +0 -0
  88. /package/lib/{plugins → widgets}/resolution/fullResolutionControl.d.ts +0 -0
  89. /package/lib/{plugins → widgets}/resolution/fullResolutionControl.js +0 -0
  90. /package/lib/{plugins → widgets}/resolution/index.d.ts +0 -0
  91. /package/lib/{plugins → widgets}/resolution/index.js +0 -0
  92. /package/lib/{plugins → widgets}/resolution/resolution.d.ts +0 -0
  93. /package/lib/{plugins → widgets}/resolution/resolution.js +0 -0
  94. /package/lib/{plugins → widgets}/resolution/resolution.less +0 -0
  95. /package/lib/{plugins → widgets}/screenshot/index.d.ts +0 -0
  96. /package/lib/{plugins → widgets}/screenshot/index.js +0 -0
  97. /package/lib/{plugins → widgets}/screenshot/screenshot.d.ts +0 -0
  98. /package/lib/{plugins → widgets}/screenshot/screenshot.less +0 -0
  99. /package/lib/{plugins → widgets}/tempHumidity/index.d.ts +0 -0
  100. /package/lib/{plugins → widgets}/tempHumidity/index.js +0 -0
  101. /package/lib/{plugins → widgets}/tempHumidity/tempHumidity.d.ts +0 -0
  102. /package/lib/{plugins → widgets}/tempHumidity/tempHumidity.less +0 -0
  103. /package/lib/{plugins → widgets}/verticalSmallIntercom/index.d.ts +0 -0
  104. /package/lib/{plugins → widgets}/verticalSmallIntercom/index.js +0 -0
  105. /package/lib/{plugins → widgets}/verticalSmallIntercom/verticalSmallIntercom.d.ts +0 -0
  106. /package/lib/{plugins → widgets}/verticalSmallIntercom/verticalSmallIntercom.js +0 -0
  107. /package/lib/{plugins → widgets}/verticalSmallIntercom/verticalSmallIntercom.less +0 -0
  108. /package/lib/{plugins → widgets}/videoBitKBP/index.d.ts +0 -0
  109. /package/lib/{plugins → widgets}/videoBitKBP/index.js +0 -0
  110. /package/lib/{plugins → widgets}/videoBitKBP/videoBitKBP.d.ts +0 -0
  111. /package/lib/{plugins → widgets}/voiceIntercom/index.d.ts +0 -0
  112. /package/lib/{plugins → widgets}/voiceIntercom/index.js +0 -0
  113. /package/lib/{plugins → widgets}/voiceIntercom/voiceIntercom.d.ts +0 -0
  114. /package/lib/{plugins → widgets}/voiceIntercom/voiceIntercom.js +0 -0
  115. /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[];
@@ -4,7 +4,7 @@ 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 { 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;
@@ -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;
@@ -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.js CHANGED
@@ -86,7 +86,6 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
86
86
  setVerticalMic(verticalMic);
87
87
  }, []);
88
88
  const refreshBottomLeft = value => {
89
- console.log(value, '++++++++++++++----sadbjasbdjbsj');
90
89
  event.current.emit(startTimeToHideAllComponent);
91
90
  event.current.emit(showAllComponent);
92
91
  event.current.emit(playerTap);
@@ -274,7 +273,6 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
274
273
  height: screenType === 'vertical' ? (style === null || style === void 0 ? void 0 : style.height) || '100%' : '100vh'
275
274
  })
276
275
  }, /*#__PURE__*/React.createElement(IPCPlayer, _extends({
277
- objectFit: "",
278
276
  defaultMute: mute,
279
277
  devId: devId,
280
278
  onlineStatus: deviceOnline,
@@ -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;
@@ -43,7 +43,7 @@ export function FullVoiceIntercom(props) {
43
43
  }
44
44
  return /*#__PURE__*/React.createElement(View, {
45
45
  className: clsx('ipc-player-plugin-full-screen-voice', {
46
- 'ipc-player-plugin-full-screen-voice-hide': shouldHide || isPtzActive,
46
+ 'ipc-player-plugin-full-screen-voice-hide': isPtzActive || shouldHide,
47
47
  'ipc-player-plugin-full-screen-voice-disappear': screenType === 'vertical'
48
48
  })
49
49
  }, /*#__PURE__*/React.createElement(VoiceIntercom, _extends({}, props, {
@@ -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)) {
@@ -54,10 +52,9 @@ export const Ptz = props => {
54
52
  absoluteContentClassName: 'ipc-player-plugin-full-screen-ptz-control-wrap',
55
53
  initProps: _objectSpread({}, props)
56
54
  });
57
- } else {
58
- console.log('ptzControlShow ===========');
59
- event.emit('ptzControlShow');
55
+ // event.emit('ptzControlShow');
60
56
  }
57
+ event.emit('ptzControlShow');
61
58
  } else {
62
59
  // deleteContent('absolute', ptzControlId);
63
60
  hideContent('bottomLeft', 'FullSmallIntercom');
@@ -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
 
@@ -1,5 +1,6 @@
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
1
2
  import React, { useContext, useEffect, useRef, useState } from 'react';
2
- import { CoverView } from '@ray-js/ray';
3
+ import { CoverView, getStorage } from '@ray-js/ray';
3
4
  import clsx from 'clsx';
4
5
  import _find from 'lodash/find';
5
6
  import _get from 'lodash/get';
@@ -8,9 +9,10 @@ import IpcUtils from '@ray-js/ray-ipc-utils';
8
9
  import { useMemoizedFn } from '../../hooks';
9
10
  import { useComponentHideState } from '../../ui/hooks';
10
11
  import { UIEventContext } from '../../ui/context';
12
+ import { PtzControlTip } from '../ptzControlTip';
13
+ import { ptzControlTipId, pauseTimeToHideAllComponent } from '../../ui/constant';
11
14
  import { useStore } from '../../ctx/store';
12
15
  import { getEnumRangeIsValid } from '../../utils/device';
13
- import { pauseTimeToHideAllComponent } from '../../ui/constant';
14
16
  import Styles from './ptz.less';
15
17
  const getPtzData = devId => {
16
18
  return [{
@@ -37,7 +39,8 @@ const getPtzData = devId => {
37
39
  };
38
40
  export const PtzControl = props => {
39
41
  const {
40
- devId
42
+ devId,
43
+ addContent
41
44
  } = props;
42
45
  const {
43
46
  screenType,
@@ -48,6 +51,7 @@ export const PtzControl = props => {
48
51
  });
49
52
  const [shouldHide] = useComponentHideState();
50
53
  const [isPtzActive, setIsPtzActive] = useState(true);
54
+ const [showPtzControlTip, setShowPtzControlTip] = useState(false);
51
55
  const {
52
56
  event
53
57
  } = useContext(UIEventContext);
@@ -59,6 +63,18 @@ export const PtzControl = props => {
59
63
  const onPtzControlShow = useMemoizedFn(() => {
60
64
  setIsPtzActive(true);
61
65
  });
66
+
67
+ // 获取是否有ptz控制tip
68
+ useEffect(() => {
69
+ getStorage({
70
+ key: `${devId}_ptzControlTip}`,
71
+ success: res => {
72
+ if (!res.data) {
73
+ setShowPtzControlTip(true);
74
+ }
75
+ }
76
+ });
77
+ }, []);
62
78
  useEffect(() => {
63
79
  event.on('ptzControlHide', onPtzControlHide);
64
80
  event.on('ptzControlShow', onPtzControlShow);
@@ -86,6 +102,7 @@ export const PtzControl = props => {
86
102
  ptzData: ptzData.current,
87
103
  onTouchPtzStart: async data => {
88
104
  event.emit(pauseTimeToHideAllComponent);
105
+ // event.emit('ptzControlTipShow', true);
89
106
  const {
90
107
  type
91
108
  } = data;
@@ -104,6 +121,16 @@ export const PtzControl = props => {
104
121
  });
105
122
  }, 1000);
106
123
  }
124
+ if (showPtzControlTip) {
125
+ addContent('absolute', {
126
+ id: ptzControlTipId,
127
+ content: props => {
128
+ return /*#__PURE__*/React.createElement(PtzControlTip, props);
129
+ },
130
+ absoluteContentClassName: 'ipc-player-plugin-ptz-control-tip-wrap',
131
+ initProps: _objectSpread({}, props)
132
+ });
133
+ }
107
134
  },
108
135
  onTouchPtzEnd: async () => {
109
136
  const ptzStopData = await IpcUtils.getDpIdByCode(devId, 'ptz_stop');
@@ -0,0 +1 @@
1
+ export * from './ptzControlTip';
@@ -0,0 +1 @@
1
+ export * from './ptzControlTip';
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { ComponentConfigProps } from '../../interface';
3
+ import './ptzControlTip.less';
4
+ type Props = ComponentConfigProps;
5
+ export declare const PtzControlTip: (props: Props) => React.JSX.Element | null;
6
+ export {};
@@ -0,0 +1,45 @@
1
+ import React, { useState } from 'react';
2
+ import { View, Image, CoverView, Text, setStorage } from '@ray-js/ray';
3
+ import clsx from 'clsx';
4
+ import { useStore } from '../../ctx/store';
5
+ import { ptzControlTipId } from '../../ui/constant';
6
+ import { PlayState } from '../../interface';
7
+ import './ptzControlTip.less';
8
+ import { playerPtzControlTip } from '../../res';
9
+ import Strings from '../../i18n';
10
+ export const PtzControlTip = props => {
11
+ const {
12
+ devId,
13
+ deleteContent
14
+ } = props;
15
+ const [showTipModal, setShowTipModal] = useState(true);
16
+ const {
17
+ playState
18
+ } = useStore({
19
+ playState: props.playState
20
+ });
21
+ // 获取缓存状态
22
+ const changeShowTipModal = () => {
23
+ setShowTipModal(false);
24
+ deleteContent('absolute', ptzControlTipId);
25
+ setStorage({
26
+ key: `${devId}_ptzControlTip}`,
27
+ data: 'true'
28
+ });
29
+ };
30
+ if (showTipModal && playState === PlayState.PLAYING) {
31
+ return /*#__PURE__*/React.createElement(CoverView, {
32
+ className: clsx('playerControlTipContainer')
33
+ }, /*#__PURE__*/React.createElement(Image, {
34
+ mode: "widthFix",
35
+ src: playerPtzControlTip,
36
+ className: clsx('controlTipImage')
37
+ }), /*#__PURE__*/React.createElement(Text, {
38
+ className: clsx('controlTipText')
39
+ }, Strings.getLang('ipc_player_ptz_control_tip')), /*#__PURE__*/React.createElement(View, {
40
+ className: clsx('controlTipCloseButton'),
41
+ onClick: changeShowTipModal
42
+ }, Strings.getLang('ipc_player_ptz_close_control_tip')));
43
+ }
44
+ return null;
45
+ };
@@ -0,0 +1,42 @@
1
+ .playerControlTipContainer {
2
+ position: absolute;
3
+ top: 0;
4
+ left: 0;
5
+ right: 0;
6
+ bottom: 0;
7
+ display: flex;
8
+ justify-content: center;
9
+ align-items: center;
10
+ z-index: 999;
11
+ background-color: rgba(0,0,0,0.5);
12
+ flex-direction: column;
13
+ padding: 0 calc(50px * var(--ipc-player-size-scale, 1));;
14
+ transition: all 0.3 ease;
15
+ .controlTipImage {
16
+ width: calc(170px * var(--ipc-player-size-scale, 1));;
17
+ }
18
+ .controlTipText {
19
+ margin-top: calc(10px * var(--ipc-player-size-scale, 1));
20
+ color: rgba(255,255,255,0.7);
21
+ word-break: break-all;
22
+ text-align: center;
23
+ font-size: calc(12px * var(--ipc-player-size-scale, 1));
24
+ font-weight: 400;
25
+ }
26
+ .controlTipCloseButton {
27
+ border-radius: calc(4px * var(--ipc-player-size-scale, 1));
28
+ background-color: rgba(255, 255, 255, 0.3);
29
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
30
+ margin-top: 20rpx;
31
+ text-align: center;
32
+ height: calc(32px * var(--ipc-player-size-scale, 1));
33
+ padding: 0 calc(24px * var(--ipc-player-size-scale, 1));
34
+ overflow: hidden;
35
+ border-radius: calc(32px * var(--ipc-player-size-scale, 1));
36
+ display: flex;
37
+ justify-content: center;
38
+ align-items: center;
39
+ font-size: calc(12px * var(--ipc-player-size-scale, 1));;
40
+ color: #ffffff;
41
+ }
42
+ }
@@ -243,7 +243,6 @@ export function RecordVideo(props) {
243
243
  }
244
244
  try {
245
245
  const recordInfo = await setRecording(target);
246
- console.log(recordInfo, 'recordInfo====');
247
246
  if (target) {
248
247
  setRecordingDisabled(true);
249
248
  setState({
@@ -1,5 +1,5 @@
1
1
  import React, { useContext, useRef } from 'react';
2
- import { View, Image, Text, showModal, openAppSystemSettingPage, getSystemInfoSync } from '@ray-js/ray';
2
+ import { View, Image, Text, showModal, openAppSystemSettingPage } from '@ray-js/ray';
3
3
  import { useSetState, useUpdateEffect, useMemoizedFn } from 'ahooks';
4
4
  import clsx from 'clsx';
5
5
  import IpcUtils from '@ray-js/ray-ipc-utils';
@@ -163,10 +163,6 @@ export function Screenshot(props) {
163
163
  isShowGlobal: true,
164
164
  success: res => {
165
165
  if (res.confirm) {
166
- const {
167
- platform
168
- } = getSystemInfoSync();
169
- console.log(platform, 'platform');
170
166
  openAppSystemSettingPage({
171
167
  scope: 'App-Settings',
172
168
  success: () => {
@@ -36,8 +36,6 @@ export const TempHumidity = props => {
36
36
  className: "tempHumidity"
37
37
  }, `${humidity}`));
38
38
  };
39
- console.log(tempC, tempF, humidity);
40
-
41
39
  // 当无值时返回null
42
40
  if (!tempC && !tempF && !humidity) {
43
41
  return null;
@@ -39,7 +39,10 @@ export const VideoBitKBP = props => {
39
39
  return null;
40
40
  }
41
41
  return /*#__PURE__*/React.createElement(View, {
42
- className: clsx(className)
42
+ className: clsx({
43
+ 'ipc-player-plugin-videoBitKBP-container': true,
44
+ [className]: !!className
45
+ })
43
46
  }, /*#__PURE__*/React.createElement(View, {
44
47
  className: "ipc-player-plugin-videoBitKBP"
45
48
  }, bitKBP));
@@ -1,6 +1,14 @@
1
+ .ipc-player-plugin-videoBitKBP-container {
2
+ min-width: calc(100px * var(--ipc-player-size-scale, 1));
3
+ display: flex;
4
+ justify-content: center;
5
+ align-items: center;
6
+ }
1
7
  .ipc-player-plugin-videoBitKBP {
2
8
  display: flex;
3
9
  align-items: center;
10
+ justify-content: center;
11
+ width: 100%;
4
12
  height: calc(24px * var(--ipc-player-size-scale, 1));
5
13
  padding: 0 calc(9px * var(--ipc-player-size-scale, 1));
6
14
  border-radius: calc(24px * var(--ipc-player-size-scale, 1));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/ipc-player-integration",
3
- "version": "0.0.1-beta-58",
3
+ "version": "0.0.1-beta-60",
4
4
  "description": "IPC 播放器功能集成",
5
5
  "main": "lib/index",
6
6
  "files": [
@@ -38,7 +38,7 @@
38
38
  "dependencies": {
39
39
  "@ray-js/ipc-ptz-zoom": "0.0.2-beta-7",
40
40
  "@ray-js/panel-sdk": "^1.13.1",
41
- "@ray-js/ray-ipc-player": "2.0.20-beta-12",
41
+ "@ray-js/ray-ipc-player": "2.0.20-beta-13",
42
42
  "@ray-js/ray-ipc-utils": "1.1.0-beta-16",
43
43
  "@ray-js/svg": "0.2.0",
44
44
  "clsx": "^1.2.1",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes