@ray-js/ipc-player-integration 0.0.66-beta.0 → 0.0.67-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 (141) hide show
  1. package/README.md +0 -6
  2. package/lib/ctx/ctx.album.test.d.ts +1 -0
  3. package/lib/ctx/ctx.album.test.js +197 -0
  4. package/lib/ctx/ctx.composition.js +13 -3
  5. package/lib/ctx/ctx.js +46 -35
  6. package/lib/ctx/multiCameraCtx.d.ts +2 -0
  7. package/lib/ctx/multiCameraCtx.js +17 -1
  8. package/lib/ctx/multiCameraCtx.test.d.ts +1 -0
  9. package/lib/ctx/multiCameraCtx.test.js +65 -0
  10. package/lib/i18n/index.d.ts +12 -0
  11. package/lib/i18n/strings.d.ts +6 -0
  12. package/lib/i18n/strings.js +6 -0
  13. package/lib/index.d.ts +0 -4
  14. package/lib/index.js +1 -3
  15. package/lib/interface.d.ts +17 -3
  16. package/lib/ui/absoluteContent.d.ts +2 -0
  17. package/lib/ui/absoluteContent.js +3 -0
  18. package/lib/ui/bottomLeftContent.js +55 -119
  19. package/lib/ui/bottomRightContent.js +3 -6
  20. package/lib/ui/ui.d.ts +0 -5
  21. package/lib/ui/ui.js +98 -89
  22. package/lib/utils/captureResult.d.ts +12 -0
  23. package/lib/utils/captureResult.js +70 -0
  24. package/lib/utils/captureResult.test.d.ts +1 -0
  25. package/lib/utils/captureResult.test.js +223 -0
  26. package/lib/utils/fullLinkTracking.d.ts +5 -0
  27. package/lib/utils/fullLinkTracking.js +71 -0
  28. package/lib/utils/navigation.d.ts +2 -1
  29. package/lib/utils/navigation.js +13 -3
  30. package/lib/widgets/battery/battery.js +5 -7
  31. package/lib/widgets/battery/batteryFull.js +5 -7
  32. package/lib/widgets/captureResult/captureResult.d.ts +16 -0
  33. package/lib/widgets/captureResult/captureResult.js +85 -0
  34. package/lib/widgets/captureResult/captureResult.less +144 -0
  35. package/lib/widgets/captureResult/captureResult.test.d.ts +1 -0
  36. package/lib/widgets/captureResult/captureResult.test.js +84 -0
  37. package/lib/widgets/captureResult/index.d.ts +2 -0
  38. package/lib/widgets/captureResult/index.js +2 -0
  39. package/lib/widgets/floodlight/floodlight.js +1 -2
  40. package/lib/widgets/flowLowTip/flowLowTip.js +1 -2
  41. package/lib/widgets/fullScreen/fullScreen.js +4 -18
  42. package/lib/widgets/fullScreen/fullTravelRouteControl.d.ts +1 -1
  43. package/lib/widgets/fullScreen/fullTravelRouteControl.js +1 -1
  44. package/lib/widgets/fullScreen/verticalScreen.js +1 -2
  45. package/lib/widgets/index.d.ts +1 -0
  46. package/lib/widgets/index.js +2 -1
  47. package/lib/widgets/moveInteractiveControl/controlButton.js +1 -2
  48. package/lib/widgets/moveInteractiveControl/moveInteractiveControlUI.js +3 -12
  49. package/lib/widgets/moveInteractiveControl/moveInteractiveControlUI.less +4 -24
  50. package/lib/widgets/multiCamera/index.less +1 -0
  51. package/lib/widgets/multiCamera/landscapeTip.js +1 -2
  52. package/lib/widgets/multiCamera/moveablePtzControl.js +5 -5
  53. package/lib/widgets/multiCamera/multiPtz.js +2 -3
  54. package/lib/widgets/multiCamera/ptzMoveableTip.js +1 -2
  55. package/lib/widgets/multiCamera/switchLayout.js +1 -2
  56. package/lib/widgets/multiCamera/tileMultiPtz.js +2 -3
  57. package/lib/widgets/multiCamera/tileSwitchLayout.js +1 -2
  58. package/lib/widgets/multiCamera/tileTip.js +1 -2
  59. package/lib/widgets/muted/muted.js +1 -2
  60. package/lib/widgets/muted/muted.test.js +52 -66
  61. package/lib/widgets/ptz/ptz.js +1 -2
  62. package/lib/widgets/ptz/ptzControl.js +1 -1
  63. package/lib/widgets/ptzControlTip/ptzControlTip.js +3 -6
  64. package/lib/widgets/ptzControlTip/ptzControlTip.less +0 -6
  65. package/lib/widgets/realTimeMagnification/realTimeMagnification.js +1 -2
  66. package/lib/widgets/recordVideo/recordVideo.js +58 -54
  67. package/lib/widgets/recordVideo/recordVideo.less +17 -74
  68. package/lib/widgets/recordVideo/recordVideo.lifecycle.test.d.ts +1 -0
  69. package/lib/widgets/recordVideo/recordVideo.lifecycle.test.js +106 -0
  70. package/lib/widgets/recordVideo/recordVideo.test.js +1 -0
  71. package/lib/widgets/resolution/fullResolutionControl.js +19 -29
  72. package/lib/widgets/resolution/resolution.js +2 -3
  73. package/lib/widgets/screenshot/screenshot.js +67 -45
  74. package/lib/widgets/screenshot/screenshot.less +1 -40
  75. package/lib/widgets/screenshot/screenshot.test.d.ts +1 -0
  76. package/lib/widgets/screenshot/screenshot.test.js +135 -0
  77. package/lib/widgets/signal4G/signal4G.js +1 -4
  78. package/lib/widgets/siren/siren.js +1 -2
  79. package/lib/widgets/tempHumidity/tempHumidity.js +1 -2
  80. package/lib/widgets/toggleVerticalFull/toggleVerticalFull.js +1 -2
  81. package/lib/widgets/trialBadge/index.d.ts +2 -1
  82. package/lib/widgets/trialBadge/index.js +20 -17
  83. package/lib/widgets/trialBadge/index.less +0 -24
  84. package/lib/widgets/trialBadge/useTrialBadge.d.ts +3 -2
  85. package/lib/widgets/trialBadge/useTrialBadge.js +13 -2
  86. package/lib/widgets/tryExperience/tryExperience.js +1 -2
  87. package/lib/widgets/videoBitKBP/videoBitKBP.js +1 -2
  88. package/lib/widgets/voiceIntercom/voiceIntercom.js +24 -50
  89. package/lib/widgets/voiceIntercom/voiceIntercom.less +0 -16
  90. package/lib/widgets/zoomTurntable/turntable/index.d.ts +7 -5
  91. package/lib/widgets/zoomTurntable/turntable/index.js +1 -3
  92. package/lib/widgets/zoomTurntable/zoomTurntableDock.d.ts +0 -2
  93. package/lib/widgets/zoomTurntable/zoomTurntableDock.js +1 -1
  94. package/lib/widgets/zoomTurntable/zoomTurntableEntry.js +18 -31
  95. package/lib/widgets/zoomTurntable/zoomTurntableTip.js +3 -23
  96. package/package.json +7 -15
  97. package/lib/renderer/capabilities.d.ts +0 -8
  98. package/lib/renderer/capabilities.js +0 -19
  99. package/lib/renderer/context.d.ts +0 -5
  100. package/lib/renderer/context.js +0 -6
  101. package/lib/renderer/directionControl.d.ts +0 -6
  102. package/lib/renderer/directionControl.js +0 -3
  103. package/lib/renderer/font.less +0 -5
  104. package/lib/renderer/glyphs.d.ts +0 -1
  105. package/lib/renderer/glyphs.js +0 -256
  106. package/lib/renderer/index.module.less +0 -48
  107. package/lib/renderer/ptzZoom.d.ts +0 -6
  108. package/lib/renderer/ptzZoom.js +0 -3
  109. package/lib/renderer/text.d.ts +0 -4
  110. package/lib/renderer/text.js +0 -32
  111. package/lib/renderer/text.module.less +0 -4
  112. package/lib/renderer/viewport.d.ts +0 -7
  113. package/lib/renderer/viewport.js +0 -24
  114. package/lib/res/lynx-signal/index.d.ts +0 -1
  115. package/lib/res/lynx-signal/index.js +0 -22
  116. package/lib/res/lynx-signal/signalFour0.png +0 -0
  117. package/lib/res/lynx-signal/signalFour1.png +0 -0
  118. package/lib/res/lynx-signal/signalFour2.png +0 -0
  119. package/lib/res/lynx-signal/signalFour3.png +0 -0
  120. package/lib/res/lynx-signal/signalFour4.png +0 -0
  121. package/lib/res/lynx-signal/signalThree0.png +0 -0
  122. package/lib/res/lynx-signal/signalThree1.png +0 -0
  123. package/lib/res/lynx-signal/signalThree2.png +0 -0
  124. package/lib/res/lynx-signal/signalThree3.png +0 -0
  125. package/lib/res/player-charging.png +0 -0
  126. package/lib/res/player-more-arrow.png +0 -0
  127. package/lib/res/player-solar.png +0 -0
  128. package/lib/ui/scrollHintArrow.d.ts +0 -23
  129. package/lib/ui/scrollHintArrow.js +0 -82
  130. package/lib/widgets/battery/statusIcon.d.ts +0 -6
  131. package/lib/widgets/battery/statusIcon.js +0 -36
  132. package/lib/widgets/battery/statusIcon.less +0 -24
  133. package/lib/widgets/zoomTurntable/lynxDockLayout.d.ts +0 -6
  134. package/lib/widgets/zoomTurntable/lynxDockLayout.js +0 -30
  135. package/lib/widgets/zoomTurntable/turntable/lynx.d.ts +0 -5
  136. package/lib/widgets/zoomTurntable/turntable/lynx.js +0 -273
  137. package/lib/widgets/zoomTurntable/turntable/lynx.less +0 -9
  138. package/lib/widgets/zoomTurntable/turntable/lynxModel.d.ts +0 -37
  139. package/lib/widgets/zoomTurntable/turntable/lynxModel.js +0 -122
  140. package/lib/widgets/zoomTurntable/turntable/lynxPaint.d.ts +0 -3
  141. package/lib/widgets/zoomTurntable/turntable/lynxPaint.js +0 -36
@@ -0,0 +1,84 @@
1
+ import React from 'react';
2
+ import { renderToStaticMarkup } from 'react-dom/server';
3
+ jest.mock('@ray-js/ray', () => {
4
+ const React = require('react');
5
+ return {
6
+ Image: _ref => {
7
+ let {
8
+ className,
9
+ src
10
+ } = _ref;
11
+ return /*#__PURE__*/React.createElement("img", {
12
+ alt: "",
13
+ className: className,
14
+ src: src
15
+ });
16
+ },
17
+ Text: _ref2 => {
18
+ let {
19
+ children,
20
+ className
21
+ } = _ref2;
22
+ return /*#__PURE__*/React.createElement("span", {
23
+ className: className
24
+ }, children);
25
+ },
26
+ View: _ref3 => {
27
+ let {
28
+ children,
29
+ className
30
+ } = _ref3;
31
+ return /*#__PURE__*/React.createElement("div", {
32
+ className: className
33
+ }, children);
34
+ }
35
+ };
36
+ });
37
+ jest.mock('../../i18n', () => ({
38
+ __esModule: true,
39
+ default: {
40
+ getLang: key => key,
41
+ formatString: (template, count) => `${template}:${count}`
42
+ }
43
+ }));
44
+ jest.mock('./captureResult.less', () => ({}));
45
+ const {
46
+ CaptureResultToast
47
+ } = require('./captureResult');
48
+ const renderToast = count => renderToStaticMarkup(/*#__PURE__*/React.createElement(CaptureResultToast, {
49
+ brandColor: "#ff592a",
50
+ count: count,
51
+ kind: "screenshot",
52
+ onCheck: () => undefined,
53
+ thumbnailPath: "thingfile://capture.jpg"
54
+ }));
55
+ const countClass = (markup, className) => [...markup.matchAll(/class="([^"]*)"/g)].filter(_ref4 => {
56
+ let [, names] = _ref4;
57
+ return names.split(/\s+/).includes(className);
58
+ }).length;
59
+ describe('CaptureResultToast', () => {
60
+ it('shows the actual count for one successful multi-lens item', () => {
61
+ expect(renderToast(1)).toContain('ipc_player_multi_capture_success_count:1');
62
+ expect(renderToast(0)).not.toContain('ipc_player_multi_capture_success_count');
63
+ });
64
+ it('keeps the single-item thumbnail unchanged', () => {
65
+ const markup = renderToast(1);
66
+ expect(countClass(markup, 'ipc-player-plugin-capture-result-backdrop')).toBe(0);
67
+ expect(countClass(markup, 'ipc-player-plugin-capture-result-image-front')).toBe(0);
68
+ expect(countClass(markup, 'ipc-player-plugin-capture-result-image')).toBe(1);
69
+ });
70
+ it('renders both backdrops for two captured items', () => {
71
+ const markup = renderToast(2);
72
+ expect(countClass(markup, 'ipc-player-plugin-capture-result-backdrop')).toBe(2);
73
+ expect(countClass(markup, 'ipc-player-plugin-capture-result-image-back')).toBe(1);
74
+ expect(countClass(markup, 'ipc-player-plugin-capture-result-image-middle')).toBe(1);
75
+ expect(countClass(markup, 'ipc-player-plugin-capture-result-image-front')).toBe(1);
76
+ });
77
+ it('caps the backdrop count at two', () => {
78
+ const markup = renderToast(4);
79
+ expect(countClass(markup, 'ipc-player-plugin-capture-result-backdrop')).toBe(2);
80
+ expect(countClass(markup, 'ipc-player-plugin-capture-result-image-back')).toBe(1);
81
+ expect(countClass(markup, 'ipc-player-plugin-capture-result-image-middle')).toBe(1);
82
+ expect(countClass(markup, 'ipc-player-plugin-capture-result-image-front')).toBe(1);
83
+ });
84
+ });
@@ -0,0 +1,2 @@
1
+ export * from './captureResult';
2
+ export type { CaptureResultToastProps, CaptureKind } from './captureResult';
@@ -0,0 +1,2 @@
1
+ export * from './captureResult';
2
+ export {};
@@ -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 { useDpState } from '../../hooks';
6
5
  import { useStore } from '../../ctx/store';
7
6
  import { UIEventContext } from '../../ui/context';
@@ -1,9 +1,8 @@
1
- import { View } from '@ray-js/ray';
1
+ import { View, Text } 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';
7
6
  import Strings from '../../i18n';
8
7
  import { useStore } from '../../ctx/store';
9
8
  import { showFlowLowTipId } from '../../ui/constant';
@@ -1,9 +1,8 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
- import React, { useContext, useEffect, useMemo } from 'react';
3
- import { View, setPageOrientation, hideMenuButton, showMenuButton, showStatusBar, hideStatusBar, setNavigationBarBack, getSystemInfoSync } from '@ray-js/ray';
2
+ import React, { useContext, useEffect } from 'react';
3
+ import { View, setPageOrientation, Text, hideMenuButton, showMenuButton, showStatusBar, hideStatusBar, setNavigationBarBack } 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';
7
6
  import { UIEventContext } from '../../ui/context';
8
7
  import { showAllComponent, voiceIntercomId, verticalScreenId, fullTravelRouteControlId, ptzControlId, fullResolutionId, fullSmallIntercomId, pauseTimeToHideAllComponent, widgetLabs, widgetClick } from '../../ui/constant';
9
8
  import { useStore } from '../../ctx/store';
@@ -35,15 +34,6 @@ export function FullScreen(props) {
35
34
  event
36
35
  } = useContext(UIEventContext);
37
36
 
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
-
47
37
  /**
48
38
  * 竖屏统一操作
49
39
  */
@@ -54,9 +44,7 @@ export function FullScreen(props) {
54
44
  const handleFull = () => {
55
45
  hasDpCode(devId, DIRECTION_CONTROL_DP_CODE).then(hasDirectionControlDpCode => {
56
46
  hideMenuButton();
57
- if (!isPad) {
58
- hideStatusBar();
59
- }
47
+ hideStatusBar();
60
48
  setNavigationBarBack({
61
49
  type: 'custom'
62
50
  });
@@ -120,9 +108,7 @@ export function FullScreen(props) {
120
108
  type: 'system'
121
109
  });
122
110
  showMenuButton();
123
- if (!isPad) {
124
- showStatusBar();
125
- }
111
+ showStatusBar();
126
112
  deleteContent('topLeft', verticalScreenId);
127
113
  hideContent('bottomLeft', fullSmallIntercomId);
128
114
  deleteContent('absolute', voiceIntercomId);
@@ -2,7 +2,7 @@
2
2
  * 全屏状态下要添加的摄像机行进路线控件
3
3
  */
4
4
  import React from 'react';
5
- import RectDirectionControl from '../../renderer/directionControl';
5
+ import RectDirectionControl from '@ray-js/direction-control';
6
6
  import type { ComponentConfigProps } from '../../interface';
7
7
  type RectDirectionControlProps = React.ComponentProps<typeof RectDirectionControl>;
8
8
  export type FullTravelRouteControlProps = ComponentConfigProps & {
@@ -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';
9
10
  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';
@@ -1,7 +1,6 @@
1
1
  import React 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 './verticalScreen.less';
6
5
  const NILL = () => null;
7
6
  export function VerticalScreen(_ref) {
@@ -24,3 +24,4 @@ export * from './toggleVerticalFull';
24
24
  export * from './flowLowTip';
25
25
  export * from './realTimeMagnification';
26
26
  export * from './zoomTurntable';
27
+ export * from './captureResult';
@@ -23,4 +23,5 @@ export * from './smallIntercom';
23
23
  export * from './toggleVerticalFull';
24
24
  export * from './flowLowTip';
25
25
  export * from './realTimeMagnification';
26
- export * from './zoomTurntable';
26
+ export * from './zoomTurntable';
27
+ export * from './captureResult';
@@ -1,7 +1,6 @@
1
1
  import React, { useContext } 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 { useStore } from '../../ctx/store';
6
5
  import { UIEventContext } from '../../ui/context';
7
6
  import { hideAllComponent, widgetLabs, widgetClick } from '../../ui/constant';
@@ -4,8 +4,6 @@ import "core-js/modules/esnext.iterator.map.js";
4
4
  import React from 'react';
5
5
  import { View, ScrollView, CoverView } from '@ray-js/ray';
6
6
  import clsx from 'clsx';
7
- import { usePlayerRenderMode } from '../../renderer/context';
8
- import { PlayerText } from '../../renderer/text';
9
7
  import './moveInteractiveControlUI.less';
10
8
  const defaultMenu = [{
11
9
  key: '0',
@@ -64,7 +62,6 @@ const defaultCSSVariable = {
64
62
  '--activeColor': '#FF592A'
65
63
  };
66
64
  export function MoveInterActiveControlUI(props) {
67
- const isLynx = usePlayerRenderMode() === 'lynx';
68
65
  const {
69
66
  contentClsName,
70
67
  wrapClsName,
@@ -83,17 +80,13 @@ export function MoveInterActiveControlUI(props) {
83
80
  // @ts-ignore
84
81
  , {
85
82
  style: _objectSpread({}, CSSVariable),
86
- className: clsx('ipc-player-plugin-active-control-wrap', wrapClsName, {
87
- 'ipc-player-plugin-active-control-wrap-lynx': isLynx,
88
- 'ipc-player-plugin-active-control-wrap-webview': !isLynx
89
- })
83
+ className: clsx('ipc-player-plugin-active-control-wrap', wrapClsName)
90
84
  }, /*#__PURE__*/React.createElement(View, {
91
85
  className: clsx('ipc-player-plugin-active-control-title')
92
86
  }, I18n.t('homeFeatureInteractiveMenuTitle')), /*#__PURE__*/React.createElement(ScrollView, {
93
87
  style: {
94
88
  flex: 1
95
89
  },
96
- className: isLynx ? 'ipc-player-plugin-active-control-scroll-lynx' : undefined,
97
90
  scrollY: true
98
91
  }, /*#__PURE__*/React.createElement(View, {
99
92
  className: clsx('ipc-player-plugin-active-control', contentClsName)
@@ -105,11 +98,9 @@ export function MoveInterActiveControlUI(props) {
105
98
  })
106
99
  }, /*#__PURE__*/React.createElement(View, {
107
100
  className: clsx('ipc-player-plugin-active-control-item-icon')
108
- }, !isLynx && /*#__PURE__*/React.createElement(View, {
101
+ }, /*#__PURE__*/React.createElement(View, {
109
102
  className: clsx('ipc-player-plugin-active-control-item-icon-mask')
110
- }), isLynx ? /*#__PURE__*/React.createElement(PlayerText, {
111
- className: clsx('icon-panel', item.iconName, 'ipc-player-plugin-interactive-icon')
112
- }) : /*#__PURE__*/React.createElement(View, {
103
+ }), /*#__PURE__*/React.createElement(View, {
113
104
  className: clsx('icon-panel', item.iconName, 'ipc-player-plugin-interactive-icon')
114
105
  })), /*#__PURE__*/React.createElement(View, {
115
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
+ }
@@ -39,6 +39,7 @@
39
39
  }
40
40
 
41
41
  .@{prefix}-moveable-ptz-control {
42
+ touch-action: none;
42
43
  --ptz-bg-color: rgba(0, 0, 0, 0.4);
43
44
  --ptz-arrow-bg-color: rgba(0, 0, 0, 0.4);
44
45
  --app-native-btn-bg-color: transparent;
@@ -1,7 +1,6 @@
1
1
  import React, { useState } from 'react';
2
- import { View, CoverView } from '@ray-js/ray';
2
+ import { View, CoverView, Text } from '@ray-js/ray';
3
3
  import clsx from 'clsx';
4
- import { PlayerText as Text } from '../../renderer/text';
5
4
  import { useStore } from '../../ctx/store';
6
5
  import { landscapeTipId } from '../../ui/constant';
7
6
  import { PlayState } from '../../interface';
@@ -7,7 +7,7 @@ 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 '../../renderer/ptzZoom';
10
+ import IpcPtzZoom from '@ray-js/ipc-ptz-zoom';
11
11
  import { useStore } from '../../ctx/store';
12
12
  import { useMemoizedFn } from '../../hooks';
13
13
  import { MultiCameraScreenMode } from '../../interface';
@@ -390,7 +390,7 @@ export const MoveablePtzControlItem = props => {
390
390
  ptzData: selectedLenInfo.supportPTZ ? ptzData : [],
391
391
  onTouchPtzStart: onTouchPtzStart,
392
392
  onTouchPtzEnd: async () => {
393
- screenMode === MultiCameraScreenMode.landscape && event.emit(startTimeToHideAllComponent);
393
+ screenMode !== MultiCameraScreenMode.short && event.emit(startTimeToHideAllComponent);
394
394
  const stopConfig = dpSupportMap.ipc_multi_ptz_control ? {
395
395
  code: 'ipc_multi_ptz_stop',
396
396
  value: JSON.stringify({
@@ -415,7 +415,7 @@ export const MoveablePtzControlItem = props => {
415
415
  },
416
416
  onTouchZoomStart: onTouchZoomStart,
417
417
  onTouchZoomEnd: async () => {
418
- screenMode === MultiCameraScreenMode.landscape && event.emit(startTimeToHideAllComponent);
418
+ screenMode !== MultiCameraScreenMode.short && event.emit(startTimeToHideAllComponent);
419
419
  const stopConfig = dpSupportMap.ipc_multi_zoom_control ? {
420
420
  code: 'ipc_multi_zoom_stop',
421
421
  value: JSON.stringify({
@@ -464,10 +464,10 @@ export const MoveablePtzControl = props => {
464
464
  // 处理因为状态更新不同步导致的闪烁问题
465
465
  const activeViewRef = useRef(0);
466
466
  const onDragStart = () => {
467
- screenMode === MultiCameraScreenMode.landscape && event.emit(pauseTimeToHideAllComponent);
467
+ screenMode !== MultiCameraScreenMode.short && event.emit(pauseTimeToHideAllComponent);
468
468
  };
469
469
  const onDragEnd = data => {
470
- screenMode === MultiCameraScreenMode.landscape && event.emit(startTimeToHideAllComponent);
470
+ screenMode !== MultiCameraScreenMode.short && event.emit(startTimeToHideAllComponent);
471
471
  activeViewRef.current = activeViewRef.current === 0 ? 1 : 0;
472
472
  setStyle(prev => _objectSpread(_objectSpread({}, prev), {}, {
473
473
  positionLeft: data.positionLeft,
@@ -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
  /**
@@ -27,7 +26,7 @@ export const MultiPtz = props => {
27
26
  selectedLenInfo: multiCameraCtx.selectedLenInfo
28
27
  });
29
28
  const onPtz = useMemoizedFn(() => {
30
- multiCameraCtx.setPtzStatus(!ptzStatus);
29
+ multiCameraCtx.togglePtz();
31
30
  });
32
31
  if (!selectedLenInfo.supportPTZ && !selectedLenInfo.supportZoom) {
33
32
  return null;
@@ -1,7 +1,6 @@
1
1
  import React, { useMemo, useState } from 'react';
2
- import { View, CoverView } from '@ray-js/ray';
2
+ import { View, CoverView, Text } from '@ray-js/ray';
3
3
  import clsx from 'clsx';
4
- import { PlayerText as Text } from '../../renderer/text';
5
4
  import { useStore } from '../../ctx/store';
6
5
  import { ptzMoveableTipId } from '../../ui/constant';
7
6
  import { PlayState } from '../../interface';
@@ -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';
@@ -28,7 +27,7 @@ export const TileMultiPtz = props => {
28
27
  });
29
28
  const lighterBrandColor = new Color(brandColor).alpha(0.2).hexa();
30
29
  const onPtz = useMemoizedFn(() => {
31
- multiCameraCtx.setPtzStatus(!ptzStatus);
30
+ multiCameraCtx.togglePtz();
32
31
  });
33
32
  if (!selectedLenInfo.supportPTZ && !selectedLenInfo.supportZoom) {
34
33
  return null;
@@ -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,7 +1,6 @@
1
1
  import React, { useState } from 'react';
2
- import { View, CoverView } from '@ray-js/ray';
2
+ import { View, CoverView, Text } from '@ray-js/ray';
3
3
  import clsx from 'clsx';
4
- import { PlayerText as Text } from '../../renderer/text';
5
4
  import { useStore } from '../../ctx/store';
6
5
  import { tileTipId } from '../../ui/constant';
7
6
  import { PlayState } from '../../interface';
@@ -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';
@@ -4,8 +4,8 @@ import { CoverView } from '@ray-js/ray';
4
4
  import clsx from 'clsx';
5
5
  import _find from 'lodash/find';
6
6
  import _get from 'lodash/get';
7
+ import IpcPtzZoom from '@ray-js/ipc-ptz-zoom';
7
8
  import { getDpIdByCode, publishDps } from '@ray-js/ray-ipc-utils';
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';