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