@ray-js/ipc-player-integration 0.0.1-beta-42 → 0.0.1-beta-44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/ctx/ctx.js CHANGED
@@ -50,7 +50,6 @@ export const createUseCtx = _ref => {
50
50
 
51
51
  // 竖屏下是否展示对讲, 默认展示
52
52
  const [verticalMic, setVerticalMic] = useAtom(true);
53
-
54
53
  // resolution 当前清晰度
55
54
  const [resolution] = useAtom('HD');
56
55
  // resolution 清晰度列表
@@ -3,6 +3,7 @@ import './fullScreen.less';
3
3
  import type { ComponentConfigProps } from '../../interface';
4
4
  type Props = ComponentConfigProps & {
5
5
  className?: string;
6
+ hideHorizontalMenu?: boolean;
6
7
  };
7
8
  export declare function FullScreen(props: Props): React.JSX.Element | null;
8
9
  export {};
@@ -21,7 +21,8 @@ export function FullScreen(props) {
21
21
  deleteContent,
22
22
  className,
23
23
  showContent,
24
- devId
24
+ devId,
25
+ hideHorizontalMenu
25
26
  } = props;
26
27
  const {
27
28
  screenType
@@ -120,7 +121,7 @@ export function FullScreen(props) {
120
121
  }
121
122
  });
122
123
  };
123
- if (screenType === 'full') return null;
124
+ if (screenType === 'full' || hideHorizontalMenu) return null;
124
125
  return /*#__PURE__*/React.createElement(View, {
125
126
  className: clsx(className),
126
127
  onClick: () => handClick('full')
@@ -221,19 +221,27 @@ export function RecordVideo(props) {
221
221
  showShot: false
222
222
  });
223
223
  }
224
- const recordInfo = await setRecording(target);
225
- if (target) {
226
- setRecordingDisabled(true);
227
- setState({
228
- showTimer: true
229
- });
230
- /** 录制开始后3秒后才可结束 */
231
- timeToResetRecordDisabled();
232
- } else {
224
+ try {
225
+ const recordInfo = await setRecording(target);
226
+ console.log(recordInfo, 'recordInfo====');
227
+ if (target) {
228
+ setRecordingDisabled(true);
229
+ setState({
230
+ showTimer: true
231
+ });
232
+ /** 录制开始后3秒后才可结束 */
233
+ timeToResetRecordDisabled();
234
+ } else {
235
+ setState({
236
+ showTimer: false,
237
+ showShot: true,
238
+ shotUrl: recordInfo.tempImagePath
239
+ });
240
+ }
241
+ } catch (err) {
242
+ console.log('录制失败', err);
233
243
  setState({
234
- showTimer: false,
235
- showShot: true,
236
- shotUrl: recordInfo.tempImagePath
244
+ showTimer: false
237
245
  });
238
246
  }
239
247
  return true;
package/lib/ui/ui.js CHANGED
@@ -83,11 +83,24 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
83
83
  * 监听屏幕布局变化
84
84
  */
85
85
  usePageEvent('onResize', sizeData => {
86
- const {
87
- type
88
- } = sizeData;
89
- console.log('监听到屏幕布局变化', type);
90
- setScreenType(type === 'landscape' ? 'full' : 'vertical');
86
+ try {
87
+ const {
88
+ type
89
+ } = sizeData;
90
+ console.log('监听到屏幕布局变化', type);
91
+ const {
92
+ platform,
93
+ deviceType
94
+ } = systemInfo.current;
95
+ // 针对pad 暂不支持横屏,且在ios pad模式下 会触发onResize事件, 待解决
96
+ if (deviceType === 'pad') {
97
+ setScreenType('vertical');
98
+ } else {
99
+ setScreenType(type === 'landscape' ? 'full' : 'vertical');
100
+ }
101
+ } catch (err) {
102
+ console.log(err, 'err');
103
+ }
91
104
  });
92
105
  const systemInfo = useRef(null);
93
106
  if (!systemInfo.current) {
@@ -234,7 +247,6 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
234
247
  };
235
248
  }, []);
236
249
  const playerReady = playState === PlayState.PLAYING;
237
- console.log('brandColor', 'brandColor');
238
250
  return /*#__PURE__*/React.createElement(UIEventContext.Provider, {
239
251
  value: {
240
252
  event: eventRef.current,
@@ -288,7 +300,10 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
288
300
  onCameraNotifyWeakNetwork: data => {
289
301
  console.log(`onCameraNotifyWeakNetwork: ${JSON.stringify(data)}`);
290
302
  },
291
- clarity: resolution === 'HD' ? 'hd' : 'normal',
303
+ clarity: resolution === 'HD' ? 'hd' : 'normal'
304
+ // 安卓横屏问题
305
+ ,
306
+ ptzControllable: screenType === 'vertical',
292
307
  privateState: privateState,
293
308
  onPlayerTap: data => {
294
309
  if (disablePlayerTap.current) {
@@ -2,5 +2,6 @@ import { UseCtx } from '../../interface';
2
2
  type Ctx = ReturnType<UseCtx>;
3
3
  export declare function initPlayerPlugins(ctx: Ctx, options: {
4
4
  verticalResolutionCustomClick?: boolean;
5
+ hideHorizontalMenu?: boolean;
5
6
  }): Promise<void>;
6
7
  export {};
@@ -14,7 +14,14 @@ export async function initPlayerPlugins(ctx, options) {
14
14
  };
15
15
  }
16
16
  ctx.addContent('bottomLeft', newDefaultBottomLeftContent);
17
- ctx.addContent('bottomRight', defaultBottomRightContent);
17
+ const newDefaultBottomRightContent = _cloneDeep(defaultBottomRightContent);
18
+ const fullScreenIndex = newDefaultBottomRightContent.findIndex(item => item.id === 'FullScreen');
19
+ if (fullScreenIndex !== -1) {
20
+ newDefaultBottomRightContent[fullScreenIndex].initProps = {
21
+ hideHorizontalMenu: options.hideHorizontalMenu
22
+ };
23
+ }
24
+ ctx.addContent('bottomRight', newDefaultBottomRightContent);
18
25
 
19
26
  // 根据 ipc_manual_petting 是否存在,决定是否要插入控件 moveInteractiveControl
20
27
  hasDpCode(ctx.devId, 'ipc_manual_petting').then(res => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/ipc-player-integration",
3
- "version": "0.0.1-beta-42",
3
+ "version": "0.0.1-beta-44",
4
4
  "description": "IPC 播放器功能集成",
5
5
  "main": "lib/index",
6
6
  "files": [
@@ -38,8 +38,8 @@
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-8",
42
- "@ray-js/ray-ipc-utils": "1.1.0-beta-13",
41
+ "@ray-js/ray-ipc-player": "2.0.20-beta-10",
42
+ "@ray-js/ray-ipc-utils": "1.1.0-beta-15",
43
43
  "@ray-js/svg": "0.2.0",
44
44
  "clsx": "^1.2.1",
45
45
  "jotai": "^2.10.2"