@ray-js/ipc-player-integration 0.0.68-beta.0 → 0.0.69-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.album.test.d.ts +1 -0
- package/lib/ctx/ctx.album.test.js +197 -0
- package/lib/ctx/ctx.composition.js +13 -3
- package/lib/ctx/ctx.js +48 -35
- package/lib/ctx/multiCameraCtx.d.ts +2 -0
- package/lib/ctx/multiCameraCtx.js +17 -1
- package/lib/ctx/multiCameraCtx.test.d.ts +1 -0
- package/lib/ctx/multiCameraCtx.test.js +65 -0
- package/lib/i18n/index.d.ts +12 -0
- package/lib/i18n/strings.d.ts +6 -0
- package/lib/i18n/strings.js +6 -0
- package/lib/index.d.ts +0 -4
- package/lib/index.js +1 -3
- package/lib/interface.d.ts +18 -3
- package/lib/ui/absoluteContent.d.ts +2 -0
- package/lib/ui/absoluteContent.js +3 -0
- package/lib/ui/bottomCoverHeight.d.ts +2 -0
- package/lib/ui/bottomCoverHeight.js +6 -0
- package/lib/ui/bottomCoverHeight.test.d.ts +1 -0
- package/lib/ui/bottomCoverHeight.test.js +15 -0
- package/lib/ui/bottomLeftContent.js +65 -123
- package/lib/ui/bottomRightContent.js +13 -11
- 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 +100 -93
- package/lib/utils/captureResult.d.ts +12 -0
- package/lib/utils/captureResult.js +70 -0
- package/lib/utils/captureResult.test.d.ts +1 -0
- package/lib/utils/captureResult.test.js +223 -0
- package/lib/utils/fullLinkTracking.d.ts +5 -0
- package/lib/utils/fullLinkTracking.js +71 -0
- package/lib/utils/navigation.d.ts +2 -1
- package/lib/utils/navigation.js +13 -3
- package/lib/widgets/battery/battery.js +5 -7
- package/lib/widgets/battery/batteryFull.js +5 -7
- package/lib/widgets/captureResult/captureResult.d.ts +16 -0
- package/lib/widgets/captureResult/captureResult.js +85 -0
- package/lib/widgets/captureResult/captureResult.less +144 -0
- package/lib/widgets/captureResult/captureResult.test.d.ts +1 -0
- package/lib/widgets/captureResult/captureResult.test.js +84 -0
- package/lib/widgets/captureResult/index.d.ts +2 -0
- package/lib/widgets/captureResult/index.js +2 -0
- package/lib/widgets/floodlight/floodlight.js +1 -2
- package/lib/widgets/flowLowTip/flowLowTip.js +1 -2
- package/lib/widgets/fullScreen/fullScreen.js +31 -44
- package/lib/widgets/fullScreen/fullTravelRouteControl.d.ts +2 -2
- package/lib/widgets/fullScreen/fullTravelRouteControl.js +6 -3
- 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/index.less +1 -0
- package/lib/widgets/multiCamera/landscapeTip.js +2 -5
- package/lib/widgets/multiCamera/moveablePtzControl.js +7 -9
- package/lib/widgets/multiCamera/multiPtz.js +2 -3
- package/lib/widgets/multiCamera/ptzMoveableTip.js +2 -5
- package/lib/widgets/multiCamera/switchLayout.js +1 -2
- package/lib/widgets/multiCamera/tileMultiPtz.js +2 -3
- package/lib/widgets/multiCamera/tileSwitchLayout.js +1 -2
- package/lib/widgets/multiCamera/tileTip.js +2 -5
- 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 +178 -32
- package/lib/widgets/recordVideo/recordVideo.less +17 -74
- package/lib/widgets/recordVideo/recordVideo.lifecycle.test.d.ts +1 -0
- package/lib/widgets/recordVideo/recordVideo.lifecycle.test.js +106 -0
- package/lib/widgets/recordVideo/recordVideo.test.js +3 -169
- package/lib/widgets/resolution/fullResolutionControl.js +19 -29
- package/lib/widgets/resolution/resolution.js +2 -3
- package/lib/widgets/screenshot/screenshot.js +125 -35
- package/lib/widgets/screenshot/screenshot.less +1 -40
- 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.d.ts +2 -1
- package/lib/widgets/trialBadge/index.js +20 -17
- package/lib/widgets/trialBadge/index.less +0 -24
- package/lib/widgets/trialBadge/useTrialBadge.d.ts +3 -2
- package/lib/widgets/trialBadge/useTrialBadge.js +21 -3
- package/lib/widgets/tryExperience/tryExperience.js +1 -2
- package/lib/widgets/videoBitKBP/videoBitKBP.js +1 -2
- package/lib/widgets/voiceIntercom/voiceIntercom.js +24 -50
- package/lib/widgets/voiceIntercom/voiceIntercom.less +0 -16
- 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 -24
- package/package.json +7 -15
- 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 -4
- package/lib/renderer/overlay.js +0 -6
- 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 -9
- package/lib/widgets/captureToast/captureToast.js +0 -73
- package/lib/widgets/recordVideo/recordVideoTimer.d.ts +0 -3
- package/lib/widgets/recordVideo/recordVideoTimer.js +0 -26
- 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
|
@@ -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
|
+
});
|
|
@@ -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
|
|
3
|
-
import { View, setPageOrientation, hideMenuButton, showMenuButton, showStatusBar, hideStatusBar, setNavigationBarBack
|
|
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,28 +34,34 @@ 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
|
*/
|
|
50
40
|
|
|
41
|
+
const handleVertical = () => {
|
|
42
|
+
event.emit(pauseTimeToHideAllComponent);
|
|
43
|
+
setNavigationBarBack({
|
|
44
|
+
type: 'system'
|
|
45
|
+
});
|
|
46
|
+
showMenuButton();
|
|
47
|
+
showStatusBar();
|
|
48
|
+
deleteContent('topLeft', verticalScreenId);
|
|
49
|
+
hideContent('bottomLeft', fullSmallIntercomId);
|
|
50
|
+
deleteContent('absolute', voiceIntercomId);
|
|
51
|
+
deleteContent('absolute', ptzControlId);
|
|
52
|
+
deleteContent('absolute', fullResolutionId);
|
|
53
|
+
deleteContent('absolute', fullTravelRouteControlId);
|
|
54
|
+
};
|
|
55
|
+
|
|
51
56
|
/**
|
|
52
57
|
* 全屏统一操作
|
|
53
58
|
*/
|
|
54
|
-
const handleFull =
|
|
59
|
+
const handleFull = isCurrent => {
|
|
55
60
|
hasDpCode(devId, DIRECTION_CONTROL_DP_CODE).then(hasDirectionControlDpCode => {
|
|
61
|
+
// 屏幕切换、设备切换或卸载后,旧能力查询不能重新挂载全屏控件。
|
|
62
|
+
if (!isCurrent()) return;
|
|
56
63
|
hideMenuButton();
|
|
57
|
-
|
|
58
|
-
hideStatusBar();
|
|
59
|
-
}
|
|
64
|
+
hideStatusBar();
|
|
60
65
|
setNavigationBarBack({
|
|
61
66
|
type: 'custom'
|
|
62
67
|
});
|
|
@@ -106,35 +111,17 @@ export function FullScreen(props) {
|
|
|
106
111
|
}, null);
|
|
107
112
|
});
|
|
108
113
|
};
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* 针对横竖屏方法统一集中处理
|
|
112
|
-
*/
|
|
113
|
-
const handlers = {
|
|
114
|
-
full: () => {
|
|
115
|
-
handleFull();
|
|
116
|
-
},
|
|
117
|
-
vertical: () => {
|
|
118
|
-
event.emit(pauseTimeToHideAllComponent);
|
|
119
|
-
setNavigationBarBack({
|
|
120
|
-
type: 'system'
|
|
121
|
-
});
|
|
122
|
-
showMenuButton();
|
|
123
|
-
if (!isPad) {
|
|
124
|
-
showStatusBar();
|
|
125
|
-
}
|
|
126
|
-
deleteContent('topLeft', verticalScreenId);
|
|
127
|
-
hideContent('bottomLeft', fullSmallIntercomId);
|
|
128
|
-
deleteContent('absolute', voiceIntercomId);
|
|
129
|
-
deleteContent('absolute', ptzControlId);
|
|
130
|
-
deleteContent('absolute', fullResolutionId);
|
|
131
|
-
deleteContent('absolute', fullTravelRouteControlId);
|
|
132
|
-
}
|
|
133
|
-
};
|
|
134
114
|
useEffect(() => {
|
|
135
|
-
|
|
136
|
-
(
|
|
137
|
-
|
|
115
|
+
let active = true;
|
|
116
|
+
if (screenType === 'full') {
|
|
117
|
+
handleFull(() => active);
|
|
118
|
+
} else {
|
|
119
|
+
handleVertical();
|
|
120
|
+
}
|
|
121
|
+
return () => {
|
|
122
|
+
active = false;
|
|
123
|
+
};
|
|
124
|
+
}, [screenType, devId]);
|
|
138
125
|
|
|
139
126
|
// 点击事件处理函数
|
|
140
127
|
const handClick = target => {
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* 全屏状态下要添加的摄像机行进路线控件
|
|
3
3
|
*/
|
|
4
4
|
import React from 'react';
|
|
5
|
-
import RectDirectionControl from '
|
|
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 & {
|
|
9
9
|
directionControlProps?: Partial<RectDirectionControlProps>;
|
|
10
10
|
};
|
|
11
|
-
export declare function FullTravelRouteControl(props: FullTravelRouteControlProps): React.JSX.Element;
|
|
11
|
+
export declare function FullTravelRouteControl(props: FullTravelRouteControlProps): React.JSX.Element | null;
|
|
12
12
|
export {};
|
|
@@ -6,8 +6,8 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
6
6
|
import React, { useEffect, useContext, useState, useRef } from 'react';
|
|
7
7
|
import { View } from '@ray-js/ray';
|
|
8
8
|
import clsx from 'clsx';
|
|
9
|
+
import RectDirectionControl from '@ray-js/direction-control';
|
|
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';
|
|
@@ -26,9 +26,11 @@ export function FullTravelRouteControl(props) {
|
|
|
26
26
|
const prevRotate = useRef('-1');
|
|
27
27
|
const pauseTimeToHideAllComponentRef = useRef(false);
|
|
28
28
|
const {
|
|
29
|
-
brandColor
|
|
29
|
+
brandColor,
|
|
30
|
+
screenType
|
|
30
31
|
} = useStore({
|
|
31
|
-
brandColor: props.brandColor
|
|
32
|
+
brandColor: props.brandColor,
|
|
33
|
+
screenType: props.screenType
|
|
32
34
|
});
|
|
33
35
|
useRef();
|
|
34
36
|
const [state, _, sendDp] = useDpState({
|
|
@@ -64,6 +66,7 @@ export function FullTravelRouteControl(props) {
|
|
|
64
66
|
});
|
|
65
67
|
prevRotate.current = value;
|
|
66
68
|
};
|
|
69
|
+
if (screenType !== 'full') return null;
|
|
67
70
|
return /*#__PURE__*/React.createElement(View, {
|
|
68
71
|
className: clsx('ipc-player-plugin-full-screen-voice', 'ipc-plugin-absolute-move-in-right', {
|
|
69
72
|
'ipc-plugin-absolute-move-in-right-hide': shouldHide || isPtzActive
|
|
@@ -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) {
|
package/lib/widgets/index.d.ts
CHANGED
package/lib/widgets/index.js
CHANGED
|
@@ -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';
|
|
@@ -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 } 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,7 +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
12
|
const {
|
|
16
13
|
devId,
|
|
17
14
|
deleteContent
|
|
@@ -30,7 +27,7 @@ export const LandscapeTip = props => {
|
|
|
30
27
|
storage.set(landscapeTipId, true);
|
|
31
28
|
};
|
|
32
29
|
if (showTipModal && playState === PlayState.PLAYING) {
|
|
33
|
-
return /*#__PURE__*/React.createElement(
|
|
30
|
+
return /*#__PURE__*/React.createElement(CoverView, null, /*#__PURE__*/React.createElement(View, {
|
|
34
31
|
className: clsx(`${multiPrefix}-tile-tip-content`, `${multiPrefix}-landscape-tip`)
|
|
35
32
|
}), /*#__PURE__*/React.createElement(Text, {
|
|
36
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,
|
|
@@ -392,7 +390,7 @@ export const MoveablePtzControlItem = props => {
|
|
|
392
390
|
ptzData: selectedLenInfo.supportPTZ ? ptzData : [],
|
|
393
391
|
onTouchPtzStart: onTouchPtzStart,
|
|
394
392
|
onTouchPtzEnd: async () => {
|
|
395
|
-
screenMode
|
|
393
|
+
screenMode !== MultiCameraScreenMode.short && event.emit(startTimeToHideAllComponent);
|
|
396
394
|
const stopConfig = dpSupportMap.ipc_multi_ptz_control ? {
|
|
397
395
|
code: 'ipc_multi_ptz_stop',
|
|
398
396
|
value: JSON.stringify({
|
|
@@ -417,7 +415,7 @@ export const MoveablePtzControlItem = props => {
|
|
|
417
415
|
},
|
|
418
416
|
onTouchZoomStart: onTouchZoomStart,
|
|
419
417
|
onTouchZoomEnd: async () => {
|
|
420
|
-
screenMode
|
|
418
|
+
screenMode !== MultiCameraScreenMode.short && event.emit(startTimeToHideAllComponent);
|
|
421
419
|
const stopConfig = dpSupportMap.ipc_multi_zoom_control ? {
|
|
422
420
|
code: 'ipc_multi_zoom_stop',
|
|
423
421
|
value: JSON.stringify({
|
|
@@ -466,10 +464,10 @@ export const MoveablePtzControl = props => {
|
|
|
466
464
|
// 处理因为状态更新不同步导致的闪烁问题
|
|
467
465
|
const activeViewRef = useRef(0);
|
|
468
466
|
const onDragStart = () => {
|
|
469
|
-
screenMode
|
|
467
|
+
screenMode !== MultiCameraScreenMode.short && event.emit(pauseTimeToHideAllComponent);
|
|
470
468
|
};
|
|
471
469
|
const onDragEnd = data => {
|
|
472
|
-
screenMode
|
|
470
|
+
screenMode !== MultiCameraScreenMode.short && event.emit(startTimeToHideAllComponent);
|
|
473
471
|
activeViewRef.current = activeViewRef.current === 0 ? 1 : 0;
|
|
474
472
|
setStyle(prev => _objectSpread(_objectSpread({}, prev), {}, {
|
|
475
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.
|
|
29
|
+
multiCameraCtx.togglePtz();
|
|
31
30
|
});
|
|
32
31
|
if (!selectedLenInfo.supportPTZ && !selectedLenInfo.supportZoom) {
|
|
33
32
|
return null;
|
|
@@ -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 } 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,7 +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
12
|
const {
|
|
16
13
|
devId,
|
|
17
14
|
positionLeft = 24,
|
|
@@ -47,7 +44,7 @@ export const PtzMoveableTip = props => {
|
|
|
47
44
|
storage.set(ptzMoveableTipId, true);
|
|
48
45
|
};
|
|
49
46
|
if (showTipModal && playState === PlayState.PLAYING) {
|
|
50
|
-
return /*#__PURE__*/React.createElement(
|
|
47
|
+
return /*#__PURE__*/React.createElement(CoverView, null, /*#__PURE__*/React.createElement(View, {
|
|
51
48
|
className: clsx(`${multiPrefix}-tile-tip-content`, `${multiPrefix}-ptz-tip`),
|
|
52
49
|
style: {
|
|
53
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';
|
|
@@ -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.
|
|
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,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 } 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,7 +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
12
|
const {
|
|
16
13
|
devId,
|
|
17
14
|
deleteContent,
|
|
@@ -40,7 +37,7 @@ export const TileTip = props => {
|
|
|
40
37
|
}
|
|
41
38
|
};
|
|
42
39
|
if (playState === PlayState.PLAYING) {
|
|
43
|
-
return /*#__PURE__*/React.createElement(
|
|
40
|
+
return /*#__PURE__*/React.createElement(CoverView, null, /*#__PURE__*/React.createElement(View, {
|
|
44
41
|
className: clsx(`${multiPrefix}-tile-tip-content`, `${multiPrefix}-${showTipModal}`)
|
|
45
42
|
}), /*#__PURE__*/React.createElement(Text, {
|
|
46
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';
|