@ray-js/ipc-player-integration 0.0.68-beta.0 → 0.0.70-beta.0

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 (153) hide show
  1. package/README.md +0 -6
  2. package/lib/ctx/ctx.album.test.d.ts +1 -0
  3. package/lib/ctx/ctx.album.test.js +197 -0
  4. package/lib/ctx/ctx.composition.js +13 -3
  5. package/lib/ctx/ctx.js +48 -35
  6. package/lib/ctx/multiCameraCtx.d.ts +2 -0
  7. package/lib/ctx/multiCameraCtx.js +17 -1
  8. package/lib/ctx/multiCameraCtx.test.d.ts +1 -0
  9. package/lib/ctx/multiCameraCtx.test.js +65 -0
  10. package/lib/i18n/index.d.ts +12 -0
  11. package/lib/i18n/strings.d.ts +6 -0
  12. package/lib/i18n/strings.js +6 -0
  13. package/lib/index.d.ts +0 -4
  14. package/lib/index.js +1 -3
  15. package/lib/interface.d.ts +18 -3
  16. package/lib/ui/absoluteContent.d.ts +2 -0
  17. package/lib/ui/absoluteContent.js +3 -0
  18. package/lib/ui/bottomCoverHeight.d.ts +2 -0
  19. package/lib/ui/bottomCoverHeight.js +6 -0
  20. package/lib/ui/bottomCoverHeight.test.d.ts +1 -0
  21. package/lib/ui/bottomCoverHeight.test.js +15 -0
  22. package/lib/ui/bottomLeftContent.js +65 -123
  23. package/lib/ui/bottomRightContent.js +13 -11
  24. package/lib/ui/topLeftContent.js +2 -4
  25. package/lib/ui/topRightContent.js +2 -4
  26. package/lib/ui/ui.d.ts +0 -5
  27. package/lib/ui/ui.js +100 -93
  28. package/lib/utils/captureResult.d.ts +12 -0
  29. package/lib/utils/captureResult.js +70 -0
  30. package/lib/utils/captureResult.test.d.ts +1 -0
  31. package/lib/utils/captureResult.test.js +223 -0
  32. package/lib/utils/fullLinkTracking.d.ts +5 -0
  33. package/lib/utils/fullLinkTracking.js +71 -0
  34. package/lib/utils/navigation.d.ts +2 -1
  35. package/lib/utils/navigation.js +13 -3
  36. package/lib/widgets/battery/battery.js +5 -7
  37. package/lib/widgets/battery/batteryFull.js +5 -7
  38. package/lib/widgets/captureResult/captureResult.d.ts +16 -0
  39. package/lib/widgets/captureResult/captureResult.js +85 -0
  40. package/lib/widgets/captureResult/captureResult.less +144 -0
  41. package/lib/widgets/captureResult/captureResult.test.d.ts +1 -0
  42. package/lib/widgets/captureResult/captureResult.test.js +84 -0
  43. package/lib/widgets/captureResult/index.d.ts +2 -0
  44. package/lib/widgets/captureResult/index.js +2 -0
  45. package/lib/widgets/floodlight/floodlight.js +1 -2
  46. package/lib/widgets/flowLowTip/flowLowTip.js +1 -2
  47. package/lib/widgets/fullScreen/fullScreen.js +31 -44
  48. package/lib/widgets/fullScreen/fullTravelRouteControl.d.ts +2 -2
  49. package/lib/widgets/fullScreen/fullTravelRouteControl.js +6 -3
  50. package/lib/widgets/fullScreen/verticalScreen.js +1 -2
  51. package/lib/widgets/index.d.ts +1 -0
  52. package/lib/widgets/index.js +2 -1
  53. package/lib/widgets/moveInteractiveControl/controlButton.js +1 -2
  54. package/lib/widgets/moveInteractiveControl/moveInteractiveControlUI.js +5 -16
  55. package/lib/widgets/moveInteractiveControl/moveInteractiveControlUI.less +4 -24
  56. package/lib/widgets/multiCamera/index.less +1 -0
  57. package/lib/widgets/multiCamera/landscapeTip.js +2 -5
  58. package/lib/widgets/multiCamera/moveablePtzControl.js +7 -9
  59. package/lib/widgets/multiCamera/multiPtz.js +2 -3
  60. package/lib/widgets/multiCamera/ptzMoveableTip.js +2 -5
  61. package/lib/widgets/multiCamera/switchLayout.js +1 -2
  62. package/lib/widgets/multiCamera/tileMultiPtz.js +2 -3
  63. package/lib/widgets/multiCamera/tileSwitchLayout.js +1 -2
  64. package/lib/widgets/multiCamera/tileTip.js +2 -5
  65. package/lib/widgets/muted/muted.js +1 -2
  66. package/lib/widgets/muted/muted.test.js +52 -66
  67. package/lib/widgets/ptz/ptz.js +1 -2
  68. package/lib/widgets/ptz/ptzControl.js +3 -4
  69. package/lib/widgets/ptzControlTip/ptzControlTip.js +4 -9
  70. package/lib/widgets/ptzControlTip/ptzControlTip.less +0 -6
  71. package/lib/widgets/realTimeMagnification/realTimeMagnification.js +1 -2
  72. package/lib/widgets/recordVideo/recordVideo.js +178 -32
  73. package/lib/widgets/recordVideo/recordVideo.less +17 -74
  74. package/lib/widgets/recordVideo/recordVideo.lifecycle.test.d.ts +1 -0
  75. package/lib/widgets/recordVideo/recordVideo.lifecycle.test.js +106 -0
  76. package/lib/widgets/recordVideo/recordVideo.test.js +3 -169
  77. package/lib/widgets/resolution/fullResolutionControl.js +19 -29
  78. package/lib/widgets/resolution/resolution.js +2 -3
  79. package/lib/widgets/screenshot/screenshot.js +125 -35
  80. package/lib/widgets/screenshot/screenshot.less +1 -40
  81. package/lib/widgets/screenshot/screenshot.test.js +113 -108
  82. package/lib/widgets/signal4G/signal4G.js +1 -4
  83. package/lib/widgets/siren/siren.js +1 -2
  84. package/lib/widgets/tempHumidity/tempHumidity.js +1 -2
  85. package/lib/widgets/toggleVerticalFull/toggleVerticalFull.js +1 -2
  86. package/lib/widgets/trialBadge/index.d.ts +2 -1
  87. package/lib/widgets/trialBadge/index.js +20 -17
  88. package/lib/widgets/trialBadge/index.less +0 -24
  89. package/lib/widgets/trialBadge/useTrialBadge.d.ts +3 -2
  90. package/lib/widgets/trialBadge/useTrialBadge.js +21 -3
  91. package/lib/widgets/tryExperience/tryExperience.js +1 -2
  92. package/lib/widgets/videoBitKBP/videoBitKBP.js +1 -2
  93. package/lib/widgets/voiceIntercom/voiceIntercom.js +24 -50
  94. package/lib/widgets/voiceIntercom/voiceIntercom.less +0 -16
  95. package/lib/widgets/zoomTurntable/turntable/index.d.ts +7 -5
  96. package/lib/widgets/zoomTurntable/turntable/index.js +1 -3
  97. package/lib/widgets/zoomTurntable/zoomTurntableDock.d.ts +3 -5
  98. package/lib/widgets/zoomTurntable/zoomTurntableDock.js +4 -4
  99. package/lib/widgets/zoomTurntable/zoomTurntableEntry.js +19 -32
  100. package/lib/widgets/zoomTurntable/zoomTurntableTip.js +3 -24
  101. package/package.json +7 -15
  102. package/lib/renderer/capabilities.d.ts +0 -8
  103. package/lib/renderer/capabilities.js +0 -19
  104. package/lib/renderer/context.d.ts +0 -5
  105. package/lib/renderer/context.js +0 -6
  106. package/lib/renderer/directionControl.d.ts +0 -6
  107. package/lib/renderer/directionControl.js +0 -3
  108. package/lib/renderer/font-manifest.json +0 -9
  109. package/lib/renderer/font.less +0 -5
  110. package/lib/renderer/glyphs.d.ts +0 -1
  111. package/lib/renderer/glyphs.js +0 -256
  112. package/lib/renderer/index.module.less +0 -48
  113. package/lib/renderer/overlay.d.ts +0 -4
  114. package/lib/renderer/overlay.js +0 -6
  115. package/lib/renderer/ptzZoom.d.ts +0 -6
  116. package/lib/renderer/ptzZoom.js +0 -3
  117. package/lib/renderer/text.d.ts +0 -4
  118. package/lib/renderer/text.js +0 -32
  119. package/lib/renderer/text.module.less +0 -4
  120. package/lib/renderer/viewport.d.ts +0 -7
  121. package/lib/renderer/viewport.js +0 -24
  122. package/lib/res/lynx-signal/index.d.ts +0 -1
  123. package/lib/res/lynx-signal/index.js +0 -22
  124. package/lib/res/lynx-signal/signalFour0.png +0 -0
  125. package/lib/res/lynx-signal/signalFour1.png +0 -0
  126. package/lib/res/lynx-signal/signalFour2.png +0 -0
  127. package/lib/res/lynx-signal/signalFour3.png +0 -0
  128. package/lib/res/lynx-signal/signalFour4.png +0 -0
  129. package/lib/res/lynx-signal/signalThree0.png +0 -0
  130. package/lib/res/lynx-signal/signalThree1.png +0 -0
  131. package/lib/res/lynx-signal/signalThree2.png +0 -0
  132. package/lib/res/lynx-signal/signalThree3.png +0 -0
  133. package/lib/res/player-charging.png +0 -0
  134. package/lib/res/player-more-arrow.png +0 -0
  135. package/lib/res/player-solar.png +0 -0
  136. package/lib/ui/scrollHintArrow.d.ts +0 -23
  137. package/lib/ui/scrollHintArrow.js +0 -83
  138. package/lib/widgets/battery/statusIcon.d.ts +0 -6
  139. package/lib/widgets/battery/statusIcon.js +0 -36
  140. package/lib/widgets/battery/statusIcon.less +0 -24
  141. package/lib/widgets/captureToast/captureToast.d.ts +0 -9
  142. package/lib/widgets/captureToast/captureToast.js +0 -73
  143. package/lib/widgets/recordVideo/recordVideoTimer.d.ts +0 -3
  144. package/lib/widgets/recordVideo/recordVideoTimer.js +0 -26
  145. package/lib/widgets/zoomTurntable/lynxDockLayout.d.ts +0 -6
  146. package/lib/widgets/zoomTurntable/lynxDockLayout.js +0 -30
  147. package/lib/widgets/zoomTurntable/turntable/lynx.d.ts +0 -5
  148. package/lib/widgets/zoomTurntable/turntable/lynx.js +0 -273
  149. package/lib/widgets/zoomTurntable/turntable/lynx.less +0 -9
  150. package/lib/widgets/zoomTurntable/turntable/lynxModel.d.ts +0 -37
  151. package/lib/widgets/zoomTurntable/turntable/lynxModel.js +0 -122
  152. package/lib/widgets/zoomTurntable/turntable/lynxPaint.d.ts +0 -3
  153. package/lib/widgets/zoomTurntable/turntable/lynxPaint.js +0 -36
package/lib/ui/ui.js CHANGED
@@ -6,34 +6,31 @@ import "core-js/modules/esnext.iterator.find.js";
6
6
  import "core-js/modules/esnext.iterator.map.js";
7
7
  import "core-js/modules/esnext.iterator.some.js";
8
8
  import React, { useContext, useState, useRef, useMemo, useEffect, useImperativeHandle } from 'react';
9
- import { View, getSystemInfoSync, usePageEvent, setNavigationBarBack, setPageOrientation, getCurrentPages } from '@ray-js/ray';
9
+ import { View, CoverView, getSystemInfoSync, usePageEvent, setNavigationBarBack, setPageOrientation, getCurrentPages } from '@ray-js/ray';
10
10
  import { unstable_batchedUpdates as batchedUpdates } from '@ray-core/ray';
11
11
  import clsx from 'clsx';
12
12
  import IPCPlayer from '@ray-js/ray-ipc-player';
13
13
  import { ipcTTTOperatorLog } from '@ray-js/ray-ipc-utils';
14
14
  import { ClarityType } from '@ray-js/ray-ipc-utils/lib/interface';
15
- import { getPlayerOverlayHost } from '../renderer/overlay';
16
- import { PlayerRenderModeContext, PlayerControlVisibilityContext } from '../renderer/context';
17
- import lynxStyles from '../renderer/index.module.less';
18
- import { getPlayerViewport } from '../renderer/viewport';
19
- import { LynxPlayerAdaptersContext } from '../renderer/capabilities';
20
15
  import { PlayState, PlayerStreamStatus, MultiCameraScreenMode } from '../interface';
21
16
  import { useCtx } from '../ctx/ctx.composition';
22
- import { useStore, updateAtom, getDefaultStore } from '../ctx/store';
17
+ import { useStore, updateAtom } from '../ctx/store';
23
18
  import { UIEventContext } from './context';
24
- import { showAllComponent, hideAllComponent, playerTap, startTimeToHideAllComponent, pauseTimeToHideAllComponent, decodeClarityDic, changeIgnoreHideStopPreview, moveablePtzControlId, tileActionsId, tileTipId, landscapeTipId, multiPtzId, ptzMoveableTipId, showFlowLowTipId, zoomLevelChange, setScaleMultipleEvent, trialCountdownEnd, refreshSmartImageQualityEvent } from './constant';
19
+ import { showAllComponent, hideAllComponent, playerTap, startTimeToHideAllComponent, pauseTimeToHideAllComponent, decodeClarityDic, changeIgnoreHideStopPreview, moveablePtzControlId, tileActionsId, tileTipId, landscapeTipId, multiPtzId, ptzMoveableTipId, ptzControlTipId, showFlowLowTipId, zoomLevelChange, setScaleMultipleEvent, trialCountdownEnd, refreshSmartImageQualityEvent } from './constant';
25
20
  import BottomLeftContent from './bottomLeftContent';
26
21
  import BottomRightContent from './bottomRightContent';
27
22
  import TopLeftContent from './topLeftContent';
28
23
  import TopRightContent from './topRightContent';
29
24
  import { useOfflineShownNotification } from './useOfflineShownNotification';
30
- import { FlowLowTip, VideoBitKBP } from '../widgets';
25
+ import { FlowLowTip, VideoBitKBP, zoomTurntableTipId } from '../widgets';
31
26
  import { useMemoizedFn } from '../hooks';
32
27
  import { Storage } from '../utils/storage';
33
28
  import './ui.less';
34
29
  import { updatePlayerWidgetProps } from '../features';
35
30
  import { getNgRawData, getSmartImageQualityState, isLowPhone } from '../utils/ttt';
31
+ import { getCaptureResultSummary } from '../utils/captureResult';
36
32
  import { lensCount } from '../widgets/zoomTurntable/lensSkill';
33
+ import { shouldRenderContent } from './absoluteContent';
37
34
  const AutoClarityOnly = _ref => {
38
35
  let {
39
36
  instance
@@ -105,7 +102,6 @@ const SCALE_MATCH_EPS = 0.01;
105
102
  const BOTTOM_RIGHT_SAFE_GAP = 4;
106
103
  export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
107
104
  const {
108
- renderMode = 'webview',
109
105
  className,
110
106
  devId,
111
107
  style,
@@ -130,7 +126,6 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
130
126
  previewEnabled = undefined,
131
127
  onPreviewEnabledChange
132
128
  } = props;
133
- const OverlayView = getPlayerOverlayHost(renderMode);
134
129
  const {
135
130
  event
136
131
  } = useContext(UIEventContext);
@@ -336,6 +331,10 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
336
331
  maxZoomSettings: instance.maxZoomSettings,
337
332
  zoomSkill: instance.zoomSkill
338
333
  });
334
+ const hasVisibleGuideTip = absoluteContent === null || absoluteContent === void 0 ? void 0 : absoluteContent.some(item => [tileTipId, landscapeTipId, ptzMoveableTipId, ptzControlTipId, zoomTurntableTipId].includes(item.id) && playState === PlayState.PLAYING && shouldRenderContent(item, {
335
+ playState
336
+ }));
337
+ const hasPendingLayoutGuide = (absoluteContent === null || absoluteContent === void 0 ? void 0 : absoluteContent.some(item => item.id === tileTipId)) && !new Storage(devId).getSync(tileTipId);
339
338
 
340
339
  // 默认最大缩放倍数下发给播放器;多镜头设备的上限要按当前镜头换算,交给 zoomTurntable 下发
341
340
  useEffect(() => {
@@ -454,6 +453,19 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
454
453
  multiCameraCtx.setPtzStatus(false);
455
454
  }, null);
456
455
  }, [screenMode, instance]);
456
+ useEffect(() => {
457
+ const {
458
+ multiCameraCtx
459
+ } = instance;
460
+ if (!multiCameraCtx.isSupport || screenMode !== MultiCameraScreenMode.full || hasPendingLayoutGuide) {
461
+ return;
462
+ }
463
+ if (selectedLenInfo.supportPTZ) {
464
+ multiCameraCtx.openDefaultPtz();
465
+ } else if (!selectedLenInfo.supportZoom) {
466
+ multiCameraCtx.setPtzStatus(false);
467
+ }
468
+ }, [instance, screenMode, selectedLenInfo.index, selectedLenInfo.supportPTZ, selectedLenInfo.supportZoom, hasPendingLayoutGuide]);
457
469
  useEffect(() => {
458
470
  if (!instance.multiCameraCtx.isSupport) return;
459
471
 
@@ -461,13 +473,16 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
461
473
  instance.multiCameraCtx.getNextLayoutStyle().then(res => {
462
474
  instance.multiCameraCtx.setNextLayoutStyle(res);
463
475
  });
476
+ if (isVerticalFullLayout && screenType === 'vertical') {
477
+ showComponents();
478
+ }
464
479
  }, [layoutStyle, screenMode, instance]);
465
480
  useEffect(() => {
466
481
  if (!instance.multiCameraCtx.isSupport) return;
467
482
 
468
483
  // 组件隐藏时也隐藏镜头名
469
484
  instance.multiCameraCtx.showLenNames(!componentHideState);
470
- }, [componentHideState, instance]);
485
+ }, [componentHideState, instance, layoutStyle, screenMode]);
471
486
  useEffect(() => {
472
487
  if (!instance.multiCameraCtx.isSupport) return;
473
488
  if (ptzStatus) {
@@ -478,7 +493,7 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
478
493
  }, [instance, ptzStatus]);
479
494
  useEffect(() => {
480
495
  if (!instance.multiCameraCtx.isSupport) return;
481
- if (!ptzStatus || screenMode !== MultiCameraScreenMode.full) {
496
+ if (!ptzStatus || screenMode !== MultiCameraScreenMode.full || componentHideState || hasPendingLayoutGuide) {
482
497
  instance.hideContent('absolute', ptzMoveableTipId);
483
498
  }
484
499
 
@@ -492,11 +507,11 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
492
507
 
493
508
  // ptz 提示
494
509
  const storage = new Storage(devId);
495
- if (!storage.getSync(ptzMoveableTipId) && selectedLenInfo.supportPTZ && screenMode === MultiCameraScreenMode.full) {
510
+ if (!storage.getSync(ptzMoveableTipId) && !hasPendingLayoutGuide && !componentHideState && selectedLenInfo.supportPTZ && screenMode === MultiCameraScreenMode.full) {
496
511
  instance.showContent('absolute', ptzMoveableTipId);
497
512
  }
498
513
  }
499
- }, [instance, ptzStatus, selectedLenInfo, componentHideState, screenMode]);
514
+ }, [instance, ptzStatus, selectedLenInfo, componentHideState, screenMode, hasPendingLayoutGuide]);
500
515
 
501
516
  // 适配横屏进入面板的情况
502
517
  useEffect(() => {
@@ -513,8 +528,6 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
513
528
  const handDisablePlayerTap = useMemoizedFn(value => {
514
529
  disablePlayerTap.current = !!value;
515
530
  });
516
-
517
- // 须在竖屏全屏 effect 之前注册,否则多目首帧 emit('disablePlayerTap') 时 listener 尚未挂载
518
531
  useEffect(() => {
519
532
  eventRef.current.on('disablePlayerTap', handDisablePlayerTap);
520
533
  return () => {
@@ -524,17 +537,10 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
524
537
 
525
538
  // 竖屏全屏副作用处理
526
539
  useEffect(() => {
540
+ eventRef.current.emit('disablePlayerTap', false);
541
+ showComponents();
527
542
  if (isVerticalFullLayout && screenType === 'vertical') {
528
- // 竖屏全屏时,控件常驻显示
529
- eventRef.current.emit(showAllComponent);
530
- eventRef.current.emit('disablePlayerTap', true);
531
- eventRef.current.emit(pauseTimeToHideAllComponent);
532
- // 按宽填充,保证播放流宽度为屏幕宽度,高度自适应设为1倍
533
543
  setScaleMultiple(1);
534
- } else {
535
- // 短屏或横屏时,恢复自动隐藏
536
- eventRef.current.emit('disablePlayerTap', false);
537
- showComponents();
538
544
  }
539
545
  }, [isVerticalFullLayout, screenType, playerFit]);
540
546
  useEffect(() => {
@@ -693,14 +699,16 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
693
699
  ipcTTTOperatorLog('hide: 调用停止录制方法');
694
700
  setRecording(false, true);
695
701
  setIntercom(false, true);
696
- instance === null || instance === void 0 || instance.IPCPlayerInstance.stopRecord({
697
- saveToAlbum: 1,
698
- success: () => {
699
- ipcTTTOperatorLog('hide: 调用停止录制方法成功');
700
- },
701
- fail: () => {
702
- ipcTTTOperatorLog('hide: 调用停止录制方法失败');
703
- }
702
+ instance === null || instance === void 0 || instance.stopRecordingOnUnload().then(async result => {
703
+ var _instance$multiLens, _instance$multiCamera;
704
+ const summary = await getCaptureResultSummary(result, {
705
+ multiLens: (_instance$multiLens = instance === null || instance === void 0 ? void 0 : instance.multiLens) !== null && _instance$multiLens !== void 0 ? _instance$multiLens : false,
706
+ lensIndices: instance === null || instance === void 0 || (_instance$multiCamera = instance.multiCameraCtx) === null || _instance$multiCamera === void 0 || (_instance$multiCamera = _instance$multiCamera.protocol) === null || _instance$multiCamera === void 0 || (_instance$multiCamera = _instance$multiCamera.split_info) === null || _instance$multiCamera === void 0 ? void 0 : _instance$multiCamera.map(lens => lens.index),
707
+ devId
708
+ });
709
+ ipcTTTOperatorLog(summary !== null && summary !== void 0 && summary.isMultiLens ? `hide: stop recording succeeded with ${summary.count} thumbnails` : 'hide: 调用停止录制方法成功');
710
+ }).catch(() => {
711
+ ipcTTTOperatorLog('hide: 调用停止录制方法失败');
704
712
  });
705
713
  ipcTTTOperatorLog('hide: 调用停止对讲方法');
706
714
  instance === null || instance === void 0 || instance.IPCPlayerInstance.stopTalk({
@@ -924,7 +932,7 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
924
932
  clearTimeout(timer.current);
925
933
  timer.current = null;
926
934
  }
927
- if (!hasUserTappedPlayerRef.current) return;
935
+ if (!hasUserTappedPlayerRef.current || hasVisibleGuideTip) return;
928
936
  timer.current = setTimeout(onTimeout, HIDE_COMPONENT_TIME);
929
937
  });
930
938
 
@@ -953,9 +961,6 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
953
961
  const listenStart = useMemoizedFn(() => {
954
962
  // 重新开始计时(用户还没点过画面时不启动,见 startHideTimer)
955
963
  startHideTimer(() => {
956
- // 定时器触发时从 store 读最新状态,避免启动时闭包拿到过期的 isVerticalFullLayout
957
- const store = getDefaultStore();
958
- if (store.get(instance.isVerticalFullLayout) && store.get(instance.screenType) === 'vertical') return;
959
964
  triggerEvent(hideAllComponent);
960
965
  });
961
966
  });
@@ -970,6 +975,13 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
970
975
  if (isHidingByTapRef.current) return;
971
976
  setComponentHideState(false);
972
977
  });
978
+ useEffect(() => {
979
+ if (hasVisibleGuideTip) {
980
+ showComponents();
981
+ } else {
982
+ listenStart();
983
+ }
984
+ }, [hasVisibleGuideTip]);
973
985
  const onChangeIgnoreHideStopPreview = state => {
974
986
  setIgnoreStopOnHide(state);
975
987
  };
@@ -1093,32 +1105,23 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
1093
1105
  return false;
1094
1106
  });
1095
1107
  const playerContainerHeight = screenType === 'vertical' ? (style === null || style === void 0 ? void 0 : style.height) || '100%' : '100vh';
1096
- const isVerticalFullMode = isVerticalFullLayout && screenType === 'vertical';
1097
- const lynxVerticalFull = renderMode === 'lynx' && isVerticalFullMode;
1098
- const viewport = getPlayerViewport(renderMode, isVerticalFullMode, playerContainerHeight);
1099
- return /*#__PURE__*/React.createElement(PlayerRenderModeContext.Provider, {
1100
- value: renderMode
1101
- }, /*#__PURE__*/React.createElement(LynxPlayerAdaptersContext.Provider, {
1102
- value: props.lynxAdapters || {}
1103
- }, /*#__PURE__*/React.createElement(UIEventContext.Provider, {
1108
+ const bottomHideState = isVerticalFullLayout && screenType === 'vertical' ? false : componentHideState;
1109
+ return /*#__PURE__*/React.createElement(UIEventContext.Provider, {
1104
1110
  value: {
1105
1111
  event: eventRef.current,
1106
1112
  componentHideState,
1107
1113
  refreshElement
1108
1114
  }
1109
1115
  }, /*#__PURE__*/React.createElement(View, {
1110
- className: clsx('ipc-player-content', renderMode === 'lynx' && lynxStyles.root, isSmallScreen && 'ipc-player-content-small-screen', className),
1116
+ className: clsx('ipc-player-content', isSmallScreen && 'ipc-player-content-small-screen', className),
1111
1117
  style: _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, defaultCSSVariable), CSSVariable), style), {}, {
1112
1118
  height: playerContainerHeight
1113
- }, lynxVerticalFull ? {
1114
- backgroundColor: '#000'
1115
- } : {})
1119
+ })
1116
1120
  }, /*#__PURE__*/React.createElement(View, {
1117
- className: lynxVerticalFull ? lynxStyles.verticalViewport : undefined,
1118
- style: viewport.style
1119
- }, /*#__PURE__*/React.createElement(IPCPlayer, _extends({}, renderMode === 'lynx' ? {
1120
- renderMode: 'lynx'
1121
- } : {}, {
1121
+ style: {
1122
+ height: isVerticalFullLayout && screenType === 'vertical' ? `calc(${playerContainerHeight} - 48px)` : playerContainerHeight
1123
+ }
1124
+ }, /*#__PURE__*/React.createElement(IPCPlayer, {
1122
1125
  defaultMute: mute,
1123
1126
  devId: devId,
1124
1127
  onlineStatus: deviceOnline,
@@ -1130,6 +1133,9 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
1130
1133
  onCtx: res => {
1131
1134
  if (res) {
1132
1135
  setCreateCtx(true);
1136
+ if (instance.multiCameraCtx.isSupport) {
1137
+ instance.multiCameraCtx.showLenNames(!componentHideState);
1138
+ }
1133
1139
  }
1134
1140
  }
1135
1141
  // onPlayerTap={handlePlayerClick}
@@ -1137,7 +1143,7 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
1137
1143
  onCameraNotifyWeakNetwork: data => {
1138
1144
  console.log(`onCameraNotifyWeakNetwork: ${JSON.stringify(data)}`);
1139
1145
  },
1140
- clarity: decodeClarityDic[String(resolution).toUpperCase()] || decodeClarityDic.HD,
1146
+ clarity: decodeClarityDic[resolution],
1141
1147
  onZoomChange: onZoomChange
1142
1148
  // objectFit={
1143
1149
  // screenType === 'vertical'
@@ -1151,7 +1157,7 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
1151
1157
  // scaleMultiple={0}
1152
1158
  ,
1153
1159
  awakeStatus: awakeStatus,
1154
- objectFit: viewport.objectFit,
1160
+ objectFit: "fillCrop",
1155
1161
  scaleMultiple: scaleMultiple
1156
1162
  // 安卓横屏问题
1157
1163
  // ptzControllable={screenType === 'vertical'}
@@ -1160,9 +1166,7 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
1160
1166
  onPlayerTap: data => {
1161
1167
  console.log('playerTap event');
1162
1168
  if (disablePlayerTap.current) {
1163
- // 「禁用」只针对「点画面切换控件显隐」这件事(竖屏全屏下控件要常驻),
1164
- // 但用户确实点了画面这个事实仍要派发出去 —— 转盘、PTZ 这类浮层靠它收起。
1165
- // 不派发的话,竖屏全屏下点播放器关不掉转盘(普通竖屏可以,因为那时没禁用)。
1169
+ // Host overlays may disable toggling; popups still need the tap notification.
1166
1170
  console.log('playerTap 事件已禁止显隐切换,仅派发 tap 通知浮层');
1167
1171
  eventRef.current.emit(playerTap);
1168
1172
  return;
@@ -1171,17 +1175,17 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
1171
1175
  // 这一下起,自动隐藏倒计时才开始生效
1172
1176
  hasUserTappedPlayerRef.current = true;
1173
1177
  if (instance.multiCameraCtx.isSupport) {
1174
- var _instance$multiCamera, _instance$multiCamera2;
1175
- const preTapIndex = (_instance$multiCamera = (_instance$multiCamera2 = instance.multiCameraCtx.selectedLenInfoRef.current) === null || _instance$multiCamera2 === void 0 ? void 0 : _instance$multiCamera2.index) !== null && _instance$multiCamera !== void 0 ? _instance$multiCamera : prevSelectedIndexRef.current;
1178
+ var _instance$multiCamera2, _instance$multiCamera3;
1179
+ const preTapIndex = (_instance$multiCamera2 = (_instance$multiCamera3 = instance.multiCameraCtx.selectedLenInfoRef.current) === null || _instance$multiCamera3 === void 0 ? void 0 : _instance$multiCamera3.index) !== null && _instance$multiCamera2 !== void 0 ? _instance$multiCamera2 : prevSelectedIndexRef.current;
1176
1180
  const wasHidden = componentHideState;
1177
1181
  instance.multiCameraCtx.selectVideoFiredRef.current = false;
1178
1182
  if (multiTapTimerRef.current) {
1179
1183
  clearTimeout(multiTapTimerRef.current);
1180
1184
  }
1181
1185
  multiTapTimerRef.current = setTimeout(() => {
1182
- var _instance$multiCamera3, _instance$multiCamera4;
1186
+ var _instance$multiCamera4, _instance$multiCamera5;
1183
1187
  const selectFired = !!instance.multiCameraCtx.selectVideoFiredRef.current;
1184
- const currentIndex = (_instance$multiCamera3 = (_instance$multiCamera4 = instance.multiCameraCtx.selectedLenInfoRef.current) === null || _instance$multiCamera4 === void 0 ? void 0 : _instance$multiCamera4.index) !== null && _instance$multiCamera3 !== void 0 ? _instance$multiCamera3 : preTapIndex;
1188
+ const currentIndex = (_instance$multiCamera4 = (_instance$multiCamera5 = instance.multiCameraCtx.selectedLenInfoRef.current) === null || _instance$multiCamera5 === void 0 ? void 0 : _instance$multiCamera5.index) !== null && _instance$multiCamera4 !== void 0 ? _instance$multiCamera4 : preTapIndex;
1185
1189
  if (selectFired && currentIndex === preTapIndex) {
1186
1190
  if (wasHidden) {
1187
1191
  showComponents();
@@ -1233,11 +1237,9 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
1233
1237
  limitFlow: limitFlow,
1234
1238
  autoWakeUp: autoWakeUp,
1235
1239
  extend: _objectSpread(_objectSpread({
1236
- backgroundColor: viewport.backgroundColor
1240
+ backgroundColor: '#262626'
1237
1241
  }, instance.multiCameraCtx.extendProps), extend)
1238
- }))), /*#__PURE__*/React.createElement(PlayerControlVisibilityContext.Provider, {
1239
- value: !componentHideState && !refreshElement
1240
- }, showTopContent && /*#__PURE__*/React.createElement(View, {
1242
+ })), showTopContent && /*#__PURE__*/React.createElement(View, {
1241
1243
  className: clsx('ipc-player-top-content', {
1242
1244
  'ipc-player-top-content-hide': componentHideState,
1243
1245
  'ipc-player-top-content-show': !componentHideState
@@ -1251,51 +1253,56 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
1251
1253
  ctx: instance
1252
1254
  }, renderTopRightContent, !hasVisibleBitrateWidget && /*#__PURE__*/React.createElement(AutoClarityOnly, {
1253
1255
  instance: instance
1254
- })))), /*#__PURE__*/React.createElement(View, {
1256
+ })))), /*#__PURE__*/React.createElement(StandaloneAutoClarity, {
1257
+ instance: instance,
1258
+ show: !showTopContent || componentHideState || !playerReady
1259
+ }), /*#__PURE__*/React.createElement(View, {
1255
1260
  className: clsx('ipc-player-bottom-content', {
1256
- 'ipc-player-bottom-content-hide': componentHideState,
1257
- 'ipc-player-bottom-content-show': !componentHideState,
1258
- 'ipc-player-bottom-content-full': isVerticalFullMode
1261
+ 'ipc-player-bottom-content-hide': bottomHideState,
1262
+ 'ipc-player-bottom-content-show': !bottomHideState,
1263
+ 'ipc-player-bottom-content-full': isVerticalFullLayout && screenType === 'vertical'
1259
1264
  }),
1260
- style: _objectSpread({
1265
+ style: {
1261
1266
  height: screenType === 'vertical' ? '48px' : '72px'
1262
- }, lynxVerticalFull ? {
1263
- paddingBottom: 0
1264
- } : {})
1265
- }, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(BottomLeftContent, {
1267
+ }
1268
+ }, /*#__PURE__*/React.createElement(UIEventContext.Provider, {
1269
+ value: {
1270
+ event: eventRef.current,
1271
+ componentHideState: bottomHideState,
1272
+ refreshElement
1273
+ }
1274
+ }, /*#__PURE__*/React.createElement(BottomLeftContent, {
1266
1275
  ctx: instance,
1267
1276
  reservedRight: bottomRightReserved
1268
1277
  }, renderBottomLeftContent), /*#__PURE__*/React.createElement(BottomRightContent, {
1269
1278
  ctx: instance,
1270
1279
  width: bottomRightStyleWidth,
1271
1280
  onWidthChange: handleBottomRightWidthChange
1272
- }, renderBottomRightContent)))), /*#__PURE__*/React.createElement(StandaloneAutoClarity, {
1273
- instance: instance,
1274
- show: !showTopContent || componentHideState || !playerReady
1275
- }), (() => {
1281
+ }, renderBottomRightContent))), (() => {
1276
1282
  if (!absoluteContent || !(absoluteContent !== null && absoluteContent !== void 0 && absoluteContent.length)) return null;
1277
1283
  return absoluteContent.map(item => {
1278
- if (item.hidden) return null;
1284
+ if (!shouldRenderContent(item, {
1285
+ playState
1286
+ })) return null;
1287
+ if (item.id === tileActionsId && isVerticalFullLayout && componentHideState) return null;
1288
+ const contentProps = _objectSpread(_objectSpread(_objectSpread({
1289
+ key: item.id
1290
+ }, item.initProps), instance), {}, {
1291
+ IPCPlayerContext: instance.IPCPlayerInstance
1292
+ });
1279
1293
  if (item.absoluteNoCoverView) {
1280
- return /*#__PURE__*/React.createElement(item.content, _objectSpread(_objectSpread(_objectSpread({
1281
- key: item.id
1282
- }, item.initProps), instance), {}, {
1283
- IPCPlayerContext: instance.IPCPlayerInstance
1284
- }));
1294
+ return /*#__PURE__*/React.createElement(item.content, contentProps);
1285
1295
  }
1286
- return /*#__PURE__*/React.createElement(OverlayView, {
1296
+ return /*#__PURE__*/React.createElement(CoverView, {
1287
1297
  key: item.id,
1288
1298
  style: _objectSpread({
1289
1299
  position: 'absolute'
1290
1300
  }, item.absolutePosition),
1291
1301
  className: item.absoluteContentClassName
1292
- }, /*#__PURE__*/React.createElement(item.content, _objectSpread(_objectSpread(_objectSpread({
1293
- key: item.id
1294
- }, item.initProps), instance), {}, {
1295
- IPCPlayerContext: instance.IPCPlayerInstance,
1302
+ }, /*#__PURE__*/React.createElement(item.content, _objectSpread(_objectSpread({}, contentProps), {}, {
1296
1303
  // 添加通用变量单独组件类名
1297
1304
  className: clsx('absolute-item-container')
1298
1305
  })));
1299
1306
  });
1300
- })()))));
1307
+ })()));
1301
1308
  });
@@ -0,0 +1,12 @@
1
+ import type { CaptureResult } from '../interface';
2
+ export type CaptureResultSummary = {
3
+ count: number;
4
+ isMultiLens: boolean;
5
+ thumbnailPath: string;
6
+ };
7
+ export type CaptureResultOptions = {
8
+ multiLens: boolean;
9
+ lensIndices?: number[];
10
+ devId: string;
11
+ };
12
+ export declare function getCaptureResultSummary(result: CaptureResult, { multiLens, lensIndices, devId }: CaptureResultOptions): Promise<CaptureResultSummary | null>;
@@ -0,0 +1,70 @@
1
+ import "core-js/modules/esnext.iterator.constructor.js";
2
+ import "core-js/modules/esnext.iterator.filter.js";
3
+ import "core-js/modules/esnext.iterator.map.js";
4
+ /* eslint-disable camelcase */
5
+ import { getFileSystemManager } from '@ray-js/ray';
6
+ import { getDeviceInfo } from './device';
7
+ const MULTI_LENS_ABILITY_CODE = 'tyabimr4v3';
8
+ const LENS_SUFFIX_PATTERN = /_lens\d+(?=\.[^./?#]+(?:[?#].*)?$)/;
9
+ const FILE_EXTENSION_PATTERN = /(\.[^./?#]+)([?#].*)?$/;
10
+ const getMultiLensIndices = async devId => {
11
+ try {
12
+ var _devInfo$configMetas, _config$split_info;
13
+ const devInfo = await getDeviceInfo(devId);
14
+ const raw = devInfo === null || devInfo === void 0 || (_devInfo$configMetas = devInfo.configMetas) === null || _devInfo$configMetas === void 0 ? void 0 : _devInfo$configMetas[MULTI_LENS_ABILITY_CODE];
15
+ const config = typeof raw === 'string' ? JSON.parse(raw) : raw;
16
+ return (config === null || config === void 0 || (_config$split_info = config.split_info) === null || _config$split_info === void 0 ? void 0 : _config$split_info.map(item => Number(item.index))) || [];
17
+ } catch {
18
+ return [];
19
+ }
20
+ };
21
+ const getLensPath = (path, index) => path.replace(LENS_SUFFIX_PATTERN, '').replace(FILE_EXTENSION_PATTERN, `_lens${index}$1$2`);
22
+ const extractPath = item => {
23
+ if (typeof item === 'string') return item;
24
+ if (typeof (item === null || item === void 0 ? void 0 : item.value) === 'string') return item.value;
25
+ return '';
26
+ };
27
+ const imageExists = async path => {
28
+ if (!path) return false;
29
+ try {
30
+ const manager = await getFileSystemManager();
31
+ return await new Promise(resolve => {
32
+ manager.access({
33
+ path,
34
+ success: () => resolve(true),
35
+ fail: () => resolve(false)
36
+ });
37
+ });
38
+ } catch {
39
+ return false;
40
+ }
41
+ };
42
+ export async function getCaptureResultSummary(result, _ref) {
43
+ let {
44
+ multiLens,
45
+ lensIndices,
46
+ devId
47
+ } = _ref;
48
+ if (!result || typeof result === 'boolean') return null;
49
+ if (!multiLens) {
50
+ return {
51
+ count: 1,
52
+ isMultiLens: false,
53
+ thumbnailPath: extractPath(result.tempImagePath) || extractPath(result.thumbPath) || extractPath(result.filePath)
54
+ };
55
+ }
56
+ const thumbnailPath = extractPath(result.thumbPath) || extractPath(result.tempImagePath);
57
+ if (!thumbnailPath) return null;
58
+ const indices = [...new Set(lensIndices !== null && lensIndices !== void 0 && lensIndices.length ? lensIndices : await getMultiLensIndices(devId))];
59
+ const thumbnails = await Promise.all(indices.map(async index => {
60
+ const path = getLensPath(thumbnailPath, index);
61
+ return (await imageExists(path)) ? path : '';
62
+ }));
63
+ const existingThumbnails = thumbnails.filter(Boolean);
64
+ if (!existingThumbnails.length) return null;
65
+ return {
66
+ count: existingThumbnails.length,
67
+ isMultiLens: true,
68
+ thumbnailPath: existingThumbnails[0]
69
+ };
70
+ }
@@ -0,0 +1 @@
1
+ export {};