@ray-js/ipc-player-integration 0.0.1-beta-46 → 0.0.1-beta-47

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
@@ -80,7 +80,9 @@ export const createUseCtx = _ref => {
80
80
  eventRef.current = getEventInstance();
81
81
  }
82
82
  useEffect(() => {
83
+ console.log('========================+++++');
83
84
  if (devId && _playState === PlayState.PLAYING) {
85
+ console.log('===================');
84
86
  // 获取缓存的值且同步
85
87
  getMemoryState(devId).then(res => {
86
88
  console.log('==== getMemoryState ====', res);
@@ -124,7 +124,7 @@ export function FullScreen(props) {
124
124
  if (screenType === 'full' || hideHorizontalMenu) return null;
125
125
  return /*#__PURE__*/React.createElement(View, {
126
126
  className: clsx(className),
127
- onClick: () => handClick('full')
127
+ onTouchStart: () => handClick('full')
128
128
  }, /*#__PURE__*/React.createElement(Text, {
129
129
  className: clsx('icon-panel', 'icon-panel-landscape', 'ipc-player-plugin-full-screen')
130
130
  }));
@@ -29,7 +29,9 @@ export const Resolution = props => {
29
29
  event
30
30
  } = useContext(UIEventContext);
31
31
  const onResolution = useMemoizedFn(() => {
32
+ console.log('你触发了高标清点击了吗');
32
33
  event.emit('resolutionBtnControlClick');
34
+ console.log(`screenType: ${screenType}`);
33
35
  if (screenType === 'full') {
34
36
  event.emit(hideAllComponent);
35
37
  if (hasContent('absolute', fullResolutionId)) {
@@ -55,11 +57,12 @@ export const Resolution = props => {
55
57
  });
56
58
  return /*#__PURE__*/React.createElement(View, {
57
59
  onClick: onResolution,
58
- className: clsx(className, screenType === 'vertical' ? 'ipc-player-plugin-resolution-vertical' : 'ipc-player-plugin-resolution-full')
60
+ className: clsx(className)
59
61
  }, /*#__PURE__*/React.createElement(View, {
60
62
  className: clsx('ipc-player-plugin-resolution', {
61
63
  'ipc-player-plugin-resolution-full': screenType === 'full'
62
- })
64
+ }),
65
+ onClick: onResolution
63
66
  }, /*#__PURE__*/React.createElement(Text, {
64
67
  className: "resolutionText"
65
68
  }, Strings.getLang(`ipc_player_resolution_${resolution}`))));
@@ -71,14 +71,8 @@ export const VoiceIntercom = props => {
71
71
  };
72
72
  const endVoice = async () => {
73
73
  console.log('=== 结束对讲 ====');
74
- // 单向对讲,结束对讲之后,强制关闭静态状态
75
- if (intercomMode === IntercomMode.OneWay) {
76
- console.log('=== 单向对讲,强制关闭静音状态 ===');
77
- await setMute(false);
78
- } else {
79
- console.log(`=== 双向对讲,恢复对讲之前的静音状态 ${originMuteStatusBeforeVoice.current}===`);
80
- await setMute(originMuteStatusBeforeVoice.current);
81
- }
74
+ // 对讲结束之后,统一关闭静态状态
75
+ await setMute(false);
82
76
  await setIntercom(false);
83
77
  event.emit(startTimeToHideAllComponent);
84
78
  };
package/lib/ui/ui.d.ts CHANGED
@@ -25,6 +25,8 @@ type Props = {
25
25
  brandColor?: string;
26
26
  verticalMic?: boolean;
27
27
  eventRef?: React.RefObject<EventInstance>;
28
+ onPlayerTap?: (data: any) => void;
29
+ extend?: Record<string, any>;
28
30
  };
29
31
  export declare const IPCPlayerIntegration: React.MemoExoticComponent<(props: Props) => React.JSX.Element>;
30
32
  export {};
package/lib/ui/ui.js CHANGED
@@ -1,3 +1,4 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
1
2
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
3
  import "core-js/modules/esnext.iterator.constructor.js";
3
4
  import "core-js/modules/esnext.iterator.map.js";
@@ -49,7 +50,9 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
49
50
  deviceOnline = true,
50
51
  brandColor = '#FF592A',
51
52
  verticalMic = true,
52
- eventRef: eventRefProp
53
+ eventRef: eventRefProp,
54
+ onPlayerTap,
55
+ extend = {}
53
56
  } = props;
54
57
  const instance = getCtxInstance(props.instance, devId);
55
58
  const {
@@ -258,7 +261,7 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
258
261
  // backgroundColor: 'rgba(0,0,0,0.2)',
259
262
  height: screenType === 'vertical' ? (style === null || style === void 0 ? void 0 : style.height) || '100%' : '100vh'
260
263
  })
261
- }, /*#__PURE__*/React.createElement(IPCPlayer, {
264
+ }, /*#__PURE__*/React.createElement(IPCPlayer, _extends({
262
265
  objectFit: "",
263
266
  defaultMute: mute,
264
267
  devId: devId,
@@ -266,16 +269,14 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
266
269
  ipcPlayerContext: instance.IPCPlayerInstance,
267
270
  onChangeStreamStatus: code => {
268
271
  var _props$onPlayStatus;
269
- console.log(code, 'code');
270
272
  const playStateMap = {
271
273
  [PlayerStreamStatus.PreviewSuccess]: PlayState.PLAYING,
272
274
  // 播放中
273
275
  [PlayerStreamStatus.PAUSE]: PlayState.PAUSE // 暂停
274
276
  };
275
- const playState = playStateMap[code];
276
- if (typeof playState !== 'undefined') {
277
- setPlayState(playState);
278
- }
277
+ // 合并为三种状态 连接中 暂停 播放中
278
+ const playState = playStateMap[code] || PlayState.CONNECTING;
279
+ setPlayState(playState);
279
280
  (_props$onPlayStatus = props.onPlayStatus) === null || _props$onPlayStatus === void 0 || _props$onPlayStatus.call(props, {
280
281
  playState,
281
282
  playCode: code
@@ -285,18 +286,6 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
285
286
  // onCtx={getIpcPlayer}
286
287
  // onPlayerTap={handlePlayerClick}
287
288
  ,
288
- onZoomChange: data => {
289
- console.log(`zoomChange事件: ${JSON.stringify(data)}`);
290
- },
291
- onCameraPreviewFailure: data => {
292
- console.log(`onCameraPreviewFailure事件: ${JSON.stringify(data)}`);
293
- // ty.showToast({
294
- // title: `onCameraPreviewFailure事件: ${JSON.stringify(data)}`,
295
- // });
296
- // setTimeout(() => {
297
- // ty.hideToast();
298
- // }, 3000);
299
- },
300
289
  onCameraNotifyWeakNetwork: data => {
301
290
  console.log(`onCameraNotifyWeakNetwork: ${JSON.stringify(data)}`);
302
291
  },
@@ -306,10 +295,11 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
306
295
  ptzControllable: screenType === 'vertical',
307
296
  privateState: privateState,
308
297
  onPlayerTap: data => {
309
- if (disablePlayerTap.current) {
310
- console.log('playerTap 事件已禁止');
311
- return;
312
- }
298
+ onPlayerTap(data);
299
+ // if (disablePlayerTap.current) {
300
+ // console.log('playerTap 事件已禁止');
301
+ // return;
302
+ // }
313
303
  console.log('res===on onVideoTap', data);
314
304
  eventRef.current.emit(playerTap);
315
305
  console.log(prevTriggerEvent.current, 'prevTriggerEvent.current');
@@ -318,11 +308,12 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
318
308
  } else {
319
309
  triggerEvent(hideAllComponent);
320
310
  }
311
+ // onPlayerTap(data);
321
312
  return false; // eslint-disable-line
322
313
  } // 对应原来的onVideoTap
323
314
  ,
324
315
  brandColor: brandColor
325
- }), /*#__PURE__*/React.createElement(View, {
316
+ }, extend)), /*#__PURE__*/React.createElement(View, {
326
317
  className: clsx('ipc-player-top-content', {
327
318
  'ipc-player-top-content-hide': componentHideState,
328
319
  'ipc-player-top-content-show': !componentHideState
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/ipc-player-integration",
3
- "version": "0.0.1-beta-46",
3
+ "version": "0.0.1-beta-47",
4
4
  "description": "IPC 播放器功能集成",
5
5
  "main": "lib/index",
6
6
  "files": [