@ray-js/ipc-player-integration 0.0.68-beta.0 → 0.0.70-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
package/lib/ui/ui.js
CHANGED
|
@@ -6,34 +6,31 @@ import "core-js/modules/esnext.iterator.find.js";
|
|
|
6
6
|
import "core-js/modules/esnext.iterator.map.js";
|
|
7
7
|
import "core-js/modules/esnext.iterator.some.js";
|
|
8
8
|
import React, { useContext, useState, useRef, useMemo, useEffect, useImperativeHandle } from 'react';
|
|
9
|
-
import { View, getSystemInfoSync, usePageEvent, setNavigationBarBack, setPageOrientation, getCurrentPages } from '@ray-js/ray';
|
|
9
|
+
import { View, CoverView, getSystemInfoSync, usePageEvent, setNavigationBarBack, setPageOrientation, getCurrentPages } from '@ray-js/ray';
|
|
10
10
|
import { unstable_batchedUpdates as batchedUpdates } from '@ray-core/ray';
|
|
11
11
|
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 { getPlayerOverlayHost } from '../renderer/overlay';
|
|
16
|
-
import { PlayerRenderModeContext, PlayerControlVisibilityContext } from '../renderer/context';
|
|
17
|
-
import lynxStyles from '../renderer/index.module.less';
|
|
18
|
-
import { getPlayerViewport } from '../renderer/viewport';
|
|
19
|
-
import { LynxPlayerAdaptersContext } from '../renderer/capabilities';
|
|
20
15
|
import { PlayState, PlayerStreamStatus, MultiCameraScreenMode } from '../interface';
|
|
21
16
|
import { useCtx } from '../ctx/ctx.composition';
|
|
22
|
-
import { useStore, updateAtom
|
|
17
|
+
import { useStore, updateAtom } from '../ctx/store';
|
|
23
18
|
import { UIEventContext } from './context';
|
|
24
|
-
import { showAllComponent, hideAllComponent, playerTap, startTimeToHideAllComponent, pauseTimeToHideAllComponent, decodeClarityDic, changeIgnoreHideStopPreview, moveablePtzControlId, tileActionsId, tileTipId, landscapeTipId, multiPtzId, ptzMoveableTipId, showFlowLowTipId, zoomLevelChange, setScaleMultipleEvent, trialCountdownEnd, refreshSmartImageQualityEvent } from './constant';
|
|
19
|
+
import { showAllComponent, hideAllComponent, playerTap, startTimeToHideAllComponent, pauseTimeToHideAllComponent, decodeClarityDic, changeIgnoreHideStopPreview, moveablePtzControlId, tileActionsId, tileTipId, landscapeTipId, multiPtzId, ptzMoveableTipId, ptzControlTipId, showFlowLowTipId, zoomLevelChange, setScaleMultipleEvent, trialCountdownEnd, refreshSmartImageQualityEvent } from './constant';
|
|
25
20
|
import BottomLeftContent from './bottomLeftContent';
|
|
26
21
|
import BottomRightContent from './bottomRightContent';
|
|
27
22
|
import TopLeftContent from './topLeftContent';
|
|
28
23
|
import TopRightContent from './topRightContent';
|
|
29
24
|
import { useOfflineShownNotification } from './useOfflineShownNotification';
|
|
30
|
-
import { FlowLowTip, VideoBitKBP } from '../widgets';
|
|
25
|
+
import { FlowLowTip, VideoBitKBP, zoomTurntableTipId } from '../widgets';
|
|
31
26
|
import { useMemoizedFn } from '../hooks';
|
|
32
27
|
import { Storage } from '../utils/storage';
|
|
33
28
|
import './ui.less';
|
|
34
29
|
import { updatePlayerWidgetProps } from '../features';
|
|
35
30
|
import { getNgRawData, getSmartImageQualityState, isLowPhone } from '../utils/ttt';
|
|
31
|
+
import { getCaptureResultSummary } from '../utils/captureResult';
|
|
36
32
|
import { lensCount } from '../widgets/zoomTurntable/lensSkill';
|
|
33
|
+
import { shouldRenderContent } from './absoluteContent';
|
|
37
34
|
const AutoClarityOnly = _ref => {
|
|
38
35
|
let {
|
|
39
36
|
instance
|
|
@@ -105,7 +102,6 @@ const SCALE_MATCH_EPS = 0.01;
|
|
|
105
102
|
const BOTTOM_RIGHT_SAFE_GAP = 4;
|
|
106
103
|
export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
107
104
|
const {
|
|
108
|
-
renderMode = 'webview',
|
|
109
105
|
className,
|
|
110
106
|
devId,
|
|
111
107
|
style,
|
|
@@ -130,7 +126,6 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
130
126
|
previewEnabled = undefined,
|
|
131
127
|
onPreviewEnabledChange
|
|
132
128
|
} = props;
|
|
133
|
-
const OverlayView = getPlayerOverlayHost(renderMode);
|
|
134
129
|
const {
|
|
135
130
|
event
|
|
136
131
|
} = useContext(UIEventContext);
|
|
@@ -336,6 +331,10 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
336
331
|
maxZoomSettings: instance.maxZoomSettings,
|
|
337
332
|
zoomSkill: instance.zoomSkill
|
|
338
333
|
});
|
|
334
|
+
const hasVisibleGuideTip = absoluteContent === null || absoluteContent === void 0 ? void 0 : absoluteContent.some(item => [tileTipId, landscapeTipId, ptzMoveableTipId, ptzControlTipId, zoomTurntableTipId].includes(item.id) && playState === PlayState.PLAYING && shouldRenderContent(item, {
|
|
335
|
+
playState
|
|
336
|
+
}));
|
|
337
|
+
const hasPendingLayoutGuide = (absoluteContent === null || absoluteContent === void 0 ? void 0 : absoluteContent.some(item => item.id === tileTipId)) && !new Storage(devId).getSync(tileTipId);
|
|
339
338
|
|
|
340
339
|
// 默认最大缩放倍数下发给播放器;多镜头设备的上限要按当前镜头换算,交给 zoomTurntable 下发
|
|
341
340
|
useEffect(() => {
|
|
@@ -454,6 +453,19 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
454
453
|
multiCameraCtx.setPtzStatus(false);
|
|
455
454
|
}, null);
|
|
456
455
|
}, [screenMode, instance]);
|
|
456
|
+
useEffect(() => {
|
|
457
|
+
const {
|
|
458
|
+
multiCameraCtx
|
|
459
|
+
} = instance;
|
|
460
|
+
if (!multiCameraCtx.isSupport || screenMode !== MultiCameraScreenMode.full || hasPendingLayoutGuide) {
|
|
461
|
+
return;
|
|
462
|
+
}
|
|
463
|
+
if (selectedLenInfo.supportPTZ) {
|
|
464
|
+
multiCameraCtx.openDefaultPtz();
|
|
465
|
+
} else if (!selectedLenInfo.supportZoom) {
|
|
466
|
+
multiCameraCtx.setPtzStatus(false);
|
|
467
|
+
}
|
|
468
|
+
}, [instance, screenMode, selectedLenInfo.index, selectedLenInfo.supportPTZ, selectedLenInfo.supportZoom, hasPendingLayoutGuide]);
|
|
457
469
|
useEffect(() => {
|
|
458
470
|
if (!instance.multiCameraCtx.isSupport) return;
|
|
459
471
|
|
|
@@ -461,13 +473,16 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
461
473
|
instance.multiCameraCtx.getNextLayoutStyle().then(res => {
|
|
462
474
|
instance.multiCameraCtx.setNextLayoutStyle(res);
|
|
463
475
|
});
|
|
476
|
+
if (isVerticalFullLayout && screenType === 'vertical') {
|
|
477
|
+
showComponents();
|
|
478
|
+
}
|
|
464
479
|
}, [layoutStyle, screenMode, instance]);
|
|
465
480
|
useEffect(() => {
|
|
466
481
|
if (!instance.multiCameraCtx.isSupport) return;
|
|
467
482
|
|
|
468
483
|
// 组件隐藏时也隐藏镜头名
|
|
469
484
|
instance.multiCameraCtx.showLenNames(!componentHideState);
|
|
470
|
-
}, [componentHideState, instance]);
|
|
485
|
+
}, [componentHideState, instance, layoutStyle, screenMode]);
|
|
471
486
|
useEffect(() => {
|
|
472
487
|
if (!instance.multiCameraCtx.isSupport) return;
|
|
473
488
|
if (ptzStatus) {
|
|
@@ -478,7 +493,7 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
478
493
|
}, [instance, ptzStatus]);
|
|
479
494
|
useEffect(() => {
|
|
480
495
|
if (!instance.multiCameraCtx.isSupport) return;
|
|
481
|
-
if (!ptzStatus || screenMode !== MultiCameraScreenMode.full) {
|
|
496
|
+
if (!ptzStatus || screenMode !== MultiCameraScreenMode.full || componentHideState || hasPendingLayoutGuide) {
|
|
482
497
|
instance.hideContent('absolute', ptzMoveableTipId);
|
|
483
498
|
}
|
|
484
499
|
|
|
@@ -492,11 +507,11 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
492
507
|
|
|
493
508
|
// ptz 提示
|
|
494
509
|
const storage = new Storage(devId);
|
|
495
|
-
if (!storage.getSync(ptzMoveableTipId) && selectedLenInfo.supportPTZ && screenMode === MultiCameraScreenMode.full) {
|
|
510
|
+
if (!storage.getSync(ptzMoveableTipId) && !hasPendingLayoutGuide && !componentHideState && selectedLenInfo.supportPTZ && screenMode === MultiCameraScreenMode.full) {
|
|
496
511
|
instance.showContent('absolute', ptzMoveableTipId);
|
|
497
512
|
}
|
|
498
513
|
}
|
|
499
|
-
}, [instance, ptzStatus, selectedLenInfo, componentHideState, screenMode]);
|
|
514
|
+
}, [instance, ptzStatus, selectedLenInfo, componentHideState, screenMode, hasPendingLayoutGuide]);
|
|
500
515
|
|
|
501
516
|
// 适配横屏进入面板的情况
|
|
502
517
|
useEffect(() => {
|
|
@@ -513,8 +528,6 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
513
528
|
const handDisablePlayerTap = useMemoizedFn(value => {
|
|
514
529
|
disablePlayerTap.current = !!value;
|
|
515
530
|
});
|
|
516
|
-
|
|
517
|
-
// 须在竖屏全屏 effect 之前注册,否则多目首帧 emit('disablePlayerTap') 时 listener 尚未挂载
|
|
518
531
|
useEffect(() => {
|
|
519
532
|
eventRef.current.on('disablePlayerTap', handDisablePlayerTap);
|
|
520
533
|
return () => {
|
|
@@ -524,17 +537,10 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
524
537
|
|
|
525
538
|
// 竖屏全屏副作用处理
|
|
526
539
|
useEffect(() => {
|
|
540
|
+
eventRef.current.emit('disablePlayerTap', false);
|
|
541
|
+
showComponents();
|
|
527
542
|
if (isVerticalFullLayout && screenType === 'vertical') {
|
|
528
|
-
// 竖屏全屏时,控件常驻显示
|
|
529
|
-
eventRef.current.emit(showAllComponent);
|
|
530
|
-
eventRef.current.emit('disablePlayerTap', true);
|
|
531
|
-
eventRef.current.emit(pauseTimeToHideAllComponent);
|
|
532
|
-
// 按宽填充,保证播放流宽度为屏幕宽度,高度自适应设为1倍
|
|
533
543
|
setScaleMultiple(1);
|
|
534
|
-
} else {
|
|
535
|
-
// 短屏或横屏时,恢复自动隐藏
|
|
536
|
-
eventRef.current.emit('disablePlayerTap', false);
|
|
537
|
-
showComponents();
|
|
538
544
|
}
|
|
539
545
|
}, [isVerticalFullLayout, screenType, playerFit]);
|
|
540
546
|
useEffect(() => {
|
|
@@ -693,14 +699,16 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
693
699
|
ipcTTTOperatorLog('hide: 调用停止录制方法');
|
|
694
700
|
setRecording(false, true);
|
|
695
701
|
setIntercom(false, true);
|
|
696
|
-
instance === null || instance === void 0 || instance.
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
}
|
|
702
|
+
instance === null || instance === void 0 || instance.stopRecordingOnUnload().then(async result => {
|
|
703
|
+
var _instance$multiLens, _instance$multiCamera;
|
|
704
|
+
const summary = await getCaptureResultSummary(result, {
|
|
705
|
+
multiLens: (_instance$multiLens = instance === null || instance === void 0 ? void 0 : instance.multiLens) !== null && _instance$multiLens !== void 0 ? _instance$multiLens : false,
|
|
706
|
+
lensIndices: instance === null || instance === void 0 || (_instance$multiCamera = instance.multiCameraCtx) === null || _instance$multiCamera === void 0 || (_instance$multiCamera = _instance$multiCamera.protocol) === null || _instance$multiCamera === void 0 || (_instance$multiCamera = _instance$multiCamera.split_info) === null || _instance$multiCamera === void 0 ? void 0 : _instance$multiCamera.map(lens => lens.index),
|
|
707
|
+
devId
|
|
708
|
+
});
|
|
709
|
+
ipcTTTOperatorLog(summary !== null && summary !== void 0 && summary.isMultiLens ? `hide: stop recording succeeded with ${summary.count} thumbnails` : 'hide: 调用停止录制方法成功');
|
|
710
|
+
}).catch(() => {
|
|
711
|
+
ipcTTTOperatorLog('hide: 调用停止录制方法失败');
|
|
704
712
|
});
|
|
705
713
|
ipcTTTOperatorLog('hide: 调用停止对讲方法');
|
|
706
714
|
instance === null || instance === void 0 || instance.IPCPlayerInstance.stopTalk({
|
|
@@ -924,7 +932,7 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
924
932
|
clearTimeout(timer.current);
|
|
925
933
|
timer.current = null;
|
|
926
934
|
}
|
|
927
|
-
if (!hasUserTappedPlayerRef.current) return;
|
|
935
|
+
if (!hasUserTappedPlayerRef.current || hasVisibleGuideTip) return;
|
|
928
936
|
timer.current = setTimeout(onTimeout, HIDE_COMPONENT_TIME);
|
|
929
937
|
});
|
|
930
938
|
|
|
@@ -953,9 +961,6 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
953
961
|
const listenStart = useMemoizedFn(() => {
|
|
954
962
|
// 重新开始计时(用户还没点过画面时不启动,见 startHideTimer)
|
|
955
963
|
startHideTimer(() => {
|
|
956
|
-
// 定时器触发时从 store 读最新状态,避免启动时闭包拿到过期的 isVerticalFullLayout
|
|
957
|
-
const store = getDefaultStore();
|
|
958
|
-
if (store.get(instance.isVerticalFullLayout) && store.get(instance.screenType) === 'vertical') return;
|
|
959
964
|
triggerEvent(hideAllComponent);
|
|
960
965
|
});
|
|
961
966
|
});
|
|
@@ -970,6 +975,13 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
970
975
|
if (isHidingByTapRef.current) return;
|
|
971
976
|
setComponentHideState(false);
|
|
972
977
|
});
|
|
978
|
+
useEffect(() => {
|
|
979
|
+
if (hasVisibleGuideTip) {
|
|
980
|
+
showComponents();
|
|
981
|
+
} else {
|
|
982
|
+
listenStart();
|
|
983
|
+
}
|
|
984
|
+
}, [hasVisibleGuideTip]);
|
|
973
985
|
const onChangeIgnoreHideStopPreview = state => {
|
|
974
986
|
setIgnoreStopOnHide(state);
|
|
975
987
|
};
|
|
@@ -1093,32 +1105,23 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
1093
1105
|
return false;
|
|
1094
1106
|
});
|
|
1095
1107
|
const playerContainerHeight = screenType === 'vertical' ? (style === null || style === void 0 ? void 0 : style.height) || '100%' : '100vh';
|
|
1096
|
-
const
|
|
1097
|
-
|
|
1098
|
-
const viewport = getPlayerViewport(renderMode, isVerticalFullMode, playerContainerHeight);
|
|
1099
|
-
return /*#__PURE__*/React.createElement(PlayerRenderModeContext.Provider, {
|
|
1100
|
-
value: renderMode
|
|
1101
|
-
}, /*#__PURE__*/React.createElement(LynxPlayerAdaptersContext.Provider, {
|
|
1102
|
-
value: props.lynxAdapters || {}
|
|
1103
|
-
}, /*#__PURE__*/React.createElement(UIEventContext.Provider, {
|
|
1108
|
+
const bottomHideState = isVerticalFullLayout && screenType === 'vertical' ? false : componentHideState;
|
|
1109
|
+
return /*#__PURE__*/React.createElement(UIEventContext.Provider, {
|
|
1104
1110
|
value: {
|
|
1105
1111
|
event: eventRef.current,
|
|
1106
1112
|
componentHideState,
|
|
1107
1113
|
refreshElement
|
|
1108
1114
|
}
|
|
1109
1115
|
}, /*#__PURE__*/React.createElement(View, {
|
|
1110
|
-
className: clsx('ipc-player-content',
|
|
1116
|
+
className: clsx('ipc-player-content', isSmallScreen && 'ipc-player-content-small-screen', className),
|
|
1111
1117
|
style: _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, defaultCSSVariable), CSSVariable), style), {}, {
|
|
1112
1118
|
height: playerContainerHeight
|
|
1113
|
-
}
|
|
1114
|
-
backgroundColor: '#000'
|
|
1115
|
-
} : {})
|
|
1119
|
+
})
|
|
1116
1120
|
}, /*#__PURE__*/React.createElement(View, {
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
} : {}, {
|
|
1121
|
+
style: {
|
|
1122
|
+
height: isVerticalFullLayout && screenType === 'vertical' ? `calc(${playerContainerHeight} - 48px)` : playerContainerHeight
|
|
1123
|
+
}
|
|
1124
|
+
}, /*#__PURE__*/React.createElement(IPCPlayer, {
|
|
1122
1125
|
defaultMute: mute,
|
|
1123
1126
|
devId: devId,
|
|
1124
1127
|
onlineStatus: deviceOnline,
|
|
@@ -1130,6 +1133,9 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
1130
1133
|
onCtx: res => {
|
|
1131
1134
|
if (res) {
|
|
1132
1135
|
setCreateCtx(true);
|
|
1136
|
+
if (instance.multiCameraCtx.isSupport) {
|
|
1137
|
+
instance.multiCameraCtx.showLenNames(!componentHideState);
|
|
1138
|
+
}
|
|
1133
1139
|
}
|
|
1134
1140
|
}
|
|
1135
1141
|
// onPlayerTap={handlePlayerClick}
|
|
@@ -1137,7 +1143,7 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
1137
1143
|
onCameraNotifyWeakNetwork: data => {
|
|
1138
1144
|
console.log(`onCameraNotifyWeakNetwork: ${JSON.stringify(data)}`);
|
|
1139
1145
|
},
|
|
1140
|
-
clarity: decodeClarityDic[
|
|
1146
|
+
clarity: decodeClarityDic[resolution],
|
|
1141
1147
|
onZoomChange: onZoomChange
|
|
1142
1148
|
// objectFit={
|
|
1143
1149
|
// screenType === 'vertical'
|
|
@@ -1151,7 +1157,7 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
1151
1157
|
// scaleMultiple={0}
|
|
1152
1158
|
,
|
|
1153
1159
|
awakeStatus: awakeStatus,
|
|
1154
|
-
objectFit:
|
|
1160
|
+
objectFit: "fillCrop",
|
|
1155
1161
|
scaleMultiple: scaleMultiple
|
|
1156
1162
|
// 安卓横屏问题
|
|
1157
1163
|
// ptzControllable={screenType === 'vertical'}
|
|
@@ -1160,9 +1166,7 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
1160
1166
|
onPlayerTap: data => {
|
|
1161
1167
|
console.log('playerTap event');
|
|
1162
1168
|
if (disablePlayerTap.current) {
|
|
1163
|
-
//
|
|
1164
|
-
// 但用户确实点了画面这个事实仍要派发出去 —— 转盘、PTZ 这类浮层靠它收起。
|
|
1165
|
-
// 不派发的话,竖屏全屏下点播放器关不掉转盘(普通竖屏可以,因为那时没禁用)。
|
|
1169
|
+
// Host overlays may disable toggling; popups still need the tap notification.
|
|
1166
1170
|
console.log('playerTap 事件已禁止显隐切换,仅派发 tap 通知浮层');
|
|
1167
1171
|
eventRef.current.emit(playerTap);
|
|
1168
1172
|
return;
|
|
@@ -1171,17 +1175,17 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
1171
1175
|
// 这一下起,自动隐藏倒计时才开始生效
|
|
1172
1176
|
hasUserTappedPlayerRef.current = true;
|
|
1173
1177
|
if (instance.multiCameraCtx.isSupport) {
|
|
1174
|
-
var _instance$
|
|
1175
|
-
const preTapIndex = (_instance$
|
|
1178
|
+
var _instance$multiCamera2, _instance$multiCamera3;
|
|
1179
|
+
const preTapIndex = (_instance$multiCamera2 = (_instance$multiCamera3 = instance.multiCameraCtx.selectedLenInfoRef.current) === null || _instance$multiCamera3 === void 0 ? void 0 : _instance$multiCamera3.index) !== null && _instance$multiCamera2 !== void 0 ? _instance$multiCamera2 : prevSelectedIndexRef.current;
|
|
1176
1180
|
const wasHidden = componentHideState;
|
|
1177
1181
|
instance.multiCameraCtx.selectVideoFiredRef.current = false;
|
|
1178
1182
|
if (multiTapTimerRef.current) {
|
|
1179
1183
|
clearTimeout(multiTapTimerRef.current);
|
|
1180
1184
|
}
|
|
1181
1185
|
multiTapTimerRef.current = setTimeout(() => {
|
|
1182
|
-
var _instance$
|
|
1186
|
+
var _instance$multiCamera4, _instance$multiCamera5;
|
|
1183
1187
|
const selectFired = !!instance.multiCameraCtx.selectVideoFiredRef.current;
|
|
1184
|
-
const currentIndex = (_instance$
|
|
1188
|
+
const currentIndex = (_instance$multiCamera4 = (_instance$multiCamera5 = instance.multiCameraCtx.selectedLenInfoRef.current) === null || _instance$multiCamera5 === void 0 ? void 0 : _instance$multiCamera5.index) !== null && _instance$multiCamera4 !== void 0 ? _instance$multiCamera4 : preTapIndex;
|
|
1185
1189
|
if (selectFired && currentIndex === preTapIndex) {
|
|
1186
1190
|
if (wasHidden) {
|
|
1187
1191
|
showComponents();
|
|
@@ -1233,11 +1237,9 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
1233
1237
|
limitFlow: limitFlow,
|
|
1234
1238
|
autoWakeUp: autoWakeUp,
|
|
1235
1239
|
extend: _objectSpread(_objectSpread({
|
|
1236
|
-
backgroundColor:
|
|
1240
|
+
backgroundColor: '#262626'
|
|
1237
1241
|
}, instance.multiCameraCtx.extendProps), extend)
|
|
1238
|
-
}))
|
|
1239
|
-
value: !componentHideState && !refreshElement
|
|
1240
|
-
}, showTopContent && /*#__PURE__*/React.createElement(View, {
|
|
1242
|
+
})), showTopContent && /*#__PURE__*/React.createElement(View, {
|
|
1241
1243
|
className: clsx('ipc-player-top-content', {
|
|
1242
1244
|
'ipc-player-top-content-hide': componentHideState,
|
|
1243
1245
|
'ipc-player-top-content-show': !componentHideState
|
|
@@ -1251,51 +1253,56 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
1251
1253
|
ctx: instance
|
|
1252
1254
|
}, renderTopRightContent, !hasVisibleBitrateWidget && /*#__PURE__*/React.createElement(AutoClarityOnly, {
|
|
1253
1255
|
instance: instance
|
|
1254
|
-
})))), /*#__PURE__*/React.createElement(
|
|
1256
|
+
})))), /*#__PURE__*/React.createElement(StandaloneAutoClarity, {
|
|
1257
|
+
instance: instance,
|
|
1258
|
+
show: !showTopContent || componentHideState || !playerReady
|
|
1259
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
1255
1260
|
className: clsx('ipc-player-bottom-content', {
|
|
1256
|
-
'ipc-player-bottom-content-hide':
|
|
1257
|
-
'ipc-player-bottom-content-show': !
|
|
1258
|
-
'ipc-player-bottom-content-full':
|
|
1261
|
+
'ipc-player-bottom-content-hide': bottomHideState,
|
|
1262
|
+
'ipc-player-bottom-content-show': !bottomHideState,
|
|
1263
|
+
'ipc-player-bottom-content-full': isVerticalFullLayout && screenType === 'vertical'
|
|
1259
1264
|
}),
|
|
1260
|
-
style:
|
|
1265
|
+
style: {
|
|
1261
1266
|
height: screenType === 'vertical' ? '48px' : '72px'
|
|
1262
|
-
}
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1267
|
+
}
|
|
1268
|
+
}, /*#__PURE__*/React.createElement(UIEventContext.Provider, {
|
|
1269
|
+
value: {
|
|
1270
|
+
event: eventRef.current,
|
|
1271
|
+
componentHideState: bottomHideState,
|
|
1272
|
+
refreshElement
|
|
1273
|
+
}
|
|
1274
|
+
}, /*#__PURE__*/React.createElement(BottomLeftContent, {
|
|
1266
1275
|
ctx: instance,
|
|
1267
1276
|
reservedRight: bottomRightReserved
|
|
1268
1277
|
}, renderBottomLeftContent), /*#__PURE__*/React.createElement(BottomRightContent, {
|
|
1269
1278
|
ctx: instance,
|
|
1270
1279
|
width: bottomRightStyleWidth,
|
|
1271
1280
|
onWidthChange: handleBottomRightWidthChange
|
|
1272
|
-
}, renderBottomRightContent)))
|
|
1273
|
-
instance: instance,
|
|
1274
|
-
show: !showTopContent || componentHideState || !playerReady
|
|
1275
|
-
}), (() => {
|
|
1281
|
+
}, renderBottomRightContent))), (() => {
|
|
1276
1282
|
if (!absoluteContent || !(absoluteContent !== null && absoluteContent !== void 0 && absoluteContent.length)) return null;
|
|
1277
1283
|
return absoluteContent.map(item => {
|
|
1278
|
-
if (item
|
|
1284
|
+
if (!shouldRenderContent(item, {
|
|
1285
|
+
playState
|
|
1286
|
+
})) return null;
|
|
1287
|
+
if (item.id === tileActionsId && isVerticalFullLayout && componentHideState) return null;
|
|
1288
|
+
const contentProps = _objectSpread(_objectSpread(_objectSpread({
|
|
1289
|
+
key: item.id
|
|
1290
|
+
}, item.initProps), instance), {}, {
|
|
1291
|
+
IPCPlayerContext: instance.IPCPlayerInstance
|
|
1292
|
+
});
|
|
1279
1293
|
if (item.absoluteNoCoverView) {
|
|
1280
|
-
return /*#__PURE__*/React.createElement(item.content,
|
|
1281
|
-
key: item.id
|
|
1282
|
-
}, item.initProps), instance), {}, {
|
|
1283
|
-
IPCPlayerContext: instance.IPCPlayerInstance
|
|
1284
|
-
}));
|
|
1294
|
+
return /*#__PURE__*/React.createElement(item.content, contentProps);
|
|
1285
1295
|
}
|
|
1286
|
-
return /*#__PURE__*/React.createElement(
|
|
1296
|
+
return /*#__PURE__*/React.createElement(CoverView, {
|
|
1287
1297
|
key: item.id,
|
|
1288
1298
|
style: _objectSpread({
|
|
1289
1299
|
position: 'absolute'
|
|
1290
1300
|
}, item.absolutePosition),
|
|
1291
1301
|
className: item.absoluteContentClassName
|
|
1292
|
-
}, /*#__PURE__*/React.createElement(item.content, _objectSpread(_objectSpread(
|
|
1293
|
-
key: item.id
|
|
1294
|
-
}, item.initProps), instance), {}, {
|
|
1295
|
-
IPCPlayerContext: instance.IPCPlayerInstance,
|
|
1302
|
+
}, /*#__PURE__*/React.createElement(item.content, _objectSpread(_objectSpread({}, contentProps), {}, {
|
|
1296
1303
|
// 添加通用变量单独组件类名
|
|
1297
1304
|
className: clsx('absolute-item-container')
|
|
1298
1305
|
})));
|
|
1299
1306
|
});
|
|
1300
|
-
})()))
|
|
1307
|
+
})()));
|
|
1301
1308
|
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CaptureResult } from '../interface';
|
|
2
|
+
export type CaptureResultSummary = {
|
|
3
|
+
count: number;
|
|
4
|
+
isMultiLens: boolean;
|
|
5
|
+
thumbnailPath: string;
|
|
6
|
+
};
|
|
7
|
+
export type CaptureResultOptions = {
|
|
8
|
+
multiLens: boolean;
|
|
9
|
+
lensIndices?: number[];
|
|
10
|
+
devId: string;
|
|
11
|
+
};
|
|
12
|
+
export declare function getCaptureResultSummary(result: CaptureResult, { multiLens, lensIndices, devId }: CaptureResultOptions): Promise<CaptureResultSummary | null>;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import "core-js/modules/esnext.iterator.constructor.js";
|
|
2
|
+
import "core-js/modules/esnext.iterator.filter.js";
|
|
3
|
+
import "core-js/modules/esnext.iterator.map.js";
|
|
4
|
+
/* eslint-disable camelcase */
|
|
5
|
+
import { getFileSystemManager } from '@ray-js/ray';
|
|
6
|
+
import { getDeviceInfo } from './device';
|
|
7
|
+
const MULTI_LENS_ABILITY_CODE = 'tyabimr4v3';
|
|
8
|
+
const LENS_SUFFIX_PATTERN = /_lens\d+(?=\.[^./?#]+(?:[?#].*)?$)/;
|
|
9
|
+
const FILE_EXTENSION_PATTERN = /(\.[^./?#]+)([?#].*)?$/;
|
|
10
|
+
const getMultiLensIndices = async devId => {
|
|
11
|
+
try {
|
|
12
|
+
var _devInfo$configMetas, _config$split_info;
|
|
13
|
+
const devInfo = await getDeviceInfo(devId);
|
|
14
|
+
const raw = devInfo === null || devInfo === void 0 || (_devInfo$configMetas = devInfo.configMetas) === null || _devInfo$configMetas === void 0 ? void 0 : _devInfo$configMetas[MULTI_LENS_ABILITY_CODE];
|
|
15
|
+
const config = typeof raw === 'string' ? JSON.parse(raw) : raw;
|
|
16
|
+
return (config === null || config === void 0 || (_config$split_info = config.split_info) === null || _config$split_info === void 0 ? void 0 : _config$split_info.map(item => Number(item.index))) || [];
|
|
17
|
+
} catch {
|
|
18
|
+
return [];
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
const getLensPath = (path, index) => path.replace(LENS_SUFFIX_PATTERN, '').replace(FILE_EXTENSION_PATTERN, `_lens${index}$1$2`);
|
|
22
|
+
const extractPath = item => {
|
|
23
|
+
if (typeof item === 'string') return item;
|
|
24
|
+
if (typeof (item === null || item === void 0 ? void 0 : item.value) === 'string') return item.value;
|
|
25
|
+
return '';
|
|
26
|
+
};
|
|
27
|
+
const imageExists = async path => {
|
|
28
|
+
if (!path) return false;
|
|
29
|
+
try {
|
|
30
|
+
const manager = await getFileSystemManager();
|
|
31
|
+
return await new Promise(resolve => {
|
|
32
|
+
manager.access({
|
|
33
|
+
path,
|
|
34
|
+
success: () => resolve(true),
|
|
35
|
+
fail: () => resolve(false)
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
} catch {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
export async function getCaptureResultSummary(result, _ref) {
|
|
43
|
+
let {
|
|
44
|
+
multiLens,
|
|
45
|
+
lensIndices,
|
|
46
|
+
devId
|
|
47
|
+
} = _ref;
|
|
48
|
+
if (!result || typeof result === 'boolean') return null;
|
|
49
|
+
if (!multiLens) {
|
|
50
|
+
return {
|
|
51
|
+
count: 1,
|
|
52
|
+
isMultiLens: false,
|
|
53
|
+
thumbnailPath: extractPath(result.tempImagePath) || extractPath(result.thumbPath) || extractPath(result.filePath)
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
const thumbnailPath = extractPath(result.thumbPath) || extractPath(result.tempImagePath);
|
|
57
|
+
if (!thumbnailPath) return null;
|
|
58
|
+
const indices = [...new Set(lensIndices !== null && lensIndices !== void 0 && lensIndices.length ? lensIndices : await getMultiLensIndices(devId))];
|
|
59
|
+
const thumbnails = await Promise.all(indices.map(async index => {
|
|
60
|
+
const path = getLensPath(thumbnailPath, index);
|
|
61
|
+
return (await imageExists(path)) ? path : '';
|
|
62
|
+
}));
|
|
63
|
+
const existingThumbnails = thumbnails.filter(Boolean);
|
|
64
|
+
if (!existingThumbnails.length) return null;
|
|
65
|
+
return {
|
|
66
|
+
count: existingThumbnails.length,
|
|
67
|
+
isMultiLens: true,
|
|
68
|
+
thumbnailPath: existingThumbnails[0]
|
|
69
|
+
};
|
|
70
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|