@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.
- package/README.md +0 -6
- package/lib/ctx/ctx.composition.d.ts +5 -1
- package/lib/ctx/ctx.composition.js +4 -1
- package/lib/ctx/ctx.js +17 -12
- package/lib/ctx/ctx.test.js +19 -54
- package/lib/features/initPlayerWidgets/index.d.ts +3 -0
- package/lib/features/initPlayerWidgets/index.js +4 -0
- package/lib/index.d.ts +0 -4
- package/lib/index.js +1 -3
- package/lib/interface.d.ts +1 -1
- package/lib/ui/bottomControlLayout.d.ts +11 -0
- package/lib/ui/bottomControlLayout.js +19 -0
- package/lib/ui/bottomControlLayout.test.js +64 -0
- package/lib/ui/bottomLeftContent.js +73 -180
- package/lib/ui/bottomLeftContent.test.js +138 -0
- package/lib/ui/bottomRightContent.d.ts +2 -2
- package/lib/ui/bottomRightContent.js +24 -16
- package/lib/ui/bottomRightContent.test.js +144 -0
- package/lib/ui/constant.d.ts +2 -0
- package/lib/ui/constant.js +4 -1
- package/lib/ui/topLeftContent.js +2 -4
- package/lib/ui/topRightContent.js +2 -4
- package/lib/ui/ui.d.ts +0 -5
- package/lib/ui/ui.js +33 -86
- package/lib/ui/ui.less +24 -59
- package/lib/widgets/battery/battery.js +5 -7
- package/lib/widgets/battery/batteryFull.js +5 -7
- package/lib/widgets/captureResult/captureResult.js +1 -2
- package/lib/widgets/floatWindow/floatWindow.d.ts +13 -0
- package/lib/widgets/floatWindow/floatWindow.js +93 -0
- package/lib/widgets/floatWindow/floatWindow.less +14 -0
- package/lib/widgets/floatWindow/floatWindow.test.d.ts +1 -0
- package/lib/widgets/floatWindow/floatWindow.test.js +164 -0
- package/lib/widgets/floatWindow/icon.d.ts +1 -0
- package/lib/widgets/floatWindow/icon.js +4 -0
- package/lib/widgets/floatWindow/index.d.ts +1 -0
- package/lib/widgets/floatWindow/index.js +1 -0
- package/lib/widgets/floodlight/floodlight.js +1 -2
- package/lib/widgets/flowLowTip/flowLowTip.js +1 -2
- package/lib/widgets/fullScreen/fullScreen.js +1 -2
- package/lib/widgets/fullScreen/fullTravelRouteControl.d.ts +1 -1
- package/lib/widgets/fullScreen/fullTravelRouteControl.js +1 -1
- package/lib/widgets/fullScreen/verticalScreen.js +1 -2
- package/lib/widgets/index.d.ts +1 -0
- package/lib/widgets/index.js +2 -1
- package/lib/widgets/moveInteractiveControl/controlButton.js +1 -2
- package/lib/widgets/moveInteractiveControl/moveInteractiveControlUI.js +5 -16
- package/lib/widgets/moveInteractiveControl/moveInteractiveControlUI.less +4 -24
- package/lib/widgets/multiCamera/landscapeTip.js +2 -8
- package/lib/widgets/multiCamera/moveablePtzControl.js +3 -5
- package/lib/widgets/multiCamera/multiPtz.js +1 -2
- package/lib/widgets/multiCamera/ptzMoveableTip.js +2 -8
- package/lib/widgets/multiCamera/switchLayout.js +1 -2
- package/lib/widgets/multiCamera/tileMultiPtz.js +1 -2
- package/lib/widgets/multiCamera/tileSwitchLayout.js +1 -2
- package/lib/widgets/multiCamera/tileTip.js +2 -8
- package/lib/widgets/muted/muted.js +1 -2
- package/lib/widgets/muted/muted.test.js +52 -66
- package/lib/widgets/ptz/ptz.js +1 -2
- package/lib/widgets/ptz/ptzControl.js +3 -4
- package/lib/widgets/ptzControlTip/ptzControlTip.js +4 -9
- package/lib/widgets/ptzControlTip/ptzControlTip.less +0 -6
- package/lib/widgets/realTimeMagnification/realTimeMagnification.js +1 -2
- package/lib/widgets/recordVideo/recordVideo.js +169 -47
- package/lib/widgets/recordVideo/recordVideo.lifecycle.test.js +2 -4
- package/lib/widgets/recordVideo/recordVideo.test.js +2 -169
- package/lib/widgets/resolution/fullResolutionControl.js +19 -29
- package/lib/widgets/resolution/resolution.js +2 -3
- package/lib/widgets/screenshot/screenshot.js +122 -48
- package/lib/widgets/screenshot/screenshot.test.js +113 -108
- package/lib/widgets/signal4G/signal4G.js +1 -4
- package/lib/widgets/siren/siren.js +1 -2
- package/lib/widgets/tempHumidity/tempHumidity.js +1 -2
- package/lib/widgets/toggleVerticalFull/toggleVerticalFull.js +1 -2
- package/lib/widgets/trialBadge/index.js +3 -8
- package/lib/widgets/trialBadge/index.less +0 -24
- package/lib/widgets/tryExperience/tryExperience.js +1 -2
- package/lib/widgets/videoBitKBP/videoBitKBP.js +1 -2
- package/lib/widgets/voiceIntercom/voiceIntercom.js +81 -57
- package/lib/widgets/voiceIntercom/voiceIntercom.less +0 -35
- package/lib/widgets/zoomTurntable/turntable/index.d.ts +7 -5
- package/lib/widgets/zoomTurntable/turntable/index.js +1 -3
- package/lib/widgets/zoomTurntable/zoomTurntableDock.d.ts +3 -5
- package/lib/widgets/zoomTurntable/zoomTurntableDock.js +4 -4
- package/lib/widgets/zoomTurntable/zoomTurntableEntry.js +19 -32
- package/lib/widgets/zoomTurntable/zoomTurntableTip.js +3 -17
- package/package.json +7 -15
- package/lib/ctx/intercom.test.js +0 -85
- package/lib/renderer/capabilities.d.ts +0 -8
- package/lib/renderer/capabilities.js +0 -19
- package/lib/renderer/context.d.ts +0 -5
- package/lib/renderer/context.js +0 -6
- package/lib/renderer/directionControl.d.ts +0 -6
- package/lib/renderer/directionControl.js +0 -3
- package/lib/renderer/font-manifest.json +0 -9
- package/lib/renderer/font.less +0 -5
- package/lib/renderer/glyphs.d.ts +0 -1
- package/lib/renderer/glyphs.js +0 -256
- package/lib/renderer/index.module.less +0 -48
- package/lib/renderer/overlay.d.ts +0 -6
- package/lib/renderer/overlay.js +0 -18
- package/lib/renderer/ptzZoom.d.ts +0 -6
- package/lib/renderer/ptzZoom.js +0 -3
- package/lib/renderer/text.d.ts +0 -4
- package/lib/renderer/text.js +0 -32
- package/lib/renderer/text.module.less +0 -4
- package/lib/renderer/viewport.d.ts +0 -7
- package/lib/renderer/viewport.js +0 -24
- package/lib/res/lynx-signal/index.d.ts +0 -1
- package/lib/res/lynx-signal/index.js +0 -22
- package/lib/res/lynx-signal/signalFour0.png +0 -0
- package/lib/res/lynx-signal/signalFour1.png +0 -0
- package/lib/res/lynx-signal/signalFour2.png +0 -0
- package/lib/res/lynx-signal/signalFour3.png +0 -0
- package/lib/res/lynx-signal/signalFour4.png +0 -0
- package/lib/res/lynx-signal/signalThree0.png +0 -0
- package/lib/res/lynx-signal/signalThree1.png +0 -0
- package/lib/res/lynx-signal/signalThree2.png +0 -0
- package/lib/res/lynx-signal/signalThree3.png +0 -0
- package/lib/res/player-charging.png +0 -0
- package/lib/res/player-more-arrow.png +0 -0
- package/lib/res/player-solar.png +0 -0
- package/lib/ui/scrollHintArrow.d.ts +0 -23
- package/lib/ui/scrollHintArrow.js +0 -83
- package/lib/widgets/battery/statusIcon.d.ts +0 -6
- package/lib/widgets/battery/statusIcon.js +0 -36
- package/lib/widgets/battery/statusIcon.less +0 -24
- package/lib/widgets/captureToast/captureToast.d.ts +0 -10
- package/lib/widgets/captureToast/captureToast.js +0 -58
- package/lib/widgets/recordVideo/recordVideoTimer.d.ts +0 -3
- package/lib/widgets/recordVideo/recordVideoTimer.js +0 -26
- package/lib/widgets/screenshot/screenshot.permissions.test.js +0 -137
- package/lib/widgets/voiceIntercom/voiceIntercom.test.js +0 -135
- package/lib/widgets/zoomTurntable/lynxDockLayout.d.ts +0 -6
- package/lib/widgets/zoomTurntable/lynxDockLayout.js +0 -30
- package/lib/widgets/zoomTurntable/turntable/lynx.d.ts +0 -5
- package/lib/widgets/zoomTurntable/turntable/lynx.js +0 -273
- package/lib/widgets/zoomTurntable/turntable/lynx.less +0 -9
- package/lib/widgets/zoomTurntable/turntable/lynxModel.d.ts +0 -37
- package/lib/widgets/zoomTurntable/turntable/lynxModel.js +0 -122
- package/lib/widgets/zoomTurntable/turntable/lynxPaint.d.ts +0 -3
- package/lib/widgets/zoomTurntable/turntable/lynxPaint.js +0 -36
- /package/lib/{ctx/intercom.test.d.ts → ui/bottomControlLayout.test.d.ts} +0 -0
- /package/lib/{widgets/screenshot/screenshot.permissions.test.d.ts → ui/bottomLeftContent.test.d.ts} +0 -0
- /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 ?
|
|
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
|
-
},
|
|
101
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
111
102
|
className: clsx('ipc-player-plugin-active-control-item-icon-mask')
|
|
112
|
-
}),
|
|
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(
|
|
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
|
|
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(
|
|
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(
|
|
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(
|
|
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
|
|
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
|
-
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
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
|
});
|
package/lib/widgets/ptz/ptz.js
CHANGED
|
@@ -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(
|
|
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(
|
|
34
|
+
return /*#__PURE__*/React.createElement(CoverView, {
|
|
40
35
|
className: clsx('playerControlTipContainer')
|
|
41
36
|
}, /*#__PURE__*/React.createElement(Image, {
|
|
42
|
-
mode:
|
|
37
|
+
mode: "widthFix",
|
|
43
38
|
src: playerPtzControlTip,
|
|
44
|
-
className: clsx('controlTipImage'
|
|
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';
|