@ray-js/ipc-player-integration 0.0.39 → 0.0.40

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.
@@ -32,7 +32,7 @@ const BottomRightContent = _ref => {
32
32
  className: clsx('ipc-player-bottom-right-content-wrap'),
33
33
  style: _objectSpread({
34
34
  paddingLeft: screenType === 'vertical' ? '10px' : '0',
35
- height: screenType === 'vertical' ? shouldHide ? '49px' : '48px' : shouldHide ? '84px' : '83px'
35
+ height: screenType === 'vertical' ? shouldHide ? '49px' : '48px' : shouldHide ? '59px' : '58px'
36
36
  }, widthStyle)
37
37
  }, /*#__PURE__*/React.createElement(View, {
38
38
  style: {
package/lib/ui/ui.js CHANGED
@@ -11,7 +11,7 @@ import IPCPlayer from '@ray-js/ray-ipc-player';
11
11
  import { ipcTTTOperatorLog } from '@ray-js/ray-ipc-utils';
12
12
  import { PlayState, PlayerStreamStatus, MultiCameraScreenMode } from '../interface';
13
13
  import { useCtx } from '../ctx/ctx.composition';
14
- import { useStore, updateAtom } from '../ctx/store';
14
+ import { useStore, updateAtom, getDefaultStore } from '../ctx/store';
15
15
  import { UIEventContext } from './context';
16
16
  import { showAllComponent, hideAllComponent, playerTap, startTimeToHideAllComponent, pauseTimeToHideAllComponent, decodeClarityDic, changeIgnoreHideStopPreview, moveablePtzControlId, tileActionsId, tileTipId, landscapeTipId, multiPtzId, ptzMoveableTipId, showFlowLowTipId, zoomLevelChange, setScaleMultipleEvent, trialCountdownEnd, refreshSmartImageQualityEvent } from './constant';
17
17
  import BottomLeftContent from './bottomLeftContent';
@@ -421,6 +421,19 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
421
421
 
422
422
  /* ---------------------------------多目相关副作用统一处理结束----------------------------------------- */
423
423
 
424
+ const disablePlayerTap = useRef(false);
425
+ const handDisablePlayerTap = useMemoizedFn(value => {
426
+ disablePlayerTap.current = !!value;
427
+ });
428
+
429
+ // 须在竖屏全屏 effect 之前注册,否则多目首帧 emit('disablePlayerTap') 时 listener 尚未挂载
430
+ useEffect(() => {
431
+ eventRef.current.on('disablePlayerTap', handDisablePlayerTap);
432
+ return () => {
433
+ eventRef.current.off('disablePlayerTap', handDisablePlayerTap);
434
+ };
435
+ }, [handDisablePlayerTap]);
436
+
424
437
  // 竖屏全屏副作用处理
425
438
  useEffect(() => {
426
439
  if (isVerticalFullLayout && screenType === 'vertical') {
@@ -768,15 +781,10 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
768
781
  });
769
782
  instance.changeStreamStatus(code);
770
783
  });
771
- const disablePlayerTap = useRef(false);
772
- // 标记正在执行隐藏,防止 playerTap 子组件监听触发 showAllComponent 干扰隐藏
773
784
  const isHidingByTapRef = useRef(false);
774
785
  const hasInitializedLandscapeMultiRef = useRef(false);
775
786
  const multiTapTimerRef = useRef(null);
776
787
  const prevSelectedIndexRef = useRef(selectedLenInfo.index);
777
- const handDisablePlayerTap = value => {
778
- disablePlayerTap.current = !!value;
779
- };
780
788
  /**
781
789
  * 展示所有组件,一段时间后自动关闭
782
790
  */
@@ -812,8 +820,9 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
812
820
  // 重新开始计时
813
821
  // @ts-ignore
814
822
  timer.current = setTimeout(() => {
815
- // 竖屏全屏模式下控件常驻,不触发隐藏
816
- if (isVerticalFullLayout && screenType === 'vertical') return;
823
+ // 定时器触发时从 store 读最新状态,避免启动时闭包拿到过期的 isVerticalFullLayout
824
+ const store = getDefaultStore();
825
+ if (store.get(instance.isVerticalFullLayout) && store.get(instance.screenType) === 'vertical') return;
817
826
  triggerEvent(hideAllComponent);
818
827
  }, HIDE_COMPONENT_TIME);
819
828
  });
@@ -845,7 +854,6 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
845
854
  eventRef.current.on(pauseTimeToHideAllComponent, listenPause);
846
855
  eventRef.current.on(showAllComponent, listenShowEvent);
847
856
  eventRef.current.on(hideAllComponent, listenHideEvent);
848
- eventRef.current.on('disablePlayerTap', handDisablePlayerTap);
849
857
  eventRef.current.on('refreshBottomLeft', refreshBottomLeft);
850
858
  eventRef.current.on(changeIgnoreHideStopPreview, onChangeIgnoreHideStopPreview);
851
859
  eventRef.current.on(setScaleMultipleEvent, onSetScaleMultiple);
@@ -856,7 +864,6 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
856
864
  eventRef.current.off(pauseTimeToHideAllComponent, listenPause);
857
865
  eventRef.current.off(showAllComponent, listenShowEvent);
858
866
  eventRef.current.off(hideAllComponent, listenHideEvent);
859
- eventRef.current.off('disablePlayerTap', handDisablePlayerTap);
860
867
  eventRef.current.off('refreshBottomLeft', refreshBottomLeft);
861
868
  eventRef.current.off(changeIgnoreHideStopPreview, onChangeIgnoreHideStopPreview);
862
869
  eventRef.current.off(setScaleMultipleEvent, onSetScaleMultiple);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/ipc-player-integration",
3
- "version": "0.0.39",
3
+ "version": "0.0.40",
4
4
  "description": "IPC 融合播放器",
5
5
  "main": "lib/index",
6
6
  "files": [