@ray-js/ipc-player-integration 0.0.56-beta.0 → 0.0.57-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 +6 -0
- package/lib/ctx/ctx.composition.js +3 -13
- package/lib/ctx/ctx.js +35 -43
- package/lib/i18n/index.d.ts +0 -12
- package/lib/i18n/strings.d.ts +0 -6
- package/lib/i18n/strings.js +0 -6
- package/lib/index.d.ts +4 -0
- package/lib/index.js +3 -1
- package/lib/interface.d.ts +3 -16
- package/lib/renderer/capabilities.d.ts +8 -0
- package/lib/renderer/capabilities.js +19 -0
- package/lib/renderer/context.d.ts +5 -0
- package/lib/renderer/context.js +6 -0
- package/lib/renderer/directionControl.d.ts +6 -0
- package/lib/renderer/directionControl.js +3 -0
- package/lib/renderer/font.less +5 -0
- package/lib/renderer/glyphs.d.ts +1 -0
- package/lib/renderer/glyphs.js +256 -0
- package/lib/renderer/index.module.less +48 -0
- package/lib/renderer/ptzZoom.d.ts +6 -0
- package/lib/renderer/ptzZoom.js +3 -0
- package/lib/renderer/text.d.ts +4 -0
- package/lib/renderer/text.js +32 -0
- package/lib/renderer/text.module.less +4 -0
- package/lib/renderer/viewport.d.ts +7 -0
- package/lib/renderer/viewport.js +24 -0
- package/lib/res/lynx-signal/index.d.ts +1 -0
- package/lib/res/lynx-signal/index.js +22 -0
- 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/ui/bottomLeftContent.js +60 -17
- package/lib/ui/bottomRightContent.js +6 -3
- package/lib/ui/ui.d.ts +5 -0
- package/lib/ui/ui.js +59 -45
- package/lib/widgets/battery/battery.js +2 -1
- package/lib/widgets/battery/batteryFull.js +2 -1
- package/lib/widgets/floodlight/floodlight.js +2 -1
- package/lib/widgets/flowLowTip/flowLowTip.js +2 -1
- package/lib/widgets/fullScreen/fullScreen.js +2 -1
- package/lib/widgets/fullScreen/fullTravelRouteControl.d.ts +1 -1
- package/lib/widgets/fullScreen/fullTravelRouteControl.js +1 -1
- package/lib/widgets/fullScreen/verticalScreen.js +2 -1
- package/lib/widgets/index.d.ts +0 -1
- package/lib/widgets/index.js +1 -2
- package/lib/widgets/moveInteractiveControl/controlButton.js +2 -1
- package/lib/widgets/moveInteractiveControl/moveInteractiveControlUI.js +12 -3
- package/lib/widgets/moveInteractiveControl/moveInteractiveControlUI.less +24 -4
- package/lib/widgets/multiCamera/landscapeTip.js +2 -1
- package/lib/widgets/multiCamera/moveablePtzControl.js +1 -1
- package/lib/widgets/multiCamera/multiPtz.js +2 -1
- package/lib/widgets/multiCamera/ptzMoveableTip.js +2 -1
- package/lib/widgets/multiCamera/switchLayout.js +2 -1
- package/lib/widgets/multiCamera/tileMultiPtz.js +2 -1
- package/lib/widgets/multiCamera/tileSwitchLayout.js +2 -1
- package/lib/widgets/multiCamera/tileTip.js +2 -1
- package/lib/widgets/muted/muted.js +5 -13
- package/lib/widgets/muted/muted.less +1 -5
- package/lib/widgets/ptz/ptz.js +2 -1
- package/lib/widgets/ptz/ptzControl.js +1 -1
- package/lib/widgets/ptzControlTip/ptzControlTip.js +6 -3
- package/lib/widgets/ptzControlTip/ptzControlTip.less +6 -0
- package/lib/widgets/realTimeMagnification/realTimeMagnification.js +2 -1
- package/lib/widgets/recordVideo/recordVideo.js +36 -50
- package/lib/widgets/recordVideo/recordVideo.less +74 -17
- package/lib/widgets/recordVideo/recordVideo.test.js +0 -1
- package/lib/widgets/resolution/fullResolutionControl.js +29 -19
- package/lib/widgets/resolution/resolution.js +3 -2
- package/lib/widgets/screenshot/screenshot.js +45 -66
- package/lib/widgets/screenshot/screenshot.less +40 -1
- package/lib/widgets/signal4G/signal4G.js +4 -1
- package/lib/widgets/siren/siren.js +2 -1
- package/lib/widgets/tempHumidity/tempHumidity.js +2 -1
- package/lib/widgets/toggleVerticalFull/toggleVerticalFull.js +2 -1
- package/lib/widgets/trialBadge/index.js +8 -3
- package/lib/widgets/trialBadge/index.less +24 -0
- package/lib/widgets/tryExperience/tryExperience.js +2 -1
- package/lib/widgets/videoBitKBP/videoBitKBP.js +2 -1
- package/lib/widgets/voiceIntercom/voiceIntercom.js +50 -24
- package/lib/widgets/voiceIntercom/voiceIntercom.less +16 -0
- package/lib/widgets/zoomTurntable/turntable/index.d.ts +5 -7
- package/lib/widgets/zoomTurntable/turntable/index.js +2 -1
- package/lib/widgets/zoomTurntable/zoomTurntableEntry.js +2 -1
- package/lib/widgets/zoomTurntable/zoomTurntableTip.js +2 -1
- package/package.json +15 -7
- package/lib/ctx/ctx.album.test.d.ts +0 -1
- package/lib/ctx/ctx.album.test.js +0 -197
- package/lib/ui/absoluteContent.d.ts +0 -2
- package/lib/ui/absoluteContent.js +0 -3
- package/lib/utils/captureResult.d.ts +0 -14
- package/lib/utils/captureResult.js +0 -70
- package/lib/utils/captureResult.test.d.ts +0 -1
- package/lib/utils/captureResult.test.js +0 -117
- package/lib/widgets/captureResult/captureResult.d.ts +0 -16
- package/lib/widgets/captureResult/captureResult.js +0 -85
- package/lib/widgets/captureResult/captureResult.less +0 -144
- package/lib/widgets/captureResult/captureResult.test.d.ts +0 -1
- package/lib/widgets/captureResult/captureResult.test.js +0 -80
- package/lib/widgets/captureResult/index.d.ts +0 -2
- package/lib/widgets/captureResult/index.js +0 -2
- package/lib/widgets/muted/muted.test.d.ts +0 -1
- package/lib/widgets/muted/muted.test.js +0 -78
- package/lib/widgets/screenshot/screenshot.test.d.ts +0 -1
- package/lib/widgets/screenshot/screenshot.test.js +0 -120
|
@@ -2,6 +2,7 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
|
2
2
|
import React, { useEffect, useRef } from 'react';
|
|
3
3
|
import { CoverView, View } from '@ray-js/ray';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
|
+
import { usePlayerRenderMode } from '../renderer/context';
|
|
5
6
|
import { useStore } from '../ctx/store';
|
|
6
7
|
import { useComponentHideState } from './hooks';
|
|
7
8
|
|
|
@@ -24,6 +25,7 @@ const BottomRightContent = _ref => {
|
|
|
24
25
|
bottomRightContent: ctx.bottomRightContent
|
|
25
26
|
});
|
|
26
27
|
const [shouldHide] = useComponentHideState();
|
|
28
|
+
const renderMode = usePlayerRenderMode();
|
|
27
29
|
const idRef = useRef(++rightClsSeq);
|
|
28
30
|
const wrapCls = `ipc-br-wrap-${idRef.current}`;
|
|
29
31
|
const lastWidthRef = useRef(0);
|
|
@@ -44,17 +46,18 @@ const BottomRightContent = _ref => {
|
|
|
44
46
|
onWidthChange === null || onWidthChange === void 0 || onWidthChange(w);
|
|
45
47
|
}
|
|
46
48
|
attempts += 1;
|
|
47
|
-
|
|
49
|
+
// Lynx 首轮加密测量以尽快收敛,WebView 保持原有节奏。
|
|
50
|
+
if (attempts >= (renderMode === 'lynx' ? 20 : 15)) {
|
|
48
51
|
return;
|
|
49
52
|
}
|
|
50
|
-
timer = setTimeout(measure, 400);
|
|
53
|
+
timer = setTimeout(measure, renderMode === 'lynx' && attempts < 8 ? 150 : 400);
|
|
51
54
|
});
|
|
52
55
|
};
|
|
53
56
|
timer = setTimeout(measure, 60);
|
|
54
57
|
return () => {
|
|
55
58
|
if (timer) clearTimeout(timer);
|
|
56
59
|
};
|
|
57
|
-
}, [screenType, playState, bottomRightContent === null || bottomRightContent === void 0 ? void 0 : bottomRightContent.length, shouldHide, wrapCls, onWidthChange]);
|
|
60
|
+
}, [screenType, playState, bottomRightContent === null || bottomRightContent === void 0 ? void 0 : bottomRightContent.length, shouldHide, wrapCls, onWidthChange, renderMode]);
|
|
58
61
|
const containerHeight = screenType === 'vertical' ? 48 : 58;
|
|
59
62
|
|
|
60
63
|
// 将 width 统一规范成 CSS 合法值。number → "${n}px",string → 原样透传。
|
package/lib/ui/ui.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { PlayerRenderMode } from '../renderer/context';
|
|
3
|
+
import { LynxPlayerAdapters } from '../renderer/capabilities';
|
|
2
4
|
import { PlayStatusData, UseCtx, EventInstance } from '../interface';
|
|
3
5
|
import './ui.less';
|
|
4
6
|
type CtxInstance = ReturnType<UseCtx>;
|
|
@@ -14,6 +16,9 @@ type CSSVariable = {
|
|
|
14
16
|
'--fontSize': string;
|
|
15
17
|
};
|
|
16
18
|
type Props = {
|
|
19
|
+
renderMode?: PlayerRenderMode;
|
|
20
|
+
/** Required when Lynx enables widgets backed by WebView-only renderers. */
|
|
21
|
+
lynxAdapters?: LynxPlayerAdapters;
|
|
17
22
|
devId: string;
|
|
18
23
|
isShare?: boolean;
|
|
19
24
|
ignoreHideStopPreview?: boolean;
|
package/lib/ui/ui.js
CHANGED
|
@@ -12,6 +12,10 @@ import clsx from 'clsx';
|
|
|
12
12
|
import IPCPlayer from '@ray-js/ray-ipc-player';
|
|
13
13
|
import { ipcTTTOperatorLog } from '@ray-js/ray-ipc-utils';
|
|
14
14
|
import { ClarityType } from '@ray-js/ray-ipc-utils/lib/interface';
|
|
15
|
+
import { PlayerRenderModeContext, PlayerControlVisibilityContext } from '../renderer/context';
|
|
16
|
+
import lynxStyles from '../renderer/index.module.less';
|
|
17
|
+
import { getPlayerViewport } from '../renderer/viewport';
|
|
18
|
+
import { LynxPlayerAdaptersContext } from '../renderer/capabilities';
|
|
15
19
|
import { PlayState, PlayerStreamStatus, MultiCameraScreenMode } from '../interface';
|
|
16
20
|
import { useCtx } from '../ctx/ctx.composition';
|
|
17
21
|
import { useStore, updateAtom, getDefaultStore } from '../ctx/store';
|
|
@@ -28,9 +32,7 @@ import { Storage } from '../utils/storage';
|
|
|
28
32
|
import './ui.less';
|
|
29
33
|
import { updatePlayerWidgetProps } from '../features';
|
|
30
34
|
import { getNgRawData, getSmartImageQualityState, isLowPhone } from '../utils/ttt';
|
|
31
|
-
import { getCaptureResultSummary } from '../utils/captureResult';
|
|
32
35
|
import { lensCount } from '../widgets/zoomTurntable/lensSkill';
|
|
33
|
-
import { shouldRenderContent } from './absoluteContent';
|
|
34
36
|
const AutoClarityOnly = _ref => {
|
|
35
37
|
let {
|
|
36
38
|
instance
|
|
@@ -101,6 +103,7 @@ const SCALE_MATCH_EPS = 0.01;
|
|
|
101
103
|
const BOTTOM_RIGHT_SAFE_GAP = 4;
|
|
102
104
|
export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
103
105
|
const {
|
|
106
|
+
renderMode = 'webview',
|
|
104
107
|
className,
|
|
105
108
|
devId,
|
|
106
109
|
style,
|
|
@@ -688,16 +691,14 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
688
691
|
ipcTTTOperatorLog('hide: 调用停止录制方法');
|
|
689
692
|
setRecording(false, true);
|
|
690
693
|
setIntercom(false, true);
|
|
691
|
-
instance === null || instance === void 0 || instance.
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
}).catch(() => {
|
|
700
|
-
ipcTTTOperatorLog('hide: 调用停止录制方法失败');
|
|
694
|
+
instance === null || instance === void 0 || instance.IPCPlayerInstance.stopRecord({
|
|
695
|
+
saveToAlbum: 1,
|
|
696
|
+
success: () => {
|
|
697
|
+
ipcTTTOperatorLog('hide: 调用停止录制方法成功');
|
|
698
|
+
},
|
|
699
|
+
fail: () => {
|
|
700
|
+
ipcTTTOperatorLog('hide: 调用停止录制方法失败');
|
|
701
|
+
}
|
|
701
702
|
});
|
|
702
703
|
ipcTTTOperatorLog('hide: 调用停止对讲方法');
|
|
703
704
|
instance === null || instance === void 0 || instance.IPCPlayerInstance.stopTalk({
|
|
@@ -1091,22 +1092,31 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
1091
1092
|
});
|
|
1092
1093
|
const playerContainerHeight = screenType === 'vertical' ? (style === null || style === void 0 ? void 0 : style.height) || '100%' : '100vh';
|
|
1093
1094
|
const isVerticalFullMode = isVerticalFullLayout && screenType === 'vertical';
|
|
1094
|
-
|
|
1095
|
+
const lynxVerticalFull = renderMode === 'lynx' && isVerticalFullMode;
|
|
1096
|
+
const viewport = getPlayerViewport(renderMode, isVerticalFullMode, playerContainerHeight);
|
|
1097
|
+
return /*#__PURE__*/React.createElement(PlayerRenderModeContext.Provider, {
|
|
1098
|
+
value: renderMode
|
|
1099
|
+
}, /*#__PURE__*/React.createElement(LynxPlayerAdaptersContext.Provider, {
|
|
1100
|
+
value: props.lynxAdapters || {}
|
|
1101
|
+
}, /*#__PURE__*/React.createElement(UIEventContext.Provider, {
|
|
1095
1102
|
value: {
|
|
1096
1103
|
event: eventRef.current,
|
|
1097
1104
|
componentHideState,
|
|
1098
1105
|
refreshElement
|
|
1099
1106
|
}
|
|
1100
1107
|
}, /*#__PURE__*/React.createElement(View, {
|
|
1101
|
-
className: clsx('ipc-player-content', isSmallScreen && 'ipc-player-content-small-screen', className),
|
|
1108
|
+
className: clsx('ipc-player-content', renderMode === 'lynx' && lynxStyles.root, isSmallScreen && 'ipc-player-content-small-screen', className),
|
|
1102
1109
|
style: _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, defaultCSSVariable), CSSVariable), style), {}, {
|
|
1103
1110
|
height: playerContainerHeight
|
|
1104
|
-
}
|
|
1111
|
+
}, lynxVerticalFull ? {
|
|
1112
|
+
backgroundColor: '#000'
|
|
1113
|
+
} : {})
|
|
1105
1114
|
}, /*#__PURE__*/React.createElement(View, {
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1115
|
+
className: lynxVerticalFull ? lynxStyles.verticalViewport : undefined,
|
|
1116
|
+
style: viewport.style
|
|
1117
|
+
}, /*#__PURE__*/React.createElement(IPCPlayer, _extends({}, renderMode === 'lynx' ? {
|
|
1118
|
+
renderMode: 'lynx'
|
|
1119
|
+
} : {}, {
|
|
1110
1120
|
defaultMute: mute,
|
|
1111
1121
|
devId: devId,
|
|
1112
1122
|
onlineStatus: deviceOnline,
|
|
@@ -1125,7 +1135,7 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
1125
1135
|
onCameraNotifyWeakNetwork: data => {
|
|
1126
1136
|
console.log(`onCameraNotifyWeakNetwork: ${JSON.stringify(data)}`);
|
|
1127
1137
|
},
|
|
1128
|
-
clarity: decodeClarityDic[resolution],
|
|
1138
|
+
clarity: decodeClarityDic[String(resolution).toUpperCase()] || decodeClarityDic.HD,
|
|
1129
1139
|
onZoomChange: onZoomChange
|
|
1130
1140
|
// objectFit={
|
|
1131
1141
|
// screenType === 'vertical'
|
|
@@ -1139,7 +1149,7 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
1139
1149
|
// scaleMultiple={0}
|
|
1140
1150
|
,
|
|
1141
1151
|
awakeStatus: awakeStatus,
|
|
1142
|
-
objectFit:
|
|
1152
|
+
objectFit: viewport.objectFit,
|
|
1143
1153
|
scaleMultiple: scaleMultiple
|
|
1144
1154
|
// 安卓横屏问题
|
|
1145
1155
|
// ptzControllable={screenType === 'vertical'}
|
|
@@ -1159,17 +1169,17 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
1159
1169
|
// 这一下起,自动隐藏倒计时才开始生效
|
|
1160
1170
|
hasUserTappedPlayerRef.current = true;
|
|
1161
1171
|
if (instance.multiCameraCtx.isSupport) {
|
|
1162
|
-
var _instance$
|
|
1163
|
-
const preTapIndex = (_instance$
|
|
1172
|
+
var _instance$multiCamera, _instance$multiCamera2;
|
|
1173
|
+
const preTapIndex = (_instance$multiCamera = (_instance$multiCamera2 = instance.multiCameraCtx.selectedLenInfoRef.current) === null || _instance$multiCamera2 === void 0 ? void 0 : _instance$multiCamera2.index) !== null && _instance$multiCamera !== void 0 ? _instance$multiCamera : prevSelectedIndexRef.current;
|
|
1164
1174
|
const wasHidden = componentHideState;
|
|
1165
1175
|
instance.multiCameraCtx.selectVideoFiredRef.current = false;
|
|
1166
1176
|
if (multiTapTimerRef.current) {
|
|
1167
1177
|
clearTimeout(multiTapTimerRef.current);
|
|
1168
1178
|
}
|
|
1169
1179
|
multiTapTimerRef.current = setTimeout(() => {
|
|
1170
|
-
var _instance$
|
|
1180
|
+
var _instance$multiCamera3, _instance$multiCamera4;
|
|
1171
1181
|
const selectFired = !!instance.multiCameraCtx.selectVideoFiredRef.current;
|
|
1172
|
-
const currentIndex = (_instance$
|
|
1182
|
+
const currentIndex = (_instance$multiCamera3 = (_instance$multiCamera4 = instance.multiCameraCtx.selectedLenInfoRef.current) === null || _instance$multiCamera4 === void 0 ? void 0 : _instance$multiCamera4.index) !== null && _instance$multiCamera3 !== void 0 ? _instance$multiCamera3 : preTapIndex;
|
|
1173
1183
|
if (selectFired && currentIndex === preTapIndex) {
|
|
1174
1184
|
if (wasHidden) {
|
|
1175
1185
|
showComponents();
|
|
@@ -1221,9 +1231,11 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
1221
1231
|
limitFlow: limitFlow,
|
|
1222
1232
|
autoWakeUp: autoWakeUp,
|
|
1223
1233
|
extend: _objectSpread(_objectSpread({
|
|
1224
|
-
backgroundColor:
|
|
1234
|
+
backgroundColor: viewport.backgroundColor
|
|
1225
1235
|
}, instance.multiCameraCtx.extendProps), extend)
|
|
1226
|
-
})),
|
|
1236
|
+
}))), /*#__PURE__*/React.createElement(PlayerControlVisibilityContext.Provider, {
|
|
1237
|
+
value: !componentHideState && !refreshElement
|
|
1238
|
+
}, showTopContent && /*#__PURE__*/React.createElement(View, {
|
|
1227
1239
|
className: clsx('ipc-player-top-content', {
|
|
1228
1240
|
'ipc-player-top-content-hide': componentHideState,
|
|
1229
1241
|
'ipc-player-top-content-show': !componentHideState
|
|
@@ -1237,18 +1249,17 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
1237
1249
|
ctx: instance
|
|
1238
1250
|
}, renderTopRightContent, !hasVisibleBitrateWidget && /*#__PURE__*/React.createElement(AutoClarityOnly, {
|
|
1239
1251
|
instance: instance
|
|
1240
|
-
})))), /*#__PURE__*/React.createElement(
|
|
1241
|
-
instance: instance,
|
|
1242
|
-
show: !showTopContent || componentHideState || !playerReady
|
|
1243
|
-
}), /*#__PURE__*/React.createElement(View, {
|
|
1252
|
+
})))), /*#__PURE__*/React.createElement(View, {
|
|
1244
1253
|
className: clsx('ipc-player-bottom-content', {
|
|
1245
1254
|
'ipc-player-bottom-content-hide': componentHideState,
|
|
1246
1255
|
'ipc-player-bottom-content-show': !componentHideState,
|
|
1247
1256
|
'ipc-player-bottom-content-full': isVerticalFullMode
|
|
1248
1257
|
}),
|
|
1249
|
-
style: {
|
|
1258
|
+
style: _objectSpread({
|
|
1250
1259
|
height: screenType === 'vertical' ? '48px' : '72px'
|
|
1251
|
-
}
|
|
1260
|
+
}, lynxVerticalFull ? {
|
|
1261
|
+
paddingBottom: 0
|
|
1262
|
+
} : {})
|
|
1252
1263
|
}, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(BottomLeftContent, {
|
|
1253
1264
|
ctx: instance,
|
|
1254
1265
|
reservedRight: bottomRightReserved
|
|
@@ -1256,19 +1267,19 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
1256
1267
|
ctx: instance,
|
|
1257
1268
|
width: bottomRightStyleWidth,
|
|
1258
1269
|
onWidthChange: handleBottomRightWidthChange
|
|
1259
|
-
}, renderBottomRightContent))), (
|
|
1270
|
+
}, renderBottomRightContent)))), /*#__PURE__*/React.createElement(StandaloneAutoClarity, {
|
|
1271
|
+
instance: instance,
|
|
1272
|
+
show: !showTopContent || componentHideState || !playerReady
|
|
1273
|
+
}), (() => {
|
|
1260
1274
|
if (!absoluteContent || !(absoluteContent !== null && absoluteContent !== void 0 && absoluteContent.length)) return null;
|
|
1261
1275
|
return absoluteContent.map(item => {
|
|
1262
|
-
if (
|
|
1263
|
-
playState
|
|
1264
|
-
})) return null;
|
|
1265
|
-
const contentProps = _objectSpread(_objectSpread(_objectSpread({
|
|
1266
|
-
key: item.id
|
|
1267
|
-
}, item.initProps), instance), {}, {
|
|
1268
|
-
IPCPlayerContext: instance.IPCPlayerInstance
|
|
1269
|
-
});
|
|
1276
|
+
if (item.hidden) return null;
|
|
1270
1277
|
if (item.absoluteNoCoverView) {
|
|
1271
|
-
return /*#__PURE__*/React.createElement(item.content,
|
|
1278
|
+
return /*#__PURE__*/React.createElement(item.content, _objectSpread(_objectSpread(_objectSpread({
|
|
1279
|
+
key: item.id
|
|
1280
|
+
}, item.initProps), instance), {}, {
|
|
1281
|
+
IPCPlayerContext: instance.IPCPlayerInstance
|
|
1282
|
+
}));
|
|
1272
1283
|
}
|
|
1273
1284
|
return /*#__PURE__*/React.createElement(CoverView, {
|
|
1274
1285
|
key: item.id,
|
|
@@ -1276,10 +1287,13 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
1276
1287
|
position: 'absolute'
|
|
1277
1288
|
}, item.absolutePosition),
|
|
1278
1289
|
className: item.absoluteContentClassName
|
|
1279
|
-
}, /*#__PURE__*/React.createElement(item.content, _objectSpread(_objectSpread({
|
|
1290
|
+
}, /*#__PURE__*/React.createElement(item.content, _objectSpread(_objectSpread(_objectSpread({
|
|
1291
|
+
key: item.id
|
|
1292
|
+
}, item.initProps), instance), {}, {
|
|
1293
|
+
IPCPlayerContext: instance.IPCPlayerInstance,
|
|
1280
1294
|
// 添加通用变量单独组件类名
|
|
1281
1295
|
className: clsx('absolute-item-container')
|
|
1282
1296
|
})));
|
|
1283
1297
|
});
|
|
1284
|
-
})()));
|
|
1298
|
+
})()))));
|
|
1285
1299
|
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
|
-
import { View
|
|
2
|
+
import { View } from '@ray-js/ray';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
|
+
import { PlayerText as Text } from '../../renderer/text';
|
|
4
5
|
import { useStore } from '../../ctx/store';
|
|
5
6
|
import { PowerMode } from '../../ports.output';
|
|
6
7
|
import './battery.less';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
|
-
import { View
|
|
2
|
+
import { View } from '@ray-js/ray';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
|
+
import { PlayerText as Text } from '../../renderer/text';
|
|
4
5
|
import { useStore } from '../../ctx/store';
|
|
5
6
|
import { PowerMode } from '../../ports.output';
|
|
6
7
|
import './battery.less';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { View
|
|
1
|
+
import { View } from '@ray-js/ray';
|
|
2
2
|
import React, { useContext } from 'react';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
|
+
import { PlayerText as Text } from '../../renderer/text';
|
|
4
5
|
import { useDpState } from '../../hooks';
|
|
5
6
|
import { useStore } from '../../ctx/store';
|
|
6
7
|
import { UIEventContext } from '../../ui/context';
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { View
|
|
1
|
+
import { View } from '@ray-js/ray';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import React, { useEffect, useRef, useState } from 'react';
|
|
4
4
|
import { getServiceUrl } from '@ray-js/ray-ipc-utils';
|
|
5
5
|
import { useMemoizedFn } from 'ahooks';
|
|
6
|
+
import { PlayerText as Text } from '../../renderer/text';
|
|
6
7
|
import Strings from '../../i18n';
|
|
7
8
|
import { useStore } from '../../ctx/store';
|
|
8
9
|
import { showFlowLowTipId } from '../../ui/constant';
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
import React, { useContext, useEffect, useMemo } from 'react';
|
|
3
|
-
import { View, setPageOrientation,
|
|
3
|
+
import { View, setPageOrientation, hideMenuButton, showMenuButton, showStatusBar, hideStatusBar, setNavigationBarBack, getSystemInfoSync } from '@ray-js/ray';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import { unstable_batchedUpdates as batchedUpdates } from '@ray-core/ray';
|
|
6
|
+
import { PlayerText as Text } from '../../renderer/text';
|
|
6
7
|
import { UIEventContext } from '../../ui/context';
|
|
7
8
|
import { showAllComponent, voiceIntercomId, verticalScreenId, fullTravelRouteControlId, ptzControlId, fullResolutionId, fullSmallIntercomId, pauseTimeToHideAllComponent, widgetLabs, widgetClick } from '../../ui/constant';
|
|
8
9
|
import { useStore } from '../../ctx/store';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* 全屏状态下要添加的摄像机行进路线控件
|
|
3
3
|
*/
|
|
4
4
|
import React from 'react';
|
|
5
|
-
import RectDirectionControl from '
|
|
5
|
+
import RectDirectionControl from '../../renderer/directionControl';
|
|
6
6
|
import type { ComponentConfigProps } from '../../interface';
|
|
7
7
|
type RectDirectionControlProps = React.ComponentProps<typeof RectDirectionControl>;
|
|
8
8
|
export type FullTravelRouteControlProps = ComponentConfigProps & {
|
|
@@ -6,8 +6,8 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
6
6
|
import React, { useEffect, useContext, useState, useRef } from 'react';
|
|
7
7
|
import { View } from '@ray-js/ray';
|
|
8
8
|
import clsx from 'clsx';
|
|
9
|
-
import RectDirectionControl from '@ray-js/direction-control';
|
|
10
9
|
import { useMemoizedFn } from 'ahooks';
|
|
10
|
+
import RectDirectionControl from '../../renderer/directionControl';
|
|
11
11
|
import { UIEventContext } from '../../ui/context';
|
|
12
12
|
import { useDpState } from '../../hooks';
|
|
13
13
|
import { useComponentHideState } from '../../ui/hooks';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { View
|
|
2
|
+
import { View } from '@ray-js/ray';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
|
+
import { PlayerText as Text } from '../../renderer/text';
|
|
4
5
|
import './verticalScreen.less';
|
|
5
6
|
const NILL = () => null;
|
|
6
7
|
export function VerticalScreen(_ref) {
|
package/lib/widgets/index.d.ts
CHANGED
package/lib/widgets/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { useContext } from 'react';
|
|
2
|
-
import { View
|
|
2
|
+
import { View } from '@ray-js/ray';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
|
+
import { PlayerText as Text } from '../../renderer/text';
|
|
4
5
|
import { useStore } from '../../ctx/store';
|
|
5
6
|
import { UIEventContext } from '../../ui/context';
|
|
6
7
|
import { hideAllComponent, widgetLabs, widgetClick } from '../../ui/constant';
|
|
@@ -4,6 +4,8 @@ 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';
|
|
7
9
|
import './moveInteractiveControlUI.less';
|
|
8
10
|
const defaultMenu = [{
|
|
9
11
|
key: '0',
|
|
@@ -62,6 +64,7 @@ const defaultCSSVariable = {
|
|
|
62
64
|
'--activeColor': '#FF592A'
|
|
63
65
|
};
|
|
64
66
|
export function MoveInterActiveControlUI(props) {
|
|
67
|
+
const isLynx = usePlayerRenderMode() === 'lynx';
|
|
65
68
|
const {
|
|
66
69
|
contentClsName,
|
|
67
70
|
wrapClsName,
|
|
@@ -80,13 +83,17 @@ export function MoveInterActiveControlUI(props) {
|
|
|
80
83
|
// @ts-ignore
|
|
81
84
|
, {
|
|
82
85
|
style: _objectSpread({}, CSSVariable),
|
|
83
|
-
className: clsx('ipc-player-plugin-active-control-wrap', wrapClsName
|
|
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
|
+
})
|
|
84
90
|
}, /*#__PURE__*/React.createElement(View, {
|
|
85
91
|
className: clsx('ipc-player-plugin-active-control-title')
|
|
86
92
|
}, I18n.t('homeFeatureInteractiveMenuTitle')), /*#__PURE__*/React.createElement(ScrollView, {
|
|
87
93
|
style: {
|
|
88
94
|
flex: 1
|
|
89
95
|
},
|
|
96
|
+
className: isLynx ? 'ipc-player-plugin-active-control-scroll-lynx' : undefined,
|
|
90
97
|
scrollY: true
|
|
91
98
|
}, /*#__PURE__*/React.createElement(View, {
|
|
92
99
|
className: clsx('ipc-player-plugin-active-control', contentClsName)
|
|
@@ -98,9 +105,11 @@ export function MoveInterActiveControlUI(props) {
|
|
|
98
105
|
})
|
|
99
106
|
}, /*#__PURE__*/React.createElement(View, {
|
|
100
107
|
className: clsx('ipc-player-plugin-active-control-item-icon')
|
|
101
|
-
}, /*#__PURE__*/React.createElement(View, {
|
|
108
|
+
}, !isLynx && /*#__PURE__*/React.createElement(View, {
|
|
102
109
|
className: clsx('ipc-player-plugin-active-control-item-icon-mask')
|
|
103
|
-
}), /*#__PURE__*/React.createElement(
|
|
110
|
+
}), isLynx ? /*#__PURE__*/React.createElement(PlayerText, {
|
|
111
|
+
className: clsx('icon-panel', item.iconName, 'ipc-player-plugin-interactive-icon')
|
|
112
|
+
}) : /*#__PURE__*/React.createElement(View, {
|
|
104
113
|
className: clsx('icon-panel', item.iconName, 'ipc-player-plugin-interactive-icon')
|
|
105
114
|
})), /*#__PURE__*/React.createElement(View, {
|
|
106
115
|
className: clsx('ipc-player-plugin-active-control-item-title')
|
|
@@ -43,8 +43,6 @@
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
.ipc-player-plugin-active-control-item-icon {
|
|
46
|
-
position: relative;
|
|
47
|
-
z-index: 1;
|
|
48
46
|
width: calc(42px * var(--ipc-player-size-scale, 1));
|
|
49
47
|
height: calc(42px * var(--ipc-player-size-scale, 1));
|
|
50
48
|
border-radius: calc(42px * var(--ipc-player-size-scale, 1));
|
|
@@ -54,7 +52,6 @@
|
|
|
54
52
|
justify-content: center;
|
|
55
53
|
font-size: calc(16px * var(--ipc-player-size-scale, 1));
|
|
56
54
|
color: var(--color);
|
|
57
|
-
overflow: hidden;
|
|
58
55
|
.ipc-player-plugin-active-control-item-icon-mask {
|
|
59
56
|
position: absolute;
|
|
60
57
|
width: 100%;
|
|
@@ -64,6 +61,14 @@
|
|
|
64
61
|
opacity: 1;
|
|
65
62
|
}
|
|
66
63
|
}
|
|
64
|
+
|
|
65
|
+
.ipc-player-plugin-active-control-wrap-webview {
|
|
66
|
+
.ipc-player-plugin-active-control-item-icon {
|
|
67
|
+
position: relative;
|
|
68
|
+
z-index: 1;
|
|
69
|
+
overflow: hidden;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
67
72
|
.ipc-player-plugin-active-control-item-title {
|
|
68
73
|
width: calc(70px * var(--ipc-player-size-scale, 1));
|
|
69
74
|
white-space: nowrap; /* 防止文本换行 */
|
|
@@ -73,4 +78,19 @@
|
|
|
73
78
|
}
|
|
74
79
|
.ipc-player-plugin-interactive-icon {
|
|
75
80
|
font-size: calc(20px * var(--ipc-player-size-scale, 1));;
|
|
76
|
-
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.ipc-player-plugin-active-control-wrap-lynx {
|
|
84
|
+
min-height: 0;
|
|
85
|
+
|
|
86
|
+
.ipc-player-plugin-active-control-scroll-lynx {
|
|
87
|
+
height: 0;
|
|
88
|
+
min-height: 0;
|
|
89
|
+
overflow: hidden;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.ipc-player-plugin-active-control-item-icon {
|
|
93
|
+
// The background belongs to the scrolling card, not a separate absolute layer.
|
|
94
|
+
background: var(--iconBgColor);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import { View, CoverView
|
|
2
|
+
import { View, CoverView } from '@ray-js/ray';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
|
+
import { PlayerText as Text } from '../../renderer/text';
|
|
4
5
|
import { useStore } from '../../ctx/store';
|
|
5
6
|
import { landscapeTipId } from '../../ui/constant';
|
|
6
7
|
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 '
|
|
10
|
+
import IpcPtzZoom from '../../renderer/ptzZoom';
|
|
11
11
|
import { useStore } from '../../ctx/store';
|
|
12
12
|
import { useMemoizedFn } from '../../hooks';
|
|
13
13
|
import { MultiCameraScreenMode } from '../../interface';
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
-
import { View
|
|
2
|
+
import { View } from '@ray-js/ray';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { useMemoizedFn } from 'ahooks';
|
|
6
|
+
import { PlayerText as Text } from '../../renderer/text';
|
|
6
7
|
import { useStore } from '../../ctx/store';
|
|
7
8
|
import './index.less';
|
|
8
9
|
/**
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { useMemo, useState } from 'react';
|
|
2
|
-
import { View, CoverView
|
|
2
|
+
import { View, CoverView } from '@ray-js/ray';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
|
+
import { PlayerText as Text } from '../../renderer/text';
|
|
4
5
|
import { useStore } from '../../ctx/store';
|
|
5
6
|
import { ptzMoveableTipId } from '../../ui/constant';
|
|
6
7
|
import { PlayState } from '../../interface';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { View } from '@ray-js/ray';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import React, { useMemo } from 'react';
|
|
4
|
+
import { PlayerText as Text } from '../../renderer/text';
|
|
4
5
|
import { useStore } from '../../ctx/store';
|
|
5
6
|
import { MultiCameraLayoutStyle, MultiCameraScreenMode } from '../../interface';
|
|
6
7
|
import { multiPrefix } from './constants';
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
-
import { View
|
|
2
|
+
import { View } from '@ray-js/ray';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { useMemoizedFn } from 'ahooks';
|
|
6
6
|
import Color from 'color';
|
|
7
|
+
import { PlayerText as Text } from '../../renderer/text';
|
|
7
8
|
import { useStore } from '../../ctx/store';
|
|
8
9
|
import { multiPrefix } from './constants';
|
|
9
10
|
import './index.less';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { View
|
|
1
|
+
import { View } from '@ray-js/ray';
|
|
2
2
|
import React, { useMemo } from 'react';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
|
+
import { PlayerText as Text } from '../../renderer/text';
|
|
4
5
|
import { MultiCameraLayoutStyle } from '../../interface';
|
|
5
6
|
import { multiPrefix } from './constants';
|
|
6
7
|
import { useStore } from '../../ctx/store';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import { View, CoverView
|
|
2
|
+
import { View, CoverView } from '@ray-js/ray';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
|
+
import { PlayerText as Text } from '../../renderer/text';
|
|
4
5
|
import { useStore } from '../../ctx/store';
|
|
5
6
|
import { tileTipId } from '../../ui/constant';
|
|
6
7
|
import { PlayState } from '../../interface';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { View
|
|
1
|
+
import { View } from '@ray-js/ray';
|
|
2
2
|
import React, { useContext } from 'react';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
|
+
import { PlayerText as Text } from '../../renderer/text';
|
|
4
5
|
import { useStore } from '../../ctx/store';
|
|
5
6
|
import { UIEventContext } from '../../ui/context';
|
|
6
7
|
import { widgetLabs, widgetClick, pauseTimeToHideAllComponent, startTimeToHideAllComponent } from '../../ui/constant';
|
|
7
|
-
import { IntercomMode } from '../../interface';
|
|
8
8
|
import './muted.less';
|
|
9
9
|
export const Muted = props => {
|
|
10
10
|
const {
|
|
@@ -18,21 +18,13 @@ export const Muted = props => {
|
|
|
18
18
|
} = useContext(UIEventContext);
|
|
19
19
|
const event = propsEvent !== null && propsEvent !== void 0 ? propsEvent : ctxEvent;
|
|
20
20
|
const {
|
|
21
|
-
isMuted
|
|
22
|
-
intercom,
|
|
23
|
-
intercomMode
|
|
21
|
+
isMuted
|
|
24
22
|
} = useStore({
|
|
25
|
-
isMuted: mute
|
|
26
|
-
intercom: props.intercom,
|
|
27
|
-
intercomMode: props.intercomMode
|
|
23
|
+
isMuted: mute
|
|
28
24
|
});
|
|
29
|
-
const disabled = intercom && intercomMode === IntercomMode.OneWay;
|
|
30
25
|
return /*#__PURE__*/React.createElement(View, {
|
|
31
|
-
className: clsx(className,
|
|
32
|
-
'ipc-player-plugin-muted-disabled': disabled
|
|
33
|
-
}),
|
|
26
|
+
className: clsx(className),
|
|
34
27
|
onClick: () => {
|
|
35
|
-
if (disabled) return;
|
|
36
28
|
event.emit(widgetClick, {
|
|
37
29
|
widgetId: widgetLabs.MUTED
|
|
38
30
|
});
|
package/lib/widgets/ptz/ptz.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
-
import { View
|
|
2
|
+
import { View } 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';
|
|
6
7
|
import { UIEventContext } from '../../ui/context';
|
|
7
8
|
import { usePtz } from '../../hooks';
|
|
8
9
|
import { useStore } from '../../ctx/store';
|