@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
@@ -0,0 +1,73 @@
1
+ import React, { useEffect } from 'react';
2
+ import { View, Image } from '@ray-js/ray';
3
+ import { useMemoizedFn } from 'ahooks';
4
+ import { goToIpcPageNativeRoute } from '@ray-js/ray-ipc-utils';
5
+ import { useStore } from '../../ctx/store';
6
+ import { usePlayerOverlayHost } from '../../renderer/overlay';
7
+ import { PlayerText as Text } from '../../renderer/text';
8
+ import Strings from '../../i18n';
9
+ // This overlay belongs to the player, independently of the remounting toolbar.
10
+ const CaptureToast = _ref => {
11
+ let {
12
+ kind,
13
+ imageUrl,
14
+ captureId,
15
+ screenType,
16
+ brandColor,
17
+ devId,
18
+ deleteContent
19
+ } = _ref;
20
+ const {
21
+ screenType: screen,
22
+ brandColor: color
23
+ } = useStore({
24
+ screenType,
25
+ brandColor
26
+ });
27
+ const OverlayView = usePlayerOverlayHost();
28
+ const isRecord = kind === 'record';
29
+ const id = isRecord ? 'record_video_SUCCESS_toast_id' : 'plugin-screenshot-toast';
30
+ const prefix = isRecord ? 'ipc-player-plugin-record-success' : 'ipc-player-plugin-screenshot';
31
+ const close = useMemoizedFn(() => deleteContent('absolute', id));
32
+ useEffect(() => {
33
+ const timer = setTimeout(close, 5000);
34
+ return () => clearTimeout(timer);
35
+ }, [captureId, close]);
36
+ const vertical = screen === 'vertical';
37
+ return /*#__PURE__*/React.createElement(OverlayView, {
38
+ className: `${prefix}-toast-wrap`,
39
+ style: {
40
+ position: 'absolute',
41
+ top: vertical ? '12px' : '60px',
42
+ left: vertical ? '16px' : '50%',
43
+ right: vertical ? '16px' : 'auto',
44
+ display: 'flex',
45
+ width: vertical ? 'auto' : '400px',
46
+ marginLeft: vertical ? '0' : '-200px'
47
+ }
48
+ }, /*#__PURE__*/React.createElement(View, {
49
+ className: `${prefix}-toast`
50
+ }, /*#__PURE__*/React.createElement(View, {
51
+ className: `${prefix}-toast-image-box`
52
+ }, /*#__PURE__*/React.createElement(Image, {
53
+ className: `${prefix}-toast-image`,
54
+ src: imageUrl
55
+ }), isRecord && /*#__PURE__*/React.createElement(View, {
56
+ className: "ipc-player-plugin-record-success-play-icon-box"
57
+ }, /*#__PURE__*/React.createElement(Text, {
58
+ className: "icon-panel icon-panel-record-play ipc-player-plugin-record-success-play-icon"
59
+ }))), /*#__PURE__*/React.createElement(View, {
60
+ className: `${prefix}-toast-title`
61
+ }, Strings.getLang(isRecord ? 'ipc_player_record_success_tip' : 'ipc_player_screenshot_success_tip')), /*#__PURE__*/React.createElement(View, {
62
+ onClick: () => {
63
+ close();
64
+ goToIpcPageNativeRoute('ipc_album_panel', devId);
65
+ },
66
+ className: `${prefix}-toast-bottom`,
67
+ style: {
68
+ color,
69
+ borderColor: color
70
+ }
71
+ }, Strings.getLang(isRecord ? 'ipc_player_record_success_check' : 'ipc_player_shot_success_check'))));
72
+ };
73
+ export default CaptureToast;
@@ -1,6 +1,7 @@
1
- import { View, Text } from '@ray-js/ray';
1
+ import { View } from '@ray-js/ray';
2
2
  import React, { useContext } from 'react';
3
3
  import clsx from 'clsx';
4
+ import { PlayerText as Text } from '../../renderer/text';
4
5
  import { useDpState } from '../../hooks';
5
6
  import { useStore } from '../../ctx/store';
6
7
  import { UIEventContext } from '../../ui/context';
@@ -1,8 +1,9 @@
1
- import { View, Text } from '@ray-js/ray';
1
+ import { View } from '@ray-js/ray';
2
2
  import clsx from 'clsx';
3
3
  import React, { useEffect, useRef, useState } from 'react';
4
4
  import { getServiceUrl } from '@ray-js/ray-ipc-utils';
5
5
  import { useMemoizedFn } from 'ahooks';
6
+ import { PlayerText as Text } from '../../renderer/text';
6
7
  import Strings from '../../i18n';
7
8
  import { useStore } from '../../ctx/store';
8
9
  import { showFlowLowTipId } from '../../ui/constant';
@@ -1,8 +1,9 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
- import React, { useContext, useEffect } from 'react';
3
- import { View, setPageOrientation, Text, hideMenuButton, showMenuButton, showStatusBar, hideStatusBar, setNavigationBarBack } from '@ray-js/ray';
2
+ import React, { useContext, useEffect, useMemo } from 'react';
3
+ import { View, setPageOrientation, hideMenuButton, showMenuButton, showStatusBar, hideStatusBar, setNavigationBarBack, getSystemInfoSync } from '@ray-js/ray';
4
4
  import clsx from 'clsx';
5
5
  import { unstable_batchedUpdates as batchedUpdates } from '@ray-core/ray';
6
+ import { PlayerText as Text } from '../../renderer/text';
6
7
  import { UIEventContext } from '../../ui/context';
7
8
  import { showAllComponent, voiceIntercomId, verticalScreenId, fullTravelRouteControlId, ptzControlId, fullResolutionId, fullSmallIntercomId, pauseTimeToHideAllComponent, widgetLabs, widgetClick } from '../../ui/constant';
8
9
  import { useStore } from '../../ctx/store';
@@ -34,34 +35,28 @@ export function FullScreen(props) {
34
35
  event
35
36
  } = useContext(UIEventContext);
36
37
 
38
+ // pad 设备不接管系统状态栏显隐:showStatusBar 会导致 iPad 面板布局异常;
39
+ // 且 pad 不支持横屏(见 ui.tsx,初始化即强制 vertical),本就不应进入全屏切换流程。
40
+ // 同时守住 hideStatusBar 以保持这对操作对称,避免异常路径下状态栏被隐藏后无法恢复。
41
+ // deviceType 在一次会话内恒定,useMemo 缓存避免每次 render 重复触发同步桥接调用
42
+ const isPad = useMemo(() => {
43
+ var _getSystemInfoSync;
44
+ return ((_getSystemInfoSync = getSystemInfoSync()) === null || _getSystemInfoSync === void 0 ? void 0 : _getSystemInfoSync.deviceType) === 'pad';
45
+ }, []);
46
+
37
47
  /**
38
48
  * 竖屏统一操作
39
49
  */
40
50
 
41
- const handleVertical = () => {
42
- event.emit(pauseTimeToHideAllComponent);
43
- setNavigationBarBack({
44
- type: 'system'
45
- });
46
- showMenuButton();
47
- showStatusBar();
48
- deleteContent('topLeft', verticalScreenId);
49
- hideContent('bottomLeft', fullSmallIntercomId);
50
- deleteContent('absolute', voiceIntercomId);
51
- deleteContent('absolute', ptzControlId);
52
- deleteContent('absolute', fullResolutionId);
53
- deleteContent('absolute', fullTravelRouteControlId);
54
- };
55
-
56
51
  /**
57
52
  * 全屏统一操作
58
53
  */
59
- const handleFull = isCurrent => {
54
+ const handleFull = () => {
60
55
  hasDpCode(devId, DIRECTION_CONTROL_DP_CODE).then(hasDirectionControlDpCode => {
61
- // 屏幕切换、设备切换或卸载后,旧能力查询不能重新挂载全屏控件。
62
- if (!isCurrent()) return;
63
56
  hideMenuButton();
64
- hideStatusBar();
57
+ if (!isPad) {
58
+ hideStatusBar();
59
+ }
65
60
  setNavigationBarBack({
66
61
  type: 'custom'
67
62
  });
@@ -111,17 +106,35 @@ export function FullScreen(props) {
111
106
  }, null);
112
107
  });
113
108
  };
114
- useEffect(() => {
115
- let active = true;
116
- if (screenType === 'full') {
117
- handleFull(() => active);
118
- } else {
119
- handleVertical();
109
+
110
+ /**
111
+ * 针对横竖屏方法统一集中处理
112
+ */
113
+ const handlers = {
114
+ full: () => {
115
+ handleFull();
116
+ },
117
+ vertical: () => {
118
+ event.emit(pauseTimeToHideAllComponent);
119
+ setNavigationBarBack({
120
+ type: 'system'
121
+ });
122
+ showMenuButton();
123
+ if (!isPad) {
124
+ showStatusBar();
125
+ }
126
+ deleteContent('topLeft', verticalScreenId);
127
+ hideContent('bottomLeft', fullSmallIntercomId);
128
+ deleteContent('absolute', voiceIntercomId);
129
+ deleteContent('absolute', ptzControlId);
130
+ deleteContent('absolute', fullResolutionId);
131
+ deleteContent('absolute', fullTravelRouteControlId);
120
132
  }
121
- return () => {
122
- active = false;
123
- };
124
- }, [screenType, devId]);
133
+ };
134
+ useEffect(() => {
135
+ var _handlers$screenType;
136
+ (_handlers$screenType = handlers[screenType]) === null || _handlers$screenType === void 0 || _handlers$screenType.call(handlers);
137
+ }, [screenType]);
125
138
 
126
139
  // 点击事件处理函数
127
140
  const handClick = target => {
@@ -2,11 +2,11 @@
2
2
  * 全屏状态下要添加的摄像机行进路线控件
3
3
  */
4
4
  import React from 'react';
5
- import RectDirectionControl from '@ray-js/direction-control';
5
+ import RectDirectionControl from '../../renderer/directionControl';
6
6
  import type { ComponentConfigProps } from '../../interface';
7
7
  type RectDirectionControlProps = React.ComponentProps<typeof RectDirectionControl>;
8
8
  export type FullTravelRouteControlProps = ComponentConfigProps & {
9
9
  directionControlProps?: Partial<RectDirectionControlProps>;
10
10
  };
11
- export declare function FullTravelRouteControl(props: FullTravelRouteControlProps): React.JSX.Element | null;
11
+ export declare function FullTravelRouteControl(props: FullTravelRouteControlProps): React.JSX.Element;
12
12
  export {};
@@ -6,8 +6,8 @@ import _extends from "@babel/runtime/helpers/esm/extends";
6
6
  import React, { useEffect, useContext, useState, useRef } from 'react';
7
7
  import { View } from '@ray-js/ray';
8
8
  import clsx from 'clsx';
9
- import RectDirectionControl from '@ray-js/direction-control';
10
9
  import { useMemoizedFn } from 'ahooks';
10
+ import RectDirectionControl from '../../renderer/directionControl';
11
11
  import { UIEventContext } from '../../ui/context';
12
12
  import { useDpState } from '../../hooks';
13
13
  import { useComponentHideState } from '../../ui/hooks';
@@ -26,11 +26,9 @@ export function FullTravelRouteControl(props) {
26
26
  const prevRotate = useRef('-1');
27
27
  const pauseTimeToHideAllComponentRef = useRef(false);
28
28
  const {
29
- brandColor,
30
- screenType
29
+ brandColor
31
30
  } = useStore({
32
- brandColor: props.brandColor,
33
- screenType: props.screenType
31
+ brandColor: props.brandColor
34
32
  });
35
33
  useRef();
36
34
  const [state, _, sendDp] = useDpState({
@@ -66,7 +64,6 @@ export function FullTravelRouteControl(props) {
66
64
  });
67
65
  prevRotate.current = value;
68
66
  };
69
- if (screenType !== 'full') return null;
70
67
  return /*#__PURE__*/React.createElement(View, {
71
68
  className: clsx('ipc-player-plugin-full-screen-voice', 'ipc-plugin-absolute-move-in-right', {
72
69
  'ipc-plugin-absolute-move-in-right-hide': shouldHide || isPtzActive
@@ -1,6 +1,7 @@
1
1
  import React 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 './verticalScreen.less';
5
6
  const NILL = () => null;
6
7
  export function VerticalScreen(_ref) {
@@ -24,4 +24,3 @@ export * from './toggleVerticalFull';
24
24
  export * from './flowLowTip';
25
25
  export * from './realTimeMagnification';
26
26
  export * from './zoomTurntable';
27
- export * from './captureResult';
@@ -23,5 +23,4 @@ export * from './smallIntercom';
23
23
  export * from './toggleVerticalFull';
24
24
  export * from './flowLowTip';
25
25
  export * from './realTimeMagnification';
26
- export * from './zoomTurntable';
27
- export * from './captureResult';
26
+ export * from './zoomTurntable';
@@ -1,6 +1,7 @@
1
1
  import React, { useContext } 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 { UIEventContext } from '../../ui/context';
6
7
  import { hideAllComponent, widgetLabs, widgetClick } from '../../ui/constant';
@@ -2,8 +2,11 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
2
  import "core-js/modules/esnext.iterator.constructor.js";
3
3
  import "core-js/modules/esnext.iterator.map.js";
4
4
  import React from 'react';
5
- import { View, ScrollView, CoverView } from '@ray-js/ray';
5
+ import { View, ScrollView } from '@ray-js/ray';
6
6
  import clsx from 'clsx';
7
+ import { usePlayerOverlayHost } from '../../renderer/overlay';
8
+ import { usePlayerRenderMode } from '../../renderer/context';
9
+ import { PlayerText } from '../../renderer/text';
7
10
  import './moveInteractiveControlUI.less';
8
11
  const defaultMenu = [{
9
12
  key: '0',
@@ -62,6 +65,8 @@ const defaultCSSVariable = {
62
65
  '--activeColor': '#FF592A'
63
66
  };
64
67
  export function MoveInterActiveControlUI(props) {
68
+ const OverlayView = usePlayerOverlayHost();
69
+ const isLynx = usePlayerRenderMode() === 'lynx';
65
70
  const {
66
71
  contentClsName,
67
72
  wrapClsName,
@@ -75,18 +80,22 @@ export function MoveInterActiveControlUI(props) {
75
80
  e.origin.stopPropagation();
76
81
  onClick && onClick(item.key);
77
82
  };
78
- const WrapComponent = coverView ? CoverView : View;
83
+ const WrapComponent = coverView ? OverlayView : View;
79
84
  return /*#__PURE__*/React.createElement(WrapComponent
80
85
  // @ts-ignore
81
86
  , {
82
87
  style: _objectSpread({}, CSSVariable),
83
- className: clsx('ipc-player-plugin-active-control-wrap', wrapClsName)
88
+ className: clsx('ipc-player-plugin-active-control-wrap', wrapClsName, {
89
+ 'ipc-player-plugin-active-control-wrap-lynx': isLynx,
90
+ 'ipc-player-plugin-active-control-wrap-webview': !isLynx
91
+ })
84
92
  }, /*#__PURE__*/React.createElement(View, {
85
93
  className: clsx('ipc-player-plugin-active-control-title')
86
94
  }, I18n.t('homeFeatureInteractiveMenuTitle')), /*#__PURE__*/React.createElement(ScrollView, {
87
95
  style: {
88
96
  flex: 1
89
97
  },
98
+ className: isLynx ? 'ipc-player-plugin-active-control-scroll-lynx' : undefined,
90
99
  scrollY: true
91
100
  }, /*#__PURE__*/React.createElement(View, {
92
101
  className: clsx('ipc-player-plugin-active-control', contentClsName)
@@ -98,9 +107,11 @@ export function MoveInterActiveControlUI(props) {
98
107
  })
99
108
  }, /*#__PURE__*/React.createElement(View, {
100
109
  className: clsx('ipc-player-plugin-active-control-item-icon')
101
- }, /*#__PURE__*/React.createElement(View, {
110
+ }, !isLynx && /*#__PURE__*/React.createElement(View, {
102
111
  className: clsx('ipc-player-plugin-active-control-item-icon-mask')
103
- }), /*#__PURE__*/React.createElement(View, {
112
+ }), isLynx ? /*#__PURE__*/React.createElement(PlayerText, {
113
+ className: clsx('icon-panel', item.iconName, 'ipc-player-plugin-interactive-icon')
114
+ }) : /*#__PURE__*/React.createElement(View, {
104
115
  className: clsx('icon-panel', item.iconName, 'ipc-player-plugin-interactive-icon')
105
116
  })), /*#__PURE__*/React.createElement(View, {
106
117
  className: clsx('ipc-player-plugin-active-control-item-title')
@@ -43,8 +43,6 @@
43
43
  }
44
44
  }
45
45
  .ipc-player-plugin-active-control-item-icon {
46
- position: relative;
47
- z-index: 1;
48
46
  width: calc(42px * var(--ipc-player-size-scale, 1));
49
47
  height: calc(42px * var(--ipc-player-size-scale, 1));
50
48
  border-radius: calc(42px * var(--ipc-player-size-scale, 1));
@@ -54,7 +52,6 @@
54
52
  justify-content: center;
55
53
  font-size: calc(16px * var(--ipc-player-size-scale, 1));
56
54
  color: var(--color);
57
- overflow: hidden;
58
55
  .ipc-player-plugin-active-control-item-icon-mask {
59
56
  position: absolute;
60
57
  width: 100%;
@@ -64,6 +61,14 @@
64
61
  opacity: 1;
65
62
  }
66
63
  }
64
+
65
+ .ipc-player-plugin-active-control-wrap-webview {
66
+ .ipc-player-plugin-active-control-item-icon {
67
+ position: relative;
68
+ z-index: 1;
69
+ overflow: hidden;
70
+ }
71
+ }
67
72
  .ipc-player-plugin-active-control-item-title {
68
73
  width: calc(70px * var(--ipc-player-size-scale, 1));
69
74
  white-space: nowrap; /* 防止文本换行 */
@@ -73,4 +78,19 @@
73
78
  }
74
79
  .ipc-player-plugin-interactive-icon {
75
80
  font-size: calc(20px * var(--ipc-player-size-scale, 1));;
76
- }
81
+ }
82
+
83
+ .ipc-player-plugin-active-control-wrap-lynx {
84
+ min-height: 0;
85
+
86
+ .ipc-player-plugin-active-control-scroll-lynx {
87
+ height: 0;
88
+ min-height: 0;
89
+ overflow: hidden;
90
+ }
91
+
92
+ .ipc-player-plugin-active-control-item-icon {
93
+ // The background belongs to the scrolling card, not a separate absolute layer.
94
+ background: var(--iconBgColor);
95
+ }
96
+ }
@@ -39,7 +39,6 @@
39
39
  }
40
40
 
41
41
  .@{prefix}-moveable-ptz-control {
42
- touch-action: none;
43
42
  --ptz-bg-color: rgba(0, 0, 0, 0.4);
44
43
  --ptz-arrow-bg-color: rgba(0, 0, 0, 0.4);
45
44
  --app-native-btn-bg-color: transparent;
@@ -1,6 +1,8 @@
1
1
  import React, { useState } from 'react';
2
- import { View, CoverView, Text } from '@ray-js/ray';
2
+ import { View } from '@ray-js/ray';
3
3
  import clsx from 'clsx';
4
+ import { usePlayerOverlayHost } from '../../renderer/overlay';
5
+ import { PlayerText as Text } from '../../renderer/text';
4
6
  import { useStore } from '../../ctx/store';
5
7
  import { landscapeTipId } from '../../ui/constant';
6
8
  import { PlayState } from '../../interface';
@@ -9,6 +11,7 @@ import { multiPrefix } from './constants';
9
11
  import { Storage } from '../../utils/storage';
10
12
  import './index.less';
11
13
  export const LandscapeTip = props => {
14
+ const OverlayView = usePlayerOverlayHost();
12
15
  const {
13
16
  devId,
14
17
  deleteContent
@@ -27,7 +30,7 @@ export const LandscapeTip = props => {
27
30
  storage.set(landscapeTipId, true);
28
31
  };
29
32
  if (showTipModal && playState === PlayState.PLAYING) {
30
- return /*#__PURE__*/React.createElement(CoverView, null, /*#__PURE__*/React.createElement(View, {
33
+ return /*#__PURE__*/React.createElement(OverlayView, null, /*#__PURE__*/React.createElement(View, {
31
34
  className: clsx(`${multiPrefix}-tile-tip-content`, `${multiPrefix}-landscape-tip`)
32
35
  }), /*#__PURE__*/React.createElement(Text, {
33
36
  className: clsx(`${multiPrefix}-tile-tip-text`, `${multiPrefix}-landscape-tip`)
@@ -2,12 +2,13 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
3
3
  import "core-js/modules/esnext.iterator.constructor.js";
4
4
  import "core-js/modules/esnext.iterator.filter.js";
5
- import { CoverView, View } from '@ray-js/ray';
5
+ import { View } from '@ray-js/ray';
6
6
  import { getDpIdByCode, publishDps } from '@ray-js/ray-ipc-utils';
7
7
  import _find from 'lodash/find';
8
8
  import _get from 'lodash/get';
9
9
  import React, { useContext, useEffect, useMemo, useRef, useState } from 'react';
10
- import IpcPtzZoom from '@ray-js/ipc-ptz-zoom';
10
+ import { usePlayerOverlayHost } from '../../renderer/overlay';
11
+ import IpcPtzZoom from '../../renderer/ptzZoom';
11
12
  import { useStore } from '../../ctx/store';
12
13
  import { useMemoizedFn } from '../../hooks';
13
14
  import { MultiCameraScreenMode } from '../../interface';
@@ -59,6 +60,7 @@ const getZoomData = devId => {
59
60
  * 可移动的 PTZ 控制器,目前仅在多目使用
60
61
  */
61
62
  export const MoveablePtzControlItem = props => {
63
+ const OverlayView = usePlayerOverlayHost();
62
64
  const {
63
65
  devId,
64
66
  multiCameraCtx,
@@ -317,7 +319,7 @@ export const MoveablePtzControlItem = props => {
317
319
  }, 1000);
318
320
  }
319
321
  });
320
- return /*#__PURE__*/React.createElement(CoverView, {
322
+ return /*#__PURE__*/React.createElement(OverlayView, {
321
323
  style: {
322
324
  position: 'absolute',
323
325
  zIndex: 89,
@@ -390,7 +392,7 @@ export const MoveablePtzControlItem = props => {
390
392
  ptzData: selectedLenInfo.supportPTZ ? ptzData : [],
391
393
  onTouchPtzStart: onTouchPtzStart,
392
394
  onTouchPtzEnd: async () => {
393
- screenMode !== MultiCameraScreenMode.short && event.emit(startTimeToHideAllComponent);
395
+ screenMode === MultiCameraScreenMode.landscape && event.emit(startTimeToHideAllComponent);
394
396
  const stopConfig = dpSupportMap.ipc_multi_ptz_control ? {
395
397
  code: 'ipc_multi_ptz_stop',
396
398
  value: JSON.stringify({
@@ -415,7 +417,7 @@ export const MoveablePtzControlItem = props => {
415
417
  },
416
418
  onTouchZoomStart: onTouchZoomStart,
417
419
  onTouchZoomEnd: async () => {
418
- screenMode !== MultiCameraScreenMode.short && event.emit(startTimeToHideAllComponent);
420
+ screenMode === MultiCameraScreenMode.landscape && event.emit(startTimeToHideAllComponent);
419
421
  const stopConfig = dpSupportMap.ipc_multi_zoom_control ? {
420
422
  code: 'ipc_multi_zoom_stop',
421
423
  value: JSON.stringify({
@@ -464,10 +466,10 @@ export const MoveablePtzControl = props => {
464
466
  // 处理因为状态更新不同步导致的闪烁问题
465
467
  const activeViewRef = useRef(0);
466
468
  const onDragStart = () => {
467
- screenMode !== MultiCameraScreenMode.short && event.emit(pauseTimeToHideAllComponent);
469
+ screenMode === MultiCameraScreenMode.landscape && event.emit(pauseTimeToHideAllComponent);
468
470
  };
469
471
  const onDragEnd = data => {
470
- screenMode !== MultiCameraScreenMode.short && event.emit(startTimeToHideAllComponent);
472
+ screenMode === MultiCameraScreenMode.landscape && event.emit(startTimeToHideAllComponent);
471
473
  activeViewRef.current = activeViewRef.current === 0 ? 1 : 0;
472
474
  setStyle(prev => _objectSpread(_objectSpread({}, prev), {}, {
473
475
  positionLeft: data.positionLeft,
@@ -1,8 +1,9 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
- import { View, Text } from '@ray-js/ray';
2
+ import { View } from '@ray-js/ray';
3
3
  import clsx from 'clsx';
4
4
  import React from 'react';
5
5
  import { useMemoizedFn } from 'ahooks';
6
+ import { PlayerText as Text } from '../../renderer/text';
6
7
  import { useStore } from '../../ctx/store';
7
8
  import './index.less';
8
9
  /**
@@ -26,7 +27,7 @@ export const MultiPtz = props => {
26
27
  selectedLenInfo: multiCameraCtx.selectedLenInfo
27
28
  });
28
29
  const onPtz = useMemoizedFn(() => {
29
- multiCameraCtx.togglePtz();
30
+ multiCameraCtx.setPtzStatus(!ptzStatus);
30
31
  });
31
32
  if (!selectedLenInfo.supportPTZ && !selectedLenInfo.supportZoom) {
32
33
  return null;
@@ -1,6 +1,8 @@
1
1
  import React, { useMemo, useState } from 'react';
2
- import { View, CoverView, Text } from '@ray-js/ray';
2
+ import { View } from '@ray-js/ray';
3
3
  import clsx from 'clsx';
4
+ import { usePlayerOverlayHost } from '../../renderer/overlay';
5
+ import { PlayerText as Text } from '../../renderer/text';
4
6
  import { useStore } from '../../ctx/store';
5
7
  import { ptzMoveableTipId } from '../../ui/constant';
6
8
  import { PlayState } from '../../interface';
@@ -9,6 +11,7 @@ import { multiPrefix } from './constants';
9
11
  import { Storage } from '../../utils/storage';
10
12
  import './index.less';
11
13
  export const PtzMoveableTip = props => {
14
+ const OverlayView = usePlayerOverlayHost();
12
15
  const {
13
16
  devId,
14
17
  positionLeft = 24,
@@ -44,7 +47,7 @@ export const PtzMoveableTip = props => {
44
47
  storage.set(ptzMoveableTipId, true);
45
48
  };
46
49
  if (showTipModal && playState === PlayState.PLAYING) {
47
- return /*#__PURE__*/React.createElement(CoverView, null, /*#__PURE__*/React.createElement(View, {
50
+ return /*#__PURE__*/React.createElement(OverlayView, null, /*#__PURE__*/React.createElement(View, {
48
51
  className: clsx(`${multiPrefix}-tile-tip-content`, `${multiPrefix}-ptz-tip`),
49
52
  style: {
50
53
  left: positionInfo.content
@@ -1,6 +1,7 @@
1
- import { Text, View } from '@ray-js/ray';
1
+ import { View } from '@ray-js/ray';
2
2
  import clsx from 'clsx';
3
3
  import React, { useMemo } from 'react';
4
+ import { PlayerText as Text } from '../../renderer/text';
4
5
  import { useStore } from '../../ctx/store';
5
6
  import { MultiCameraLayoutStyle, MultiCameraScreenMode } from '../../interface';
6
7
  import { multiPrefix } from './constants';
@@ -1,9 +1,10 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
- import { View, Text } from '@ray-js/ray';
2
+ import { View } from '@ray-js/ray';
3
3
  import clsx from 'clsx';
4
4
  import React from 'react';
5
5
  import { useMemoizedFn } from 'ahooks';
6
6
  import Color from 'color';
7
+ import { PlayerText as Text } from '../../renderer/text';
7
8
  import { useStore } from '../../ctx/store';
8
9
  import { multiPrefix } from './constants';
9
10
  import './index.less';
@@ -27,7 +28,7 @@ export const TileMultiPtz = props => {
27
28
  });
28
29
  const lighterBrandColor = new Color(brandColor).alpha(0.2).hexa();
29
30
  const onPtz = useMemoizedFn(() => {
30
- multiCameraCtx.togglePtz();
31
+ multiCameraCtx.setPtzStatus(!ptzStatus);
31
32
  });
32
33
  if (!selectedLenInfo.supportPTZ && !selectedLenInfo.supportZoom) {
33
34
  return null;
@@ -1,6 +1,7 @@
1
- import { View, Text } from '@ray-js/ray';
1
+ import { View } from '@ray-js/ray';
2
2
  import React, { useMemo } from 'react';
3
3
  import clsx from 'clsx';
4
+ import { PlayerText as Text } from '../../renderer/text';
4
5
  import { MultiCameraLayoutStyle } from '../../interface';
5
6
  import { multiPrefix } from './constants';
6
7
  import { useStore } from '../../ctx/store';
@@ -1,6 +1,8 @@
1
1
  import React, { useState } from 'react';
2
- import { View, CoverView, Text } from '@ray-js/ray';
2
+ import { View } from '@ray-js/ray';
3
3
  import clsx from 'clsx';
4
+ import { usePlayerOverlayHost } from '../../renderer/overlay';
5
+ import { PlayerText as Text } from '../../renderer/text';
4
6
  import { useStore } from '../../ctx/store';
5
7
  import { tileTipId } from '../../ui/constant';
6
8
  import { PlayState } from '../../interface';
@@ -9,6 +11,7 @@ import { multiPrefix } from './constants';
9
11
  import { Storage } from '../../utils/storage';
10
12
  import './index.less';
11
13
  export const TileTip = props => {
14
+ const OverlayView = usePlayerOverlayHost();
12
15
  const {
13
16
  devId,
14
17
  deleteContent,
@@ -37,7 +40,7 @@ export const TileTip = props => {
37
40
  }
38
41
  };
39
42
  if (playState === PlayState.PLAYING) {
40
- return /*#__PURE__*/React.createElement(CoverView, null, /*#__PURE__*/React.createElement(View, {
43
+ return /*#__PURE__*/React.createElement(OverlayView, null, /*#__PURE__*/React.createElement(View, {
41
44
  className: clsx(`${multiPrefix}-tile-tip-content`, `${multiPrefix}-${showTipModal}`)
42
45
  }), /*#__PURE__*/React.createElement(Text, {
43
46
  className: clsx(`${multiPrefix}-tile-tip-text`, `${multiPrefix}-${showTipModal}`)
@@ -1,6 +1,7 @@
1
- import { View, Text } from '@ray-js/ray';
1
+ import { View } from '@ray-js/ray';
2
2
  import React, { useContext } from 'react';
3
3
  import clsx from 'clsx';
4
+ import { PlayerText as Text } from '../../renderer/text';
4
5
  import { useStore } from '../../ctx/store';
5
6
  import { UIEventContext } from '../../ui/context';
6
7
  import { widgetLabs, widgetClick, pauseTimeToHideAllComponent, startTimeToHideAllComponent } from '../../ui/constant';