@ray-js/ipc-player-integration 0.0.71-beta.0 → 0.0.72-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 (145) hide show
  1. package/README.md +0 -6
  2. package/lib/ctx/ctx.composition.d.ts +5 -1
  3. package/lib/ctx/ctx.composition.js +4 -1
  4. package/lib/ctx/ctx.js +17 -12
  5. package/lib/ctx/ctx.test.js +19 -54
  6. package/lib/features/initPlayerWidgets/index.d.ts +3 -0
  7. package/lib/features/initPlayerWidgets/index.js +4 -0
  8. package/lib/index.d.ts +0 -4
  9. package/lib/index.js +1 -3
  10. package/lib/interface.d.ts +1 -1
  11. package/lib/ui/bottomControlLayout.d.ts +11 -0
  12. package/lib/ui/bottomControlLayout.js +19 -0
  13. package/lib/ui/bottomControlLayout.test.js +64 -0
  14. package/lib/ui/bottomLeftContent.js +73 -180
  15. package/lib/ui/bottomLeftContent.test.js +138 -0
  16. package/lib/ui/bottomRightContent.d.ts +2 -2
  17. package/lib/ui/bottomRightContent.js +24 -16
  18. package/lib/ui/bottomRightContent.test.js +144 -0
  19. package/lib/ui/constant.d.ts +2 -0
  20. package/lib/ui/constant.js +4 -1
  21. package/lib/ui/topLeftContent.js +2 -4
  22. package/lib/ui/topRightContent.js +2 -4
  23. package/lib/ui/ui.d.ts +0 -5
  24. package/lib/ui/ui.js +33 -86
  25. package/lib/ui/ui.less +24 -59
  26. package/lib/widgets/battery/battery.js +5 -7
  27. package/lib/widgets/battery/batteryFull.js +5 -7
  28. package/lib/widgets/captureResult/captureResult.js +1 -2
  29. package/lib/widgets/floatWindow/floatWindow.d.ts +13 -0
  30. package/lib/widgets/floatWindow/floatWindow.js +93 -0
  31. package/lib/widgets/floatWindow/floatWindow.less +14 -0
  32. package/lib/widgets/floatWindow/floatWindow.test.d.ts +1 -0
  33. package/lib/widgets/floatWindow/floatWindow.test.js +164 -0
  34. package/lib/widgets/floatWindow/icon.d.ts +1 -0
  35. package/lib/widgets/floatWindow/icon.js +4 -0
  36. package/lib/widgets/floatWindow/index.d.ts +1 -0
  37. package/lib/widgets/floatWindow/index.js +1 -0
  38. package/lib/widgets/floodlight/floodlight.js +1 -2
  39. package/lib/widgets/flowLowTip/flowLowTip.js +1 -2
  40. package/lib/widgets/fullScreen/fullScreen.js +1 -2
  41. package/lib/widgets/fullScreen/fullTravelRouteControl.d.ts +1 -1
  42. package/lib/widgets/fullScreen/fullTravelRouteControl.js +1 -1
  43. package/lib/widgets/fullScreen/verticalScreen.js +1 -2
  44. package/lib/widgets/index.d.ts +1 -0
  45. package/lib/widgets/index.js +2 -1
  46. package/lib/widgets/moveInteractiveControl/controlButton.js +1 -2
  47. package/lib/widgets/moveInteractiveControl/moveInteractiveControlUI.js +5 -16
  48. package/lib/widgets/moveInteractiveControl/moveInteractiveControlUI.less +4 -24
  49. package/lib/widgets/multiCamera/landscapeTip.js +2 -8
  50. package/lib/widgets/multiCamera/moveablePtzControl.js +3 -5
  51. package/lib/widgets/multiCamera/multiPtz.js +1 -2
  52. package/lib/widgets/multiCamera/ptzMoveableTip.js +2 -8
  53. package/lib/widgets/multiCamera/switchLayout.js +1 -2
  54. package/lib/widgets/multiCamera/tileMultiPtz.js +1 -2
  55. package/lib/widgets/multiCamera/tileSwitchLayout.js +1 -2
  56. package/lib/widgets/multiCamera/tileTip.js +2 -8
  57. package/lib/widgets/muted/muted.js +1 -2
  58. package/lib/widgets/muted/muted.test.js +52 -66
  59. package/lib/widgets/ptz/ptz.js +1 -2
  60. package/lib/widgets/ptz/ptzControl.js +3 -4
  61. package/lib/widgets/ptzControlTip/ptzControlTip.js +4 -9
  62. package/lib/widgets/ptzControlTip/ptzControlTip.less +0 -6
  63. package/lib/widgets/realTimeMagnification/realTimeMagnification.js +1 -2
  64. package/lib/widgets/recordVideo/recordVideo.js +169 -47
  65. package/lib/widgets/recordVideo/recordVideo.lifecycle.test.js +2 -4
  66. package/lib/widgets/recordVideo/recordVideo.test.js +2 -169
  67. package/lib/widgets/resolution/fullResolutionControl.js +19 -29
  68. package/lib/widgets/resolution/resolution.js +2 -3
  69. package/lib/widgets/screenshot/screenshot.js +122 -48
  70. package/lib/widgets/screenshot/screenshot.test.js +113 -108
  71. package/lib/widgets/signal4G/signal4G.js +1 -4
  72. package/lib/widgets/siren/siren.js +1 -2
  73. package/lib/widgets/tempHumidity/tempHumidity.js +1 -2
  74. package/lib/widgets/toggleVerticalFull/toggleVerticalFull.js +1 -2
  75. package/lib/widgets/trialBadge/index.js +3 -8
  76. package/lib/widgets/trialBadge/index.less +0 -24
  77. package/lib/widgets/tryExperience/tryExperience.js +1 -2
  78. package/lib/widgets/videoBitKBP/videoBitKBP.js +1 -2
  79. package/lib/widgets/voiceIntercom/voiceIntercom.js +81 -57
  80. package/lib/widgets/voiceIntercom/voiceIntercom.less +0 -35
  81. package/lib/widgets/zoomTurntable/turntable/index.d.ts +7 -5
  82. package/lib/widgets/zoomTurntable/turntable/index.js +1 -3
  83. package/lib/widgets/zoomTurntable/zoomTurntableDock.d.ts +3 -5
  84. package/lib/widgets/zoomTurntable/zoomTurntableDock.js +4 -4
  85. package/lib/widgets/zoomTurntable/zoomTurntableEntry.js +19 -32
  86. package/lib/widgets/zoomTurntable/zoomTurntableTip.js +3 -17
  87. package/package.json +7 -15
  88. package/lib/ctx/intercom.test.js +0 -85
  89. package/lib/renderer/capabilities.d.ts +0 -8
  90. package/lib/renderer/capabilities.js +0 -19
  91. package/lib/renderer/context.d.ts +0 -5
  92. package/lib/renderer/context.js +0 -6
  93. package/lib/renderer/directionControl.d.ts +0 -6
  94. package/lib/renderer/directionControl.js +0 -3
  95. package/lib/renderer/font-manifest.json +0 -9
  96. package/lib/renderer/font.less +0 -5
  97. package/lib/renderer/glyphs.d.ts +0 -1
  98. package/lib/renderer/glyphs.js +0 -256
  99. package/lib/renderer/index.module.less +0 -48
  100. package/lib/renderer/overlay.d.ts +0 -6
  101. package/lib/renderer/overlay.js +0 -18
  102. package/lib/renderer/ptzZoom.d.ts +0 -6
  103. package/lib/renderer/ptzZoom.js +0 -3
  104. package/lib/renderer/text.d.ts +0 -4
  105. package/lib/renderer/text.js +0 -32
  106. package/lib/renderer/text.module.less +0 -4
  107. package/lib/renderer/viewport.d.ts +0 -7
  108. package/lib/renderer/viewport.js +0 -24
  109. package/lib/res/lynx-signal/index.d.ts +0 -1
  110. package/lib/res/lynx-signal/index.js +0 -22
  111. package/lib/res/lynx-signal/signalFour0.png +0 -0
  112. package/lib/res/lynx-signal/signalFour1.png +0 -0
  113. package/lib/res/lynx-signal/signalFour2.png +0 -0
  114. package/lib/res/lynx-signal/signalFour3.png +0 -0
  115. package/lib/res/lynx-signal/signalFour4.png +0 -0
  116. package/lib/res/lynx-signal/signalThree0.png +0 -0
  117. package/lib/res/lynx-signal/signalThree1.png +0 -0
  118. package/lib/res/lynx-signal/signalThree2.png +0 -0
  119. package/lib/res/lynx-signal/signalThree3.png +0 -0
  120. package/lib/res/player-charging.png +0 -0
  121. package/lib/res/player-more-arrow.png +0 -0
  122. package/lib/res/player-solar.png +0 -0
  123. package/lib/ui/scrollHintArrow.d.ts +0 -23
  124. package/lib/ui/scrollHintArrow.js +0 -83
  125. package/lib/widgets/battery/statusIcon.d.ts +0 -6
  126. package/lib/widgets/battery/statusIcon.js +0 -36
  127. package/lib/widgets/battery/statusIcon.less +0 -24
  128. package/lib/widgets/captureToast/captureToast.d.ts +0 -10
  129. package/lib/widgets/captureToast/captureToast.js +0 -58
  130. package/lib/widgets/recordVideo/recordVideoTimer.d.ts +0 -3
  131. package/lib/widgets/recordVideo/recordVideoTimer.js +0 -26
  132. package/lib/widgets/screenshot/screenshot.permissions.test.js +0 -137
  133. package/lib/widgets/voiceIntercom/voiceIntercom.test.js +0 -135
  134. package/lib/widgets/zoomTurntable/lynxDockLayout.d.ts +0 -6
  135. package/lib/widgets/zoomTurntable/lynxDockLayout.js +0 -30
  136. package/lib/widgets/zoomTurntable/turntable/lynx.d.ts +0 -5
  137. package/lib/widgets/zoomTurntable/turntable/lynx.js +0 -273
  138. package/lib/widgets/zoomTurntable/turntable/lynx.less +0 -9
  139. package/lib/widgets/zoomTurntable/turntable/lynxModel.d.ts +0 -37
  140. package/lib/widgets/zoomTurntable/turntable/lynxModel.js +0 -122
  141. package/lib/widgets/zoomTurntable/turntable/lynxPaint.d.ts +0 -3
  142. package/lib/widgets/zoomTurntable/turntable/lynxPaint.js +0 -36
  143. /package/lib/{ctx/intercom.test.d.ts → ui/bottomControlLayout.test.d.ts} +0 -0
  144. /package/lib/{widgets/screenshot/screenshot.permissions.test.d.ts → ui/bottomLeftContent.test.d.ts} +0 -0
  145. /package/lib/{widgets/voiceIntercom/voiceIntercom.test.d.ts → ui/bottomRightContent.test.d.ts} +0 -0
@@ -2,11 +2,8 @@ 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 } from '@ray-js/ray';
5
+ import { View, ScrollView, CoverView } 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';
10
7
  import './moveInteractiveControlUI.less';
11
8
  const defaultMenu = [{
12
9
  key: '0',
@@ -65,8 +62,6 @@ const defaultCSSVariable = {
65
62
  '--activeColor': '#FF592A'
66
63
  };
67
64
  export function MoveInterActiveControlUI(props) {
68
- const OverlayView = usePlayerOverlayHost();
69
- const isLynx = usePlayerRenderMode() === 'lynx';
70
65
  const {
71
66
  contentClsName,
72
67
  wrapClsName,
@@ -80,22 +75,18 @@ export function MoveInterActiveControlUI(props) {
80
75
  e.origin.stopPropagation();
81
76
  onClick && onClick(item.key);
82
77
  };
83
- const WrapComponent = coverView ? OverlayView : View;
78
+ const WrapComponent = coverView ? CoverView : View;
84
79
  return /*#__PURE__*/React.createElement(WrapComponent
85
80
  // @ts-ignore
86
81
  , {
87
82
  style: _objectSpread({}, CSSVariable),
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
- })
83
+ className: clsx('ipc-player-plugin-active-control-wrap', wrapClsName)
92
84
  }, /*#__PURE__*/React.createElement(View, {
93
85
  className: clsx('ipc-player-plugin-active-control-title')
94
86
  }, I18n.t('homeFeatureInteractiveMenuTitle')), /*#__PURE__*/React.createElement(ScrollView, {
95
87
  style: {
96
88
  flex: 1
97
89
  },
98
- className: isLynx ? 'ipc-player-plugin-active-control-scroll-lynx' : undefined,
99
90
  scrollY: true
100
91
  }, /*#__PURE__*/React.createElement(View, {
101
92
  className: clsx('ipc-player-plugin-active-control', contentClsName)
@@ -107,11 +98,9 @@ export function MoveInterActiveControlUI(props) {
107
98
  })
108
99
  }, /*#__PURE__*/React.createElement(View, {
109
100
  className: clsx('ipc-player-plugin-active-control-item-icon')
110
- }, !isLynx && /*#__PURE__*/React.createElement(View, {
101
+ }, /*#__PURE__*/React.createElement(View, {
111
102
  className: clsx('ipc-player-plugin-active-control-item-icon-mask')
112
- }), isLynx ? /*#__PURE__*/React.createElement(PlayerText, {
113
- className: clsx('icon-panel', item.iconName, 'ipc-player-plugin-interactive-icon')
114
- }) : /*#__PURE__*/React.createElement(View, {
103
+ }), /*#__PURE__*/React.createElement(View, {
115
104
  className: clsx('icon-panel', item.iconName, 'ipc-player-plugin-interactive-icon')
116
105
  })), /*#__PURE__*/React.createElement(View, {
117
106
  className: clsx('ipc-player-plugin-active-control-item-title')
@@ -43,6 +43,8 @@
43
43
  }
44
44
  }
45
45
  .ipc-player-plugin-active-control-item-icon {
46
+ position: relative;
47
+ z-index: 1;
46
48
  width: calc(42px * var(--ipc-player-size-scale, 1));
47
49
  height: calc(42px * var(--ipc-player-size-scale, 1));
48
50
  border-radius: calc(42px * var(--ipc-player-size-scale, 1));
@@ -52,6 +54,7 @@
52
54
  justify-content: center;
53
55
  font-size: calc(16px * var(--ipc-player-size-scale, 1));
54
56
  color: var(--color);
57
+ overflow: hidden;
55
58
  .ipc-player-plugin-active-control-item-icon-mask {
56
59
  position: absolute;
57
60
  width: 100%;
@@ -61,14 +64,6 @@
61
64
  opacity: 1;
62
65
  }
63
66
  }
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
- }
72
67
  .ipc-player-plugin-active-control-item-title {
73
68
  width: calc(70px * var(--ipc-player-size-scale, 1));
74
69
  white-space: nowrap; /* 防止文本换行 */
@@ -78,19 +73,4 @@
78
73
  }
79
74
  .ipc-player-plugin-interactive-icon {
80
75
  font-size: calc(20px * var(--ipc-player-size-scale, 1));;
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
- }
76
+ }
@@ -1,8 +1,6 @@
1
1
  import React, { useState } from 'react';
2
- import { View } from '@ray-js/ray';
2
+ import { View, CoverView, Text } from '@ray-js/ray';
3
3
  import clsx from 'clsx';
4
- import { usePlayerOverlayHost, usePlayerOverlayFillStyle } from '../../renderer/overlay';
5
- import { PlayerText as Text } from '../../renderer/text';
6
4
  import { useStore } from '../../ctx/store';
7
5
  import { landscapeTipId } from '../../ui/constant';
8
6
  import { PlayState } from '../../interface';
@@ -11,8 +9,6 @@ import { multiPrefix } from './constants';
11
9
  import { Storage } from '../../utils/storage';
12
10
  import './index.less';
13
11
  export const LandscapeTip = props => {
14
- const OverlayView = usePlayerOverlayHost();
15
- const overlayStyle = usePlayerOverlayFillStyle();
16
12
  const {
17
13
  devId,
18
14
  deleteContent
@@ -31,9 +27,7 @@ export const LandscapeTip = props => {
31
27
  storage.set(landscapeTipId, true);
32
28
  };
33
29
  if (showTipModal && playState === PlayState.PLAYING) {
34
- return /*#__PURE__*/React.createElement(OverlayView, {
35
- style: overlayStyle
36
- }, /*#__PURE__*/React.createElement(View, {
30
+ return /*#__PURE__*/React.createElement(CoverView, null, /*#__PURE__*/React.createElement(View, {
37
31
  className: clsx(`${multiPrefix}-tile-tip-content`, `${multiPrefix}-landscape-tip`)
38
32
  }), /*#__PURE__*/React.createElement(Text, {
39
33
  className: clsx(`${multiPrefix}-tile-tip-text`, `${multiPrefix}-landscape-tip`)
@@ -2,13 +2,12 @@ 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 { View } from '@ray-js/ray';
5
+ import { CoverView, 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 { usePlayerOverlayHost } from '../../renderer/overlay';
11
- import IpcPtzZoom from '../../renderer/ptzZoom';
10
+ import IpcPtzZoom from '@ray-js/ipc-ptz-zoom';
12
11
  import { useStore } from '../../ctx/store';
13
12
  import { useMemoizedFn } from '../../hooks';
14
13
  import { MultiCameraScreenMode } from '../../interface';
@@ -60,7 +59,6 @@ const getZoomData = devId => {
60
59
  * 可移动的 PTZ 控制器,目前仅在多目使用
61
60
  */
62
61
  export const MoveablePtzControlItem = props => {
63
- const OverlayView = usePlayerOverlayHost();
64
62
  const {
65
63
  devId,
66
64
  multiCameraCtx,
@@ -319,7 +317,7 @@ export const MoveablePtzControlItem = props => {
319
317
  }, 1000);
320
318
  }
321
319
  });
322
- return /*#__PURE__*/React.createElement(OverlayView, {
320
+ return /*#__PURE__*/React.createElement(CoverView, {
323
321
  style: {
324
322
  position: 'absolute',
325
323
  zIndex: 89,
@@ -1,9 +1,8 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
- import { View } from '@ray-js/ray';
2
+ import { View, Text } 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';
7
6
  import { useStore } from '../../ctx/store';
8
7
  import './index.less';
9
8
  /**
@@ -1,8 +1,6 @@
1
1
  import React, { useMemo, useState } from 'react';
2
- import { View } from '@ray-js/ray';
2
+ import { View, CoverView, Text } from '@ray-js/ray';
3
3
  import clsx from 'clsx';
4
- import { usePlayerOverlayHost, usePlayerOverlayFillStyle } from '../../renderer/overlay';
5
- import { PlayerText as Text } from '../../renderer/text';
6
4
  import { useStore } from '../../ctx/store';
7
5
  import { ptzMoveableTipId } from '../../ui/constant';
8
6
  import { PlayState } from '../../interface';
@@ -11,8 +9,6 @@ import { multiPrefix } from './constants';
11
9
  import { Storage } from '../../utils/storage';
12
10
  import './index.less';
13
11
  export const PtzMoveableTip = props => {
14
- const OverlayView = usePlayerOverlayHost();
15
- const overlayStyle = usePlayerOverlayFillStyle();
16
12
  const {
17
13
  devId,
18
14
  positionLeft = 24,
@@ -48,9 +44,7 @@ export const PtzMoveableTip = props => {
48
44
  storage.set(ptzMoveableTipId, true);
49
45
  };
50
46
  if (showTipModal && playState === PlayState.PLAYING) {
51
- return /*#__PURE__*/React.createElement(OverlayView, {
52
- style: overlayStyle
53
- }, /*#__PURE__*/React.createElement(View, {
47
+ return /*#__PURE__*/React.createElement(CoverView, null, /*#__PURE__*/React.createElement(View, {
54
48
  className: clsx(`${multiPrefix}-tile-tip-content`, `${multiPrefix}-ptz-tip`),
55
49
  style: {
56
50
  left: positionInfo.content
@@ -1,7 +1,6 @@
1
- import { View } from '@ray-js/ray';
1
+ import { Text, 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';
5
4
  import { useStore } from '../../ctx/store';
6
5
  import { MultiCameraLayoutStyle, MultiCameraScreenMode } from '../../interface';
7
6
  import { multiPrefix } from './constants';
@@ -1,10 +1,9 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
- import { View } from '@ray-js/ray';
2
+ import { View, Text } 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';
8
7
  import { useStore } from '../../ctx/store';
9
8
  import { multiPrefix } from './constants';
10
9
  import './index.less';
@@ -1,7 +1,6 @@
1
- import { View } from '@ray-js/ray';
1
+ import { View, Text } 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';
5
4
  import { MultiCameraLayoutStyle } from '../../interface';
6
5
  import { multiPrefix } from './constants';
7
6
  import { useStore } from '../../ctx/store';
@@ -1,8 +1,6 @@
1
1
  import React, { useState } from 'react';
2
- import { View } from '@ray-js/ray';
2
+ import { View, CoverView, Text } from '@ray-js/ray';
3
3
  import clsx from 'clsx';
4
- import { usePlayerOverlayHost, usePlayerOverlayFillStyle } from '../../renderer/overlay';
5
- import { PlayerText as Text } from '../../renderer/text';
6
4
  import { useStore } from '../../ctx/store';
7
5
  import { tileTipId } from '../../ui/constant';
8
6
  import { PlayState } from '../../interface';
@@ -11,8 +9,6 @@ import { multiPrefix } from './constants';
11
9
  import { Storage } from '../../utils/storage';
12
10
  import './index.less';
13
11
  export const TileTip = props => {
14
- const OverlayView = usePlayerOverlayHost();
15
- const overlayStyle = usePlayerOverlayFillStyle();
16
12
  const {
17
13
  devId,
18
14
  deleteContent,
@@ -41,9 +37,7 @@ export const TileTip = props => {
41
37
  }
42
38
  };
43
39
  if (playState === PlayState.PLAYING) {
44
- return /*#__PURE__*/React.createElement(OverlayView, {
45
- style: overlayStyle
46
- }, /*#__PURE__*/React.createElement(View, {
40
+ return /*#__PURE__*/React.createElement(CoverView, null, /*#__PURE__*/React.createElement(View, {
47
41
  className: clsx(`${multiPrefix}-tile-tip-content`, `${multiPrefix}-${showTipModal}`)
48
42
  }), /*#__PURE__*/React.createElement(Text, {
49
43
  className: clsx(`${multiPrefix}-tile-tip-text`, `${multiPrefix}-${showTipModal}`)
@@ -1,7 +1,6 @@
1
- import { View } from '@ray-js/ray';
1
+ import { View, Text } 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';
5
4
  import { useStore } from '../../ctx/store';
6
5
  import { UIEventContext } from '../../ui/context';
7
6
  import { widgetLabs, widgetClick, pauseTimeToHideAllComponent, startTimeToHideAllComponent } from '../../ui/constant';
@@ -1,7 +1,5 @@
1
- import React from 'react';
2
- import { act, renderHook as renderPlayerHook } from '@testing-library/react-hooks/dom';
1
+ import { act, renderHook } from '@testing-library/react-hooks/dom';
3
2
  import { atom, getDefaultStore } from 'jotai';
4
- import { PlayerRenderModeContext } from '../../renderer/context';
5
3
  import { IntercomMode } from '../../interface';
6
4
  import { Muted } from './muted';
7
5
  jest.mock('@ray-js/ray', () => ({
@@ -29,67 +27,55 @@ const createProps = function () {
29
27
  }
30
28
  };
31
29
  };
32
- describe.each(['webview', 'lynx'])('%s speaker interactions', renderMode => {
33
- const renderHook = callback => renderPlayerHook(callback, {
34
- wrapper: _ref => {
35
- let {
36
- children
37
- } = _ref;
38
- return /*#__PURE__*/React.createElement(PlayerRenderModeContext.Provider, {
39
- value: renderMode
40
- }, children);
41
- }
42
- });
43
- it.each([[IntercomMode.OneWay, true], [IntercomMode.OneWay, false], [IntercomMode.TwoWay, true], [IntercomMode.TwoWay, false]])('blocks speaker changes and control events during talk in mode=%s, muted=%s', (mode, muted) => {
44
- const props = createProps(true, mode, muted);
45
- const {
46
- result,
47
- unmount
48
- } = renderHook(() => Muted(props));
49
- act(() => result.current.props.onClick());
50
- expect(props.setMute).not.toHaveBeenCalled();
51
- expect(props.event.emit).not.toHaveBeenCalled();
52
- expect(result.current.props.className).toContain('ipc-player-plugin-muted-disabled');
53
- unmount();
54
- });
55
- it.each([[false, IntercomMode.OneWay, true, false], [false, IntercomMode.OneWay, false, true], [false, IntercomMode.TwoWay, true, false], [false, IntercomMode.TwoWay, false, true]])('keeps speaker switching when talking=%s, mode=%s, muted=%s', (talking, mode, muted, target) => {
56
- const props = createProps(talking, mode, muted);
57
- const {
58
- result,
59
- unmount
60
- } = renderHook(() => Muted(props));
61
- act(() => result.current.props.onClick());
62
- expect(props.setMute).toHaveBeenCalledTimes(1);
63
- expect(props.setMute).toHaveBeenCalledWith(target);
64
- expect(result.current.props.className).not.toContain('ipc-player-plugin-muted-disabled');
65
- unmount();
66
- });
67
- it.each([IntercomMode.OneWay, IntercomMode.TwoWay])('uses shared talk state after remount and unlocks when talk ends in mode=%s', mode => {
68
- const props = createProps(false, mode);
69
- const store = getDefaultStore();
70
- const first = renderHook(() => Muted(props));
71
- act(() => store.set(props.intercom, true));
72
- act(() => first.result.current.props.onClick());
73
- expect(props.setMute).not.toHaveBeenCalled();
74
- first.unmount();
75
- const second = renderHook(() => Muted(props));
76
- act(() => second.result.current.props.onClick());
77
- expect(props.setMute).not.toHaveBeenCalled();
78
- act(() => store.set(props.intercom, false));
79
- act(() => second.result.current.props.onClick());
80
- expect(props.setMute).toHaveBeenCalledWith(false);
81
- second.unmount();
82
- });
83
- it.each([[IntercomMode.OneWay, IntercomMode.TwoWay], [IntercomMode.TwoWay, IntercomMode.OneWay]])('keeps the speaker locked when active talk changes from %s to %s', (mode, nextMode) => {
84
- const props = createProps(true, mode);
85
- const {
86
- result,
87
- unmount
88
- } = renderHook(() => Muted(props));
89
- act(() => getDefaultStore().set(props.intercomMode, nextMode));
90
- act(() => result.current.props.onClick());
91
- expect(props.setMute).not.toHaveBeenCalled();
92
- expect(props.event.emit).not.toHaveBeenCalled();
93
- unmount();
94
- });
30
+ it.each([[IntercomMode.OneWay, true], [IntercomMode.OneWay, false], [IntercomMode.TwoWay, true], [IntercomMode.TwoWay, false]])('blocks speaker changes and control events during talk in mode=%s, muted=%s', (mode, muted) => {
31
+ const props = createProps(true, mode, muted);
32
+ const {
33
+ result,
34
+ unmount
35
+ } = renderHook(() => Muted(props));
36
+ act(() => result.current.props.onClick());
37
+ expect(props.setMute).not.toHaveBeenCalled();
38
+ expect(props.event.emit).not.toHaveBeenCalled();
39
+ expect(result.current.props.className).toContain('ipc-player-plugin-muted-disabled');
40
+ unmount();
41
+ });
42
+ it.each([[false, IntercomMode.OneWay, true, false], [false, IntercomMode.OneWay, false, true], [false, IntercomMode.TwoWay, true, false], [false, IntercomMode.TwoWay, false, true]])('keeps speaker switching when talking=%s, mode=%s, muted=%s', (talking, mode, muted, target) => {
43
+ const props = createProps(talking, mode, muted);
44
+ const {
45
+ result,
46
+ unmount
47
+ } = renderHook(() => Muted(props));
48
+ act(() => result.current.props.onClick());
49
+ expect(props.setMute).toHaveBeenCalledTimes(1);
50
+ expect(props.setMute).toHaveBeenCalledWith(target);
51
+ expect(result.current.props.className).not.toContain('ipc-player-plugin-muted-disabled');
52
+ unmount();
53
+ });
54
+ it.each([IntercomMode.OneWay, IntercomMode.TwoWay])('uses shared talk state after remount and unlocks when talk ends in mode=%s', mode => {
55
+ const props = createProps(false, mode);
56
+ const store = getDefaultStore();
57
+ const first = renderHook(() => Muted(props));
58
+ act(() => store.set(props.intercom, true));
59
+ act(() => first.result.current.props.onClick());
60
+ expect(props.setMute).not.toHaveBeenCalled();
61
+ first.unmount();
62
+ const second = renderHook(() => Muted(props));
63
+ act(() => second.result.current.props.onClick());
64
+ expect(props.setMute).not.toHaveBeenCalled();
65
+ act(() => store.set(props.intercom, false));
66
+ act(() => second.result.current.props.onClick());
67
+ expect(props.setMute).toHaveBeenCalledWith(false);
68
+ second.unmount();
69
+ });
70
+ it.each([[IntercomMode.OneWay, IntercomMode.TwoWay], [IntercomMode.TwoWay, IntercomMode.OneWay]])('keeps the speaker locked when active talk changes from %s to %s', (mode, nextMode) => {
71
+ const props = createProps(true, mode);
72
+ const {
73
+ result,
74
+ unmount
75
+ } = renderHook(() => Muted(props));
76
+ act(() => getDefaultStore().set(props.intercomMode, nextMode));
77
+ act(() => result.current.props.onClick());
78
+ expect(props.setMute).not.toHaveBeenCalled();
79
+ expect(props.event.emit).not.toHaveBeenCalled();
80
+ unmount();
95
81
  });
@@ -1,9 +1,8 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
- import { View } from '@ray-js/ray';
2
+ import { View, Text } from '@ray-js/ray';
3
3
  import clsx from 'clsx';
4
4
  import React, { useEffect, useState, useContext } from 'react';
5
5
  import { useMemoizedFn } from 'ahooks';
6
- import { PlayerText as Text } from '../../renderer/text';
7
6
  import { UIEventContext } from '../../ui/context';
8
7
  import { usePtz } from '../../hooks';
9
8
  import { useStore } from '../../ctx/store';
@@ -1,11 +1,11 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
2
  import React, { useContext, useEffect, useRef, useState } from 'react';
3
+ import { CoverView } from '@ray-js/ray';
3
4
  import clsx from 'clsx';
4
5
  import _find from 'lodash/find';
5
6
  import _get from 'lodash/get';
7
+ import IpcPtzZoom from '@ray-js/ipc-ptz-zoom';
6
8
  import { getDpIdByCode, publishDps } from '@ray-js/ray-ipc-utils';
7
- import { usePlayerOverlayHost } from '../../renderer/overlay';
8
- import IpcPtzZoom from '../../renderer/ptzZoom';
9
9
  import { Storage } from '../../utils/storage';
10
10
  import { useMemoizedFn } from '../../hooks';
11
11
  import { useComponentHideState } from '../../ui/hooks';
@@ -39,7 +39,6 @@ const getPtzData = devId => {
39
39
  }];
40
40
  };
41
41
  export const PtzControl = props => {
42
- const OverlayView = usePlayerOverlayHost();
43
42
  const {
44
43
  devId,
45
44
  addContent
@@ -135,7 +134,7 @@ export const PtzControl = props => {
135
134
  ptzTimeId.current = null;
136
135
  }
137
136
  };
138
- return /*#__PURE__*/React.createElement(OverlayView, {
137
+ return /*#__PURE__*/React.createElement(CoverView, {
139
138
  className: clsx('ipc-player-plugin-full-screen-ptz-control', {
140
139
  'ipc-player-plugin-full-screen-ptz-control-hide': !isPtzActive || shouldHide,
141
140
  'ipc-player-plugin-full-screen-ptz-disappear': screenType === 'vertical'
@@ -1,9 +1,6 @@
1
1
  import React, { useState } from 'react';
2
- import { View, Image, setStorage } from '@ray-js/ray';
2
+ import { View, Image, CoverView, Text, setStorage } from '@ray-js/ray';
3
3
  import clsx from 'clsx';
4
- import { usePlayerOverlayHost } from '../../renderer/overlay';
5
- import { PlayerText as Text } from '../../renderer/text';
6
- import { usePlayerRenderMode } from '../../renderer/context';
7
4
  import { useStore } from '../../ctx/store';
8
5
  import { ptzControlTipId, widgetLabs, widgetClick } from '../../ui/constant';
9
6
  import { PlayState } from '../../interface';
@@ -11,12 +8,10 @@ import './ptzControlTip.less';
11
8
  import { playerPtzControlTip } from '../../res';
12
9
  import Strings from '../../i18n';
13
10
  export const PtzControlTip = props => {
14
- const OverlayView = usePlayerOverlayHost();
15
11
  const {
16
12
  devId,
17
13
  deleteContent
18
14
  } = props;
19
- const isLynx = usePlayerRenderMode() === 'lynx';
20
15
  const [showTipModal, setShowTipModal] = useState(true);
21
16
  const {
22
17
  playState
@@ -36,12 +31,12 @@ export const PtzControlTip = props => {
36
31
  });
37
32
  };
38
33
  if (showTipModal && playState === PlayState.PLAYING) {
39
- return /*#__PURE__*/React.createElement(OverlayView, {
34
+ return /*#__PURE__*/React.createElement(CoverView, {
40
35
  className: clsx('playerControlTipContainer')
41
36
  }, /*#__PURE__*/React.createElement(Image, {
42
- mode: isLynx ? 'aspectFit' : 'widthFix',
37
+ mode: "widthFix",
43
38
  src: playerPtzControlTip,
44
- className: clsx('controlTipImage', isLynx && 'controlTipImageLynx')
39
+ className: clsx('controlTipImage')
45
40
  }), /*#__PURE__*/React.createElement(Text, {
46
41
  className: clsx('controlTipText')
47
42
  }, Strings.getLang('ipc_player_ptz_control_tip')), /*#__PURE__*/React.createElement(View, {
@@ -39,9 +39,3 @@
39
39
  color: #ffffff;
40
40
  }
41
41
  }
42
-
43
- // Original PNG is 404 x 158. Lynx needs both dimensions; widthFix is WebView-only.
44
- .playerControlTipContainer .controlTipImageLynx {
45
- height: calc(66.4851485149px * var(--ipc-player-size-scale, 1));
46
- flex-shrink: 0;
47
- }
@@ -1,7 +1,6 @@
1
1
  import React, { useCallback, useEffect, useMemo, useState } from 'react';
2
- import { View } from '@ray-js/ray';
2
+ import { View, Text } from '@ray-js/ray';
3
3
  import clsx from 'clsx';
4
- import { PlayerText as Text } from '../../renderer/text';
5
4
  import { PlayState } from '../../interface';
6
5
  import { useStore } from '../../ctx/store';
7
6
  import { useDpSupport } from '../../hooks/useDpSupport';