@ray-js/ipc-player-integration 0.0.28 → 0.0.29-beta.1
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/lib/ctx/ctx.js +10 -2
- package/lib/ctx/multiCameraCtx.d.ts +73 -0
- package/lib/ctx/multiCameraCtx.js +176 -0
- package/lib/features/initPlayerWidgets/index.d.ts +5 -4
- package/lib/features/initPlayerWidgets/index.js +7 -0
- package/lib/features/initPlayerWidgets/multiCamera.d.ts +8 -0
- package/lib/features/initPlayerWidgets/multiCamera.js +78 -0
- package/lib/i18n/index.d.ts +20 -0
- package/lib/i18n/strings.d.ts +10 -0
- package/lib/i18n/strings.js +12 -2
- package/lib/iconfont/iconfont.css +197 -4
- package/lib/iconfont/iconfont.js +13 -13
- package/lib/iconfont/iconfont.json +336 -0
- package/lib/iconfont/iconfont.ttf +0 -0
- package/lib/iconfont/iconfont.woff +0 -0
- package/lib/iconfont/iconfont.woff2 +0 -0
- package/lib/interface.d.ts +90 -4
- package/lib/interface.js +56 -1
- package/lib/ui/constant.d.ts +6 -0
- package/lib/ui/constant.js +6 -0
- package/lib/ui/ui.js +187 -17
- package/lib/ui/ui.less +19 -21
- package/lib/utils/storage/index.d.ts +1 -0
- package/lib/utils/storage/index.js +8 -1
- package/lib/widgets/battery/battery.composition.d.ts +60 -4
- package/lib/widgets/fullScreen/fullScreen.js +5 -3
- package/lib/widgets/index.d.ts +2 -0
- package/lib/widgets/index.js +3 -1
- package/lib/widgets/multiCamera/constants.d.ts +1 -0
- package/lib/widgets/multiCamera/constants.js +1 -0
- package/lib/widgets/multiCamera/index.d.ts +8 -0
- package/lib/widgets/multiCamera/index.js +8 -0
- package/lib/widgets/multiCamera/index.less +214 -0
- package/lib/widgets/multiCamera/landscapeTip.d.ts +6 -0
- package/lib/widgets/multiCamera/landscapeTip.js +40 -0
- package/lib/widgets/multiCamera/moveView/index.d.ts +9 -0
- package/lib/widgets/multiCamera/moveView/index.js +22 -0
- package/lib/widgets/multiCamera/moveView/tyComponent/index.d.ts +1 -0
- package/lib/widgets/multiCamera/moveView/tyComponent/index.js +42 -0
- package/lib/widgets/multiCamera/moveView/tyComponent/index.json +3 -0
- package/lib/widgets/multiCamera/moveView/tyComponent/index.tyml +8 -0
- package/lib/widgets/multiCamera/moveView/tyComponent/index.tyss +4 -0
- package/lib/widgets/multiCamera/moveView/utils.d.ts +1 -0
- package/lib/widgets/multiCamera/moveView/utils.js +29 -0
- package/lib/widgets/multiCamera/moveablePtzControl.d.ts +22 -0
- package/lib/widgets/multiCamera/moveablePtzControl.js +302 -0
- package/lib/widgets/multiCamera/multiPtz.d.ts +11 -0
- package/lib/widgets/multiCamera/multiPtz.js +46 -0
- package/lib/widgets/multiCamera/ptzMoveableTip.d.ts +8 -0
- package/lib/widgets/multiCamera/ptzMoveableTip.js +66 -0
- package/lib/widgets/multiCamera/switchLayout.d.ts +8 -0
- package/lib/widgets/multiCamera/switchLayout.js +57 -0
- package/lib/widgets/multiCamera/tileActions.d.ts +6 -0
- package/lib/widgets/multiCamera/tileActions.js +15 -0
- package/lib/widgets/multiCamera/tileMultiPtz.d.ts +11 -0
- package/lib/widgets/multiCamera/tileMultiPtz.js +48 -0
- package/lib/widgets/multiCamera/tileSwitchLayout.d.ts +8 -0
- package/lib/widgets/multiCamera/tileSwitchLayout.js +38 -0
- package/lib/widgets/multiCamera/tileTip.d.ts +6 -0
- package/lib/widgets/multiCamera/tileTip.js +50 -0
- package/lib/widgets/ptz/ptz.less +15 -8
- package/lib/widgets/smallIntercom/index.d.ts +8 -0
- package/lib/widgets/smallIntercom/index.js +38 -0
- package/lib/widgets/smallIntercom/index.less +4 -0
- package/lib/widgets/voiceIntercom/voiceIntercom.d.ts +33 -2
- package/package.json +6 -5
package/lib/ui/ui.js
CHANGED
|
@@ -1,23 +1,25 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
2
|
import "core-js/modules/esnext.iterator.constructor.js";
|
|
4
3
|
import "core-js/modules/esnext.iterator.map.js";
|
|
5
4
|
import React, { useContext, useState, useRef, useMemo, useEffect, useImperativeHandle } from 'react';
|
|
6
5
|
import { View, CoverView, getSystemInfoSync, usePageEvent, setNavigationBarBack, setPageOrientation, getCurrentPages } from '@ray-js/ray';
|
|
6
|
+
import { unstable_batchedUpdates as batchedUpdates } from '@ray-core/ray';
|
|
7
7
|
import clsx from 'clsx';
|
|
8
8
|
import IPCPlayer from '@ray-js/ray-ipc-player';
|
|
9
9
|
import { ipcTTTOperatorLog } from '@ray-js/ray-ipc-utils';
|
|
10
|
-
import { PlayState, PlayerStreamStatus } from '../interface';
|
|
10
|
+
import { PlayState, PlayerStreamStatus, MultiCameraScreenMode } from '../interface';
|
|
11
11
|
import { useCtx } from '../ctx/ctx.composition';
|
|
12
12
|
import { useStore } from '../ctx/store';
|
|
13
13
|
import { UIEventContext } from './context';
|
|
14
|
-
import { showAllComponent, hideAllComponent, playerTap, startTimeToHideAllComponent, pauseTimeToHideAllComponent, decodeClarityDic, changeIgnoreHideStopPreview } from './constant';
|
|
14
|
+
import { showAllComponent, hideAllComponent, playerTap, startTimeToHideAllComponent, pauseTimeToHideAllComponent, decodeClarityDic, changeIgnoreHideStopPreview, moveablePtzControlId, tileActionsId, tileTipId, landscapeTipId, multiPtzId, ptzMoveableTipId } from './constant';
|
|
15
15
|
import BottomLeftContent from './bottomLeftContent';
|
|
16
16
|
import BottomRightContent from './bottomRightContent';
|
|
17
17
|
import TopLeftContent from './topLeftContent';
|
|
18
18
|
import TopRightContent from './topRightContent';
|
|
19
19
|
import { useMemoizedFn } from '../hooks';
|
|
20
|
+
import { Storage } from '../utils/storage';
|
|
20
21
|
import './ui.less';
|
|
22
|
+
import { updatePlayerWidgetProps } from '../features';
|
|
21
23
|
function getCtxInstance(instance, devId) {
|
|
22
24
|
if (instance) return instance;
|
|
23
25
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
@@ -75,7 +77,6 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
75
77
|
} = instance;
|
|
76
78
|
const prevTriggerEvent = useRef();
|
|
77
79
|
const hasPlayedRef = useRef(false);
|
|
78
|
-
|
|
79
80
|
/*
|
|
80
81
|
player 的UI效果期望有一些控件在初始化的时候都展示,在点击 Player 之后隐藏:
|
|
81
82
|
在控件显示时,点击播放器期望隐藏控件
|
|
@@ -100,6 +101,9 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
100
101
|
// const [verticalCoverZoom, setVerticalCoverZoom] = useState(-2);
|
|
101
102
|
// const [verticalZoomLevel, setVerticalZoomLevel] = useState(playerFit === 'contain' ? 1 : -2);
|
|
102
103
|
|
|
104
|
+
// 展示顶部内容
|
|
105
|
+
const [showTopContent, setShowTopContent] = useState(true);
|
|
106
|
+
|
|
103
107
|
// 外部传入的ignoreHideStopPreview变化时,同步更新
|
|
104
108
|
useEffect(() => {
|
|
105
109
|
setIgnoreStopOnHide(ignoreHideStopPreview);
|
|
@@ -194,7 +198,11 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
194
198
|
screenType,
|
|
195
199
|
playState,
|
|
196
200
|
resolution,
|
|
197
|
-
mute
|
|
201
|
+
mute,
|
|
202
|
+
screenMode,
|
|
203
|
+
layoutStyle,
|
|
204
|
+
ptzStatus,
|
|
205
|
+
selectedLenInfo
|
|
198
206
|
} = useStore({
|
|
199
207
|
topLeftContent: instance.topLeftContent,
|
|
200
208
|
topRightContent: instance.topRightContent,
|
|
@@ -204,8 +212,140 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
204
212
|
screenType: instance.screenType,
|
|
205
213
|
playState: instance.playState,
|
|
206
214
|
resolution: instance.resolution,
|
|
207
|
-
mute: instance.mute
|
|
215
|
+
mute: instance.mute,
|
|
216
|
+
screenMode: instance.multiCameraCtx.screenMode,
|
|
217
|
+
layoutStyle: instance.multiCameraCtx.layoutStyle,
|
|
218
|
+
ptzStatus: instance.multiCameraCtx.ptzStatus,
|
|
219
|
+
selectedLenInfo: instance.multiCameraCtx.selectedLenInfo
|
|
208
220
|
});
|
|
221
|
+
|
|
222
|
+
/* ---------------------------------多目相关副作用统一处理开始----------------------------------------- */
|
|
223
|
+
useEffect(() => {
|
|
224
|
+
if (!instance.multiCameraCtx.isSupport) return;
|
|
225
|
+
const {
|
|
226
|
+
multiCameraCtx,
|
|
227
|
+
showContent,
|
|
228
|
+
hideContent
|
|
229
|
+
} = instance;
|
|
230
|
+
const storage = new Storage(devId);
|
|
231
|
+
batchedUpdates(() => {
|
|
232
|
+
switch (screenMode) {
|
|
233
|
+
case MultiCameraScreenMode.full:
|
|
234
|
+
// widgets 常驻显示
|
|
235
|
+
eventRef.current.emit(showAllComponent);
|
|
236
|
+
eventRef.current.emit('disablePlayerTap', true);
|
|
237
|
+
eventRef.current.emit(pauseTimeToHideAllComponent);
|
|
238
|
+
|
|
239
|
+
// 展示右侧插件
|
|
240
|
+
showContent('absolute', tileActionsId);
|
|
241
|
+
|
|
242
|
+
// 展示tileTip
|
|
243
|
+
if (!storage.getSync(tileTipId)) {
|
|
244
|
+
showContent('absolute', tileTipId);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
// 展示顶部内容
|
|
248
|
+
setShowTopContent(true);
|
|
249
|
+
|
|
250
|
+
// 隐藏多目ptz
|
|
251
|
+
hideContent('bottomLeft', multiPtzId);
|
|
252
|
+
|
|
253
|
+
// 展示小对讲
|
|
254
|
+
showContent('bottomLeft', 'SmallIntercom');
|
|
255
|
+
updatePlayerWidgetProps(instance, 'absolute', moveablePtzControlId, {
|
|
256
|
+
positionLeft: 24
|
|
257
|
+
});
|
|
258
|
+
break;
|
|
259
|
+
case MultiCameraScreenMode.short:
|
|
260
|
+
// 恢复 widgets 展示逻辑
|
|
261
|
+
eventRef.current.emit('disablePlayerTap', false);
|
|
262
|
+
showComponents();
|
|
263
|
+
|
|
264
|
+
// 隐藏右侧插件
|
|
265
|
+
hideContent('absolute', tileActionsId);
|
|
266
|
+
|
|
267
|
+
// 隐藏顶部内容
|
|
268
|
+
setShowTopContent(false);
|
|
269
|
+
|
|
270
|
+
// 隐藏多目ptz
|
|
271
|
+
hideContent('bottomLeft', multiPtzId);
|
|
272
|
+
|
|
273
|
+
// 隐藏小对讲
|
|
274
|
+
hideContent('bottomLeft', 'SmallIntercom');
|
|
275
|
+
break;
|
|
276
|
+
case MultiCameraScreenMode.landscape:
|
|
277
|
+
// 恢复 widgets 展示逻辑
|
|
278
|
+
eventRef.current.emit('disablePlayerTap', false);
|
|
279
|
+
showComponents();
|
|
280
|
+
if (multiCameraCtx.protocol.total_split_num === 2 && !storage.getSync(landscapeTipId)) {
|
|
281
|
+
showContent('absolute', landscapeTipId);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
// 隐藏右侧插件
|
|
285
|
+
hideContent('absolute', tileActionsId);
|
|
286
|
+
|
|
287
|
+
// 展示多目ptz
|
|
288
|
+
showContent('bottomLeft', multiPtzId);
|
|
289
|
+
|
|
290
|
+
// 展示顶部内容
|
|
291
|
+
setShowTopContent(true);
|
|
292
|
+
|
|
293
|
+
// 展示小对讲
|
|
294
|
+
showContent('bottomLeft', 'SmallIntercom');
|
|
295
|
+
updatePlayerWidgetProps(instance, 'absolute', moveablePtzControlId, {
|
|
296
|
+
positionLeft: 60
|
|
297
|
+
});
|
|
298
|
+
break;
|
|
299
|
+
default:
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
// 重置 ptz
|
|
303
|
+
multiCameraCtx.setPtzStatus(false);
|
|
304
|
+
}, null);
|
|
305
|
+
}, [screenMode, instance]);
|
|
306
|
+
useEffect(() => {
|
|
307
|
+
if (!instance.multiCameraCtx.isSupport) return;
|
|
308
|
+
|
|
309
|
+
// 更新 nextLayoutStyle
|
|
310
|
+
instance.multiCameraCtx.getNextLayoutStyle().then(res => {
|
|
311
|
+
instance.multiCameraCtx.setNextLayoutStyle(res);
|
|
312
|
+
});
|
|
313
|
+
}, [layoutStyle, screenMode, instance]);
|
|
314
|
+
useEffect(() => {
|
|
315
|
+
if (!instance.multiCameraCtx.isSupport) return;
|
|
316
|
+
|
|
317
|
+
// 组件隐藏时也隐藏镜头名
|
|
318
|
+
instance.multiCameraCtx.showLenNames(!componentHideState);
|
|
319
|
+
}, [componentHideState, instance]);
|
|
320
|
+
useEffect(() => {
|
|
321
|
+
if (!instance.multiCameraCtx.isSupport) return;
|
|
322
|
+
if (ptzStatus) {
|
|
323
|
+
instance.showContent('absolute', moveablePtzControlId);
|
|
324
|
+
} else {
|
|
325
|
+
instance.hideContent('absolute', moveablePtzControlId);
|
|
326
|
+
}
|
|
327
|
+
}, [instance, ptzStatus]);
|
|
328
|
+
useEffect(() => {
|
|
329
|
+
if (!instance.multiCameraCtx.isSupport) return;
|
|
330
|
+
|
|
331
|
+
// ptz 激活状态下,需要根据组件隐藏状态来决定是否展示 moveablePtzControl
|
|
332
|
+
if (ptzStatus) {
|
|
333
|
+
if (!componentHideState) {
|
|
334
|
+
instance.showContent('absolute', moveablePtzControlId);
|
|
335
|
+
} else {
|
|
336
|
+
instance.hideContent('absolute', moveablePtzControlId);
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
// ptz 提示
|
|
340
|
+
const storage = new Storage(devId);
|
|
341
|
+
if (!storage.getSync(ptzMoveableTipId) && selectedLenInfo.supportPTZ) {
|
|
342
|
+
instance.showContent('absolute', ptzMoveableTipId);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
}, [instance, ptzStatus, selectedLenInfo, componentHideState]);
|
|
346
|
+
|
|
347
|
+
/* ---------------------------------多目相关副作用统一处理结束----------------------------------------- */
|
|
348
|
+
|
|
209
349
|
useEffect(() => {
|
|
210
350
|
if (createCtx) {
|
|
211
351
|
setScaleMultiple(playerFit === 'contain' ? 1 : -2);
|
|
@@ -438,6 +578,19 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
438
578
|
const handDisablePlayerTap = value => {
|
|
439
579
|
disablePlayerTap.current = !!value;
|
|
440
580
|
};
|
|
581
|
+
/**
|
|
582
|
+
* 展示所有组件,一段时间后自动关闭
|
|
583
|
+
*/
|
|
584
|
+
const showComponents = () => {
|
|
585
|
+
if (timer.current) {
|
|
586
|
+
clearTimeout(timer.current);
|
|
587
|
+
timer.current = null;
|
|
588
|
+
}
|
|
589
|
+
setComponentHideState(false);
|
|
590
|
+
timer.current = setTimeout(() => {
|
|
591
|
+
setComponentHideState(true);
|
|
592
|
+
}, HIDE_COMPONENT_TIME);
|
|
593
|
+
};
|
|
441
594
|
const triggerEvent = type => {
|
|
442
595
|
if (prevTriggerEvent.current === type) return;
|
|
443
596
|
if (timer.current) {
|
|
@@ -497,7 +650,7 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
497
650
|
}
|
|
498
651
|
};
|
|
499
652
|
}, []);
|
|
500
|
-
playState === PlayState.PLAYING;
|
|
653
|
+
const playerReady = playState === PlayState.PLAYING;
|
|
501
654
|
/**
|
|
502
655
|
* 监听当前的zoom比例状态
|
|
503
656
|
*/
|
|
@@ -546,6 +699,7 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
546
699
|
setCurrentZoomLevel(zoomLevel);
|
|
547
700
|
return false;
|
|
548
701
|
});
|
|
702
|
+
const playerContainerHeight = screenType === 'vertical' ? (style === null || style === void 0 ? void 0 : style.height) || '100%' : '100vh';
|
|
549
703
|
return /*#__PURE__*/React.createElement(UIEventContext.Provider, {
|
|
550
704
|
value: {
|
|
551
705
|
event: eventRef.current,
|
|
@@ -554,9 +708,13 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
554
708
|
}, /*#__PURE__*/React.createElement(View, {
|
|
555
709
|
className: clsx('ipc-player-content', className),
|
|
556
710
|
style: _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, defaultCSSVariable), CSSVariable), style), {}, {
|
|
557
|
-
height:
|
|
711
|
+
height: playerContainerHeight
|
|
558
712
|
})
|
|
559
|
-
}, /*#__PURE__*/React.createElement(
|
|
713
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
714
|
+
style: {
|
|
715
|
+
height: screenMode === MultiCameraScreenMode.full ? `calc(${playerContainerHeight} - 48px)` : playerContainerHeight
|
|
716
|
+
}
|
|
717
|
+
}, /*#__PURE__*/React.createElement(IPCPlayer, {
|
|
560
718
|
defaultMute: mute,
|
|
561
719
|
devId: devId,
|
|
562
720
|
onlineStatus: deviceOnline,
|
|
@@ -603,7 +761,10 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
603
761
|
console.log('res===on onVideoTap', data);
|
|
604
762
|
eventRef.current.emit(playerTap);
|
|
605
763
|
console.log(prevTriggerEvent.current, 'prevTriggerEvent.current');
|
|
606
|
-
if (
|
|
764
|
+
if (instance.multiCameraCtx.isSupport) {
|
|
765
|
+
// 处理多目选中窗口手势冲突
|
|
766
|
+
showComponents();
|
|
767
|
+
} else if (prevTriggerEvent.current === hideAllComponent) {
|
|
607
768
|
triggerEvent(showAllComponent);
|
|
608
769
|
} else {
|
|
609
770
|
triggerEvent(hideAllComponent);
|
|
@@ -613,8 +774,9 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
613
774
|
} // 对应原来的onVideoTap
|
|
614
775
|
,
|
|
615
776
|
brandColor: brandColor,
|
|
616
|
-
playerRoute: playerRoute
|
|
617
|
-
|
|
777
|
+
playerRoute: playerRoute,
|
|
778
|
+
extend: _objectSpread(_objectSpread({}, instance.multiCameraCtx.extendProps), extend)
|
|
779
|
+
})), showTopContent && /*#__PURE__*/React.createElement(View, {
|
|
618
780
|
className: clsx('ipc-player-top-content', {
|
|
619
781
|
'ipc-player-top-content-hide': componentHideState,
|
|
620
782
|
'ipc-player-top-content-show': !componentHideState
|
|
@@ -622,26 +784,34 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
622
784
|
style: {
|
|
623
785
|
height: screenType === 'vertical' ? '48px' : '60px'
|
|
624
786
|
}
|
|
625
|
-
}, /*#__PURE__*/React.createElement(TopLeftContent, {
|
|
787
|
+
}, playerReady && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(TopLeftContent, {
|
|
626
788
|
ctx: instance
|
|
627
789
|
}, renderTopLeftContent), /*#__PURE__*/React.createElement(TopRightContent, {
|
|
628
790
|
ctx: instance
|
|
629
|
-
}, renderTopRightContent)), /*#__PURE__*/React.createElement(View, {
|
|
791
|
+
}, renderTopRightContent))), /*#__PURE__*/React.createElement(View, {
|
|
630
792
|
className: clsx('ipc-player-bottom-content', {
|
|
631
793
|
'ipc-player-bottom-content-hide': componentHideState,
|
|
632
|
-
'ipc-player-bottom-content-show': !componentHideState
|
|
794
|
+
'ipc-player-bottom-content-show': !componentHideState,
|
|
795
|
+
'ipc-player-bottom-content-full': screenMode === MultiCameraScreenMode.full
|
|
633
796
|
}),
|
|
634
797
|
style: {
|
|
635
798
|
height: screenType === 'vertical' ? '48px' : '72px'
|
|
636
799
|
}
|
|
637
|
-
}, /*#__PURE__*/React.createElement(BottomLeftContent, {
|
|
800
|
+
}, playerReady && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(BottomLeftContent, {
|
|
638
801
|
ctx: instance
|
|
639
802
|
}, renderBottomLeftContent), /*#__PURE__*/React.createElement(BottomRightContent, {
|
|
640
803
|
ctx: instance
|
|
641
|
-
}, renderBottomRightContent)), (() => {
|
|
804
|
+
}, renderBottomRightContent))), (() => {
|
|
642
805
|
if (!absoluteContent || !(absoluteContent !== null && absoluteContent !== void 0 && absoluteContent.length)) return null;
|
|
643
806
|
return absoluteContent.map(item => {
|
|
644
807
|
if (item.hidden) return null;
|
|
808
|
+
if (item.absoluteNoCoverView) {
|
|
809
|
+
return /*#__PURE__*/React.createElement(item.content, _objectSpread(_objectSpread(_objectSpread({
|
|
810
|
+
key: item.id
|
|
811
|
+
}, item.initProps), instance), {}, {
|
|
812
|
+
IPCPlayerContext: instance.IPCPlayerInstance
|
|
813
|
+
}));
|
|
814
|
+
}
|
|
645
815
|
return /*#__PURE__*/React.createElement(CoverView, {
|
|
646
816
|
key: item.id,
|
|
647
817
|
style: _objectSpread({
|
package/lib/ui/ui.less
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
height: 60px;
|
|
13
13
|
background: linear-gradient(180deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0) 100%);
|
|
14
14
|
}
|
|
15
|
-
// 底部长条
|
|
15
|
+
// 底部长条
|
|
16
16
|
.ipc-player-bottom-content {
|
|
17
17
|
position: absolute;
|
|
18
18
|
bottom: 0;
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
padding-top: 12px;
|
|
22
22
|
z-index: 90;
|
|
23
23
|
height: 60px;
|
|
24
|
-
background: linear-gradient(360deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0) 100%)
|
|
24
|
+
background: linear-gradient(360deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0) 100%);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
// 顶部整条内容隐藏
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
transform: translate(0, 0);
|
|
41
41
|
transition: transform ease-in 0.3s;
|
|
42
42
|
}
|
|
43
|
-
|
|
43
|
+
|
|
44
44
|
.ipc-player-bottom-content-hide {
|
|
45
45
|
transform: translate(0, 110%);
|
|
46
46
|
transition: transform 0.3s ease-in-out;
|
|
@@ -69,8 +69,8 @@
|
|
|
69
69
|
display: flex;
|
|
70
70
|
flex-direction: row;
|
|
71
71
|
}
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
// 右下角容器样式
|
|
73
|
+
.ipc-player-bottom-right-content-wrap {
|
|
74
74
|
position: absolute;
|
|
75
75
|
z-index: 100;
|
|
76
76
|
right: 0;
|
|
@@ -79,7 +79,6 @@
|
|
|
79
79
|
flex-direction: row;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
|
|
83
82
|
// 左上角隐藏
|
|
84
83
|
.ipc-player-top-left-content-show {
|
|
85
84
|
transform: translate(0, 0);
|
|
@@ -102,7 +101,6 @@
|
|
|
102
101
|
transition: transform 0.3s ease-in-out;
|
|
103
102
|
}
|
|
104
103
|
|
|
105
|
-
|
|
106
104
|
// 左下角隐藏
|
|
107
105
|
.ipc-player-bottom-left-content-hide {
|
|
108
106
|
transform: translate(0, 110%);
|
|
@@ -125,7 +123,6 @@
|
|
|
125
123
|
transition: transform ease-in 0.3s;
|
|
126
124
|
}
|
|
127
125
|
|
|
128
|
-
|
|
129
126
|
// 左上角子元素内容区域样式
|
|
130
127
|
.ipc-player-top-left-content-container {
|
|
131
128
|
display: flex;
|
|
@@ -158,8 +155,7 @@
|
|
|
158
155
|
align-items: center;
|
|
159
156
|
}
|
|
160
157
|
|
|
161
|
-
|
|
162
|
-
// 左上角子元素容器
|
|
158
|
+
// 左上角子元素容器
|
|
163
159
|
.top-left-item-container {
|
|
164
160
|
padding: 0 8px;
|
|
165
161
|
}
|
|
@@ -172,7 +168,6 @@
|
|
|
172
168
|
.top-left-item-container:only-of-type {
|
|
173
169
|
padding: 0 0 0 16px;
|
|
174
170
|
}
|
|
175
|
-
|
|
176
171
|
|
|
177
172
|
// 右上角子元素容器
|
|
178
173
|
.top-right-item-container {
|
|
@@ -188,8 +183,8 @@
|
|
|
188
183
|
padding: 0 16px 0 0;
|
|
189
184
|
}
|
|
190
185
|
|
|
191
|
-
|
|
192
|
-
|
|
186
|
+
// 左下角子元素容器
|
|
187
|
+
.bottom-left-item-container {
|
|
193
188
|
padding: 0 12px;
|
|
194
189
|
display: flex;
|
|
195
190
|
justify-content: center;
|
|
@@ -202,12 +197,12 @@
|
|
|
202
197
|
.bottom-left-item-container:last-of-type {
|
|
203
198
|
padding: 0 0 0 12px;
|
|
204
199
|
}
|
|
205
|
-
.bottom-left-item-container:only-of-type{
|
|
200
|
+
.bottom-left-item-container:only-of-type {
|
|
206
201
|
padding: 0 0 0 16px;
|
|
207
202
|
}
|
|
208
203
|
|
|
209
|
-
|
|
210
|
-
|
|
204
|
+
// 左下角全屏子元素容器
|
|
205
|
+
.bottom-left-item-full-container {
|
|
211
206
|
padding: 0 24px !important;
|
|
212
207
|
}
|
|
213
208
|
|
|
@@ -217,7 +212,7 @@
|
|
|
217
212
|
.bottom-left-item-full-container:last-of-type {
|
|
218
213
|
padding: 0 0 0 24px !important;
|
|
219
214
|
}
|
|
220
|
-
.bottom-left-item-full-container:only-of-type{
|
|
215
|
+
.bottom-left-item-full-container:only-of-type {
|
|
221
216
|
padding: 0 0 0 16px !important;
|
|
222
217
|
}
|
|
223
218
|
|
|
@@ -238,10 +233,8 @@
|
|
|
238
233
|
.bottom-right-item-container:only-of-type {
|
|
239
234
|
padding: 0 16px 0 0;
|
|
240
235
|
}
|
|
241
|
-
|
|
242
236
|
}
|
|
243
237
|
|
|
244
|
-
|
|
245
238
|
.ipc-player-element-visible {
|
|
246
239
|
visibility: visible !important;
|
|
247
240
|
}
|
|
@@ -264,10 +257,15 @@
|
|
|
264
257
|
.ipc-plugin-absolute-move-in-right {
|
|
265
258
|
--translate-length: calc(50 * 1vw);
|
|
266
259
|
animation: absolute-move-in-right-animation @animation-time ease-in-out;
|
|
267
|
-
transition: transform @animation-time ease-in, opacity @animation-time ease-in,
|
|
260
|
+
transition: transform @animation-time ease-in, opacity @animation-time ease-in,
|
|
261
|
+
width @animation-time ease-in;
|
|
268
262
|
&.ipc-plugin-absolute-move-in-right-hide {
|
|
269
263
|
transform: translate(var(--translate-length), 0);
|
|
270
264
|
opacity: 0;
|
|
271
265
|
width: 0;
|
|
272
266
|
}
|
|
273
|
-
}
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.ipc-player-bottom-content-full {
|
|
270
|
+
background-color: #000 !important;
|
|
271
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getStorage, setStorage, removeStorage, getLaunchOptionsSync } from '@ray-js/ray';
|
|
1
|
+
import { getStorage, setStorage, removeStorage, getLaunchOptionsSync, getStorageSync } from '@ray-js/ray';
|
|
2
2
|
import { promisify } from '..';
|
|
3
3
|
export class Storage {
|
|
4
4
|
constructor(prefix) {
|
|
@@ -11,6 +11,13 @@ export class Storage {
|
|
|
11
11
|
});
|
|
12
12
|
return JSON.parse((_res$data = res.data) !== null && _res$data !== void 0 ? _res$data : 'null');
|
|
13
13
|
}
|
|
14
|
+
getSync(key) {
|
|
15
|
+
const res = getStorageSync({
|
|
16
|
+
key: this.getFullKey(key)
|
|
17
|
+
});
|
|
18
|
+
// @ts-ignore
|
|
19
|
+
return JSON.parse(res !== null && res !== void 0 ? res : 'null');
|
|
20
|
+
}
|
|
14
21
|
set(key, value) {
|
|
15
22
|
return promisify(setStorage)({
|
|
16
23
|
key: this.getFullKey(key),
|
|
@@ -23,7 +23,8 @@ export declare const Battery: import("react").FunctionComponent<{
|
|
|
23
23
|
bottomLeftContent: import("../..").RetAtom<import("../..").ComponentConfig<any & Record<string, any>>[]>;
|
|
24
24
|
bottomRightContent: import("../..").RetAtom<import("../..").ComponentConfig<any & Record<string, any>>[]>;
|
|
25
25
|
absoluteContent: import("../..").RetAtom<import("../..").ComponentConfig<any & Record<string, any>>[]>;
|
|
26
|
-
|
|
26
|
+
ptzControlTipDisabled: import("../..").RetAtom<boolean>;
|
|
27
|
+
setPtzControlTipDisabled: (value: boolean) => void;
|
|
27
28
|
setBrandColor: (color: string) => void;
|
|
28
29
|
setVerticalMic: (value: boolean) => void;
|
|
29
30
|
setScreenType: (type: import("../..").ScreenType) => void;
|
|
@@ -38,13 +39,40 @@ export declare const Battery: import("react").FunctionComponent<{
|
|
|
38
39
|
setPlayState: (value: import("../..").PlayState) => void;
|
|
39
40
|
addContent: <T>(type: import("../..").ContentPlaceType, config: import("../..").ComponentConfig<T> | import("../..").ComponentConfig<T>[], position?: number | undefined) => void;
|
|
40
41
|
deleteContent: (type: import("../..").ContentPlaceType, id: string) => void;
|
|
41
|
-
getContent: () =>
|
|
42
|
+
getContent: () => {
|
|
43
|
+
topLeft: import("../..").ComponentConfig<any & Record<string, any>>[];
|
|
44
|
+
topRight: import("../..").ComponentConfig<any & Record<string, any>>[];
|
|
45
|
+
bottomLeft: import("../..").ComponentConfig<any & Record<string, any>>[];
|
|
46
|
+
bottomRight: import("../..").ComponentConfig<any & Record<string, any>>[];
|
|
47
|
+
absolute: import("../..").ComponentConfig<any & Record<string, any>>[];
|
|
48
|
+
};
|
|
42
49
|
updateContent: (type: import("../..").ContentPlaceType, data: import("../..").ComponentConfig<any & Record<string, any>>[]) => void;
|
|
43
50
|
hasContent: (type: import("../..").ContentPlaceType, id: string) => boolean;
|
|
44
51
|
hideContent: (type: import("../..").ContentPlaceType, id: string) => void;
|
|
45
52
|
showContent: (type: import("../..").ContentPlaceType, id: string) => void;
|
|
46
53
|
toast: import("../../ports.output").Toast;
|
|
47
54
|
event: import("../..").EventInstance;
|
|
55
|
+
multiCameraCtx: {
|
|
56
|
+
isSupport: boolean;
|
|
57
|
+
protocol: import("../..").VideoSplitProtocol;
|
|
58
|
+
layoutStyle: import("../..").RetAtom<import("../..").MultiCameraLayoutStyle>;
|
|
59
|
+
screenMode: import("../..").RetAtom<import("../..").MultiCameraScreenMode>;
|
|
60
|
+
nextLayoutStyle: import("../..").RetAtom<import("../..").MultiCameraLayoutStyle>;
|
|
61
|
+
selectedLenInfo: import("../..").RetAtom<import("../..").MultiCameraLenInfo>;
|
|
62
|
+
ptzStatus: import("../..").RetAtom<boolean>;
|
|
63
|
+
extendProps: {
|
|
64
|
+
type: number | undefined;
|
|
65
|
+
onSelectVideoIndex: (this: any, event: any) => void;
|
|
66
|
+
onLayoutStatusChanged: (this: any, event: any) => void;
|
|
67
|
+
onLocalizerViewLocated: (this: any, event: any) => Promise<void>;
|
|
68
|
+
};
|
|
69
|
+
setLayoutStyle: (style: import("../..").MultiCameraLayoutStyle) => void;
|
|
70
|
+
setScreenMode: (mode: import("../..").MultiCameraScreenMode) => void;
|
|
71
|
+
setPtzStatus: (value: boolean | ((prevValue: boolean) => boolean)) => void;
|
|
72
|
+
showLenNames: (value: boolean) => void;
|
|
73
|
+
setNextLayoutStyle: (value: import("../..").MultiCameraLayoutStyle | ((prevValue: import("../..").MultiCameraLayoutStyle) => import("../..").MultiCameraLayoutStyle)) => void;
|
|
74
|
+
getNextLayoutStyle: () => Promise<import("../..").MultiCameraLayoutStyle>;
|
|
75
|
+
};
|
|
48
76
|
} & {
|
|
49
77
|
className?: string | undefined;
|
|
50
78
|
}>;
|
|
@@ -72,7 +100,8 @@ export declare const BatteryFull: import("react").FunctionComponent<{
|
|
|
72
100
|
bottomLeftContent: import("../..").RetAtom<import("../..").ComponentConfig<any & Record<string, any>>[]>;
|
|
73
101
|
bottomRightContent: import("../..").RetAtom<import("../..").ComponentConfig<any & Record<string, any>>[]>;
|
|
74
102
|
absoluteContent: import("../..").RetAtom<import("../..").ComponentConfig<any & Record<string, any>>[]>;
|
|
75
|
-
|
|
103
|
+
ptzControlTipDisabled: import("../..").RetAtom<boolean>;
|
|
104
|
+
setPtzControlTipDisabled: (value: boolean) => void;
|
|
76
105
|
setBrandColor: (color: string) => void;
|
|
77
106
|
setVerticalMic: (value: boolean) => void;
|
|
78
107
|
setScreenType: (type: import("../..").ScreenType) => void;
|
|
@@ -87,13 +116,40 @@ export declare const BatteryFull: import("react").FunctionComponent<{
|
|
|
87
116
|
setPlayState: (value: import("../..").PlayState) => void;
|
|
88
117
|
addContent: <T>(type: import("../..").ContentPlaceType, config: import("../..").ComponentConfig<T> | import("../..").ComponentConfig<T>[], position?: number | undefined) => void;
|
|
89
118
|
deleteContent: (type: import("../..").ContentPlaceType, id: string) => void;
|
|
90
|
-
getContent: () =>
|
|
119
|
+
getContent: () => {
|
|
120
|
+
topLeft: import("../..").ComponentConfig<any & Record<string, any>>[];
|
|
121
|
+
topRight: import("../..").ComponentConfig<any & Record<string, any>>[];
|
|
122
|
+
bottomLeft: import("../..").ComponentConfig<any & Record<string, any>>[];
|
|
123
|
+
bottomRight: import("../..").ComponentConfig<any & Record<string, any>>[];
|
|
124
|
+
absolute: import("../..").ComponentConfig<any & Record<string, any>>[];
|
|
125
|
+
};
|
|
91
126
|
updateContent: (type: import("../..").ContentPlaceType, data: import("../..").ComponentConfig<any & Record<string, any>>[]) => void;
|
|
92
127
|
hasContent: (type: import("../..").ContentPlaceType, id: string) => boolean;
|
|
93
128
|
hideContent: (type: import("../..").ContentPlaceType, id: string) => void;
|
|
94
129
|
showContent: (type: import("../..").ContentPlaceType, id: string) => void;
|
|
95
130
|
toast: import("../../ports.output").Toast;
|
|
96
131
|
event: import("../..").EventInstance;
|
|
132
|
+
multiCameraCtx: {
|
|
133
|
+
isSupport: boolean;
|
|
134
|
+
protocol: import("../..").VideoSplitProtocol;
|
|
135
|
+
layoutStyle: import("../..").RetAtom<import("../..").MultiCameraLayoutStyle>;
|
|
136
|
+
screenMode: import("../..").RetAtom<import("../..").MultiCameraScreenMode>;
|
|
137
|
+
nextLayoutStyle: import("../..").RetAtom<import("../..").MultiCameraLayoutStyle>;
|
|
138
|
+
selectedLenInfo: import("../..").RetAtom<import("../..").MultiCameraLenInfo>;
|
|
139
|
+
ptzStatus: import("../..").RetAtom<boolean>;
|
|
140
|
+
extendProps: {
|
|
141
|
+
type: number | undefined;
|
|
142
|
+
onSelectVideoIndex: (this: any, event: any) => void;
|
|
143
|
+
onLayoutStatusChanged: (this: any, event: any) => void;
|
|
144
|
+
onLocalizerViewLocated: (this: any, event: any) => Promise<void>;
|
|
145
|
+
};
|
|
146
|
+
setLayoutStyle: (style: import("../..").MultiCameraLayoutStyle) => void;
|
|
147
|
+
setScreenMode: (mode: import("../..").MultiCameraScreenMode) => void;
|
|
148
|
+
setPtzStatus: (value: boolean | ((prevValue: boolean) => boolean)) => void;
|
|
149
|
+
showLenNames: (value: boolean) => void;
|
|
150
|
+
setNextLayoutStyle: (value: import("../..").MultiCameraLayoutStyle | ((prevValue: import("../..").MultiCameraLayoutStyle) => import("../..").MultiCameraLayoutStyle)) => void;
|
|
151
|
+
getNextLayoutStyle: () => Promise<import("../..").MultiCameraLayoutStyle>;
|
|
152
|
+
};
|
|
97
153
|
} & {
|
|
98
154
|
className?: string | undefined;
|
|
99
155
|
}>;
|
|
@@ -23,7 +23,8 @@ export function FullScreen(props) {
|
|
|
23
23
|
className,
|
|
24
24
|
showContent,
|
|
25
25
|
devId,
|
|
26
|
-
hideHorizontalMenu
|
|
26
|
+
hideHorizontalMenu,
|
|
27
|
+
multiCameraCtx
|
|
27
28
|
} = props;
|
|
28
29
|
const {
|
|
29
30
|
screenType
|
|
@@ -80,7 +81,8 @@ export function FullScreen(props) {
|
|
|
80
81
|
initProps: _objectSpread({}, props)
|
|
81
82
|
});
|
|
82
83
|
showContent('bottomLeft', 'FullSmallIntercom');
|
|
83
|
-
} else {
|
|
84
|
+
} else if (!multiCameraCtx.isSupport) {
|
|
85
|
+
// 单目设备,添加语音对讲控件
|
|
84
86
|
addContent('absolute', {
|
|
85
87
|
id: voiceIntercomId,
|
|
86
88
|
content: props => {
|
|
@@ -143,6 +145,6 @@ export function FullScreen(props) {
|
|
|
143
145
|
className: clsx(className),
|
|
144
146
|
onTouchStart: () => handClick('full')
|
|
145
147
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
146
|
-
className: clsx('icon-panel', 'icon-panel-landscape', 'ipc-player-plugin-full-screen')
|
|
148
|
+
className: clsx('icon-panel', 'icon-panel-landscape-new', 'ipc-player-plugin-full-screen')
|
|
147
149
|
}));
|
|
148
150
|
}
|
package/lib/widgets/index.d.ts
CHANGED
package/lib/widgets/index.js
CHANGED
|
@@ -12,4 +12,6 @@ export * from './resolution';
|
|
|
12
12
|
export * from './fullSmallIntercom';
|
|
13
13
|
export * from './verticalSmallIntercom';
|
|
14
14
|
export * from './moveInteractiveControl';
|
|
15
|
-
export * from './ptzControlTip';
|
|
15
|
+
export * from './ptzControlTip';
|
|
16
|
+
export * from './multiCamera';
|
|
17
|
+
export * from './smallIntercom';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const multiPrefix = "ipc-player-plugin-multi";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const multiPrefix = 'ipc-player-plugin-multi';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './switchLayout';
|
|
2
|
+
export * from './tileActions';
|
|
3
|
+
export * from './tileMultiPtz';
|
|
4
|
+
export * from './moveablePtzControl';
|
|
5
|
+
export * from './multiPtz';
|
|
6
|
+
export * from './ptzMoveableTip';
|
|
7
|
+
export * from './tileTip';
|
|
8
|
+
export * from './landscapeTip';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './switchLayout';
|
|
2
|
+
export * from './tileActions';
|
|
3
|
+
export * from './tileMultiPtz';
|
|
4
|
+
export * from './moveablePtzControl';
|
|
5
|
+
export * from './multiPtz';
|
|
6
|
+
export * from './ptzMoveableTip';
|
|
7
|
+
export * from './tileTip';
|
|
8
|
+
export * from './landscapeTip';
|