@ray-js/ipc-player-integration 0.0.1-beta-59 → 0.0.1-beta-61
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.composition.d.ts +1 -1
- package/lib/ctx/ctx.composition.js +3 -4
- package/lib/ctx/ctx.js +6 -12
- package/lib/features/index.d.ts +1 -0
- package/lib/features/index.js +1 -0
- package/lib/{utils/plugins → features/initPlayerWidgets}/index.d.ts +1 -1
- package/lib/{utils/plugins → features/initPlayerWidgets}/index.js +4 -2
- package/lib/i18n/index.d.ts +8 -0
- package/lib/i18n/strings.d.ts +4 -0
- package/lib/i18n/strings.js +6 -2
- package/lib/index.d.ts +3 -1
- package/lib/index.js +4 -2
- package/lib/interface.d.ts +5 -1
- package/lib/ports.output.js +1 -1
- package/lib/res/index.d.ts +2 -0
- package/lib/res/index.js +2 -0
- package/lib/res/player_ptz_control_tip.png +0 -0
- package/lib/ui/constant.d.ts +1 -0
- package/lib/ui/constant.js +1 -0
- package/lib/ui/ui.d.ts +1 -0
- package/lib/ui/ui.js +42 -21
- package/lib/utils/device/index.js +2 -28
- package/lib/{plugins → widgets}/battery/battery.composition.d.ts +6 -2
- package/lib/{plugins/index.js → widgets/index.d.ts} +2 -3
- package/lib/{plugins/index.d.ts → widgets/index.js} +1 -0
- package/lib/{plugins → widgets}/moveInteractiveControl/moveInteractiveControl.js +0 -1
- package/lib/{plugins → widgets}/ptz/ptz.js +0 -2
- package/lib/{plugins → widgets}/ptz/ptz.less +9 -0
- package/lib/{plugins → widgets}/ptz/ptzControl.js +36 -9
- package/lib/widgets/ptzControlTip/index.d.ts +1 -0
- package/lib/widgets/ptzControlTip/index.js +1 -0
- package/lib/widgets/ptzControlTip/ptzControlTip.d.ts +6 -0
- package/lib/widgets/ptzControlTip/ptzControlTip.js +45 -0
- package/lib/widgets/ptzControlTip/ptzControlTip.less +42 -0
- package/lib/{plugins → widgets}/recordVideo/recordVideo.js +2 -3
- package/lib/{plugins → widgets}/screenshot/screenshot.js +3 -7
- package/lib/{plugins → widgets}/tempHumidity/tempHumidity.js +0 -2
- package/lib/{plugins → widgets}/videoBitKBP/videoBitKBP.js +2 -2
- package/package.json +3 -3
- /package/lib/{plugins → widgets}/battery/battery.composition.js +0 -0
- /package/lib/{plugins → widgets}/battery/battery.d.ts +0 -0
- /package/lib/{plugins → widgets}/battery/battery.js +0 -0
- /package/lib/{plugins → widgets}/battery/battery.less +0 -0
- /package/lib/{plugins → widgets}/battery/batteryFull.d.ts +0 -0
- /package/lib/{plugins → widgets}/battery/batteryFull.js +0 -0
- /package/lib/{plugins → widgets}/battery/index.d.ts +0 -0
- /package/lib/{plugins → widgets}/battery/index.js +0 -0
- /package/lib/{plugins → widgets}/fullScreen/constant.d.ts +0 -0
- /package/lib/{plugins → widgets}/fullScreen/constant.js +0 -0
- /package/lib/{plugins → widgets}/fullScreen/fullScreen.d.ts +0 -0
- /package/lib/{plugins → widgets}/fullScreen/fullScreen.js +0 -0
- /package/lib/{plugins → widgets}/fullScreen/fullScreen.less +0 -0
- /package/lib/{plugins → widgets}/fullScreen/fullTravelRouteControl.d.ts +0 -0
- /package/lib/{plugins → widgets}/fullScreen/fullTravelRouteControl.js +0 -0
- /package/lib/{plugins → widgets}/fullScreen/fullVoiceIntercom.d.ts +0 -0
- /package/lib/{plugins → widgets}/fullScreen/fullVoiceIntercom.js +0 -0
- /package/lib/{plugins → widgets}/fullScreen/index.d.ts +0 -0
- /package/lib/{plugins → widgets}/fullScreen/index.js +0 -0
- /package/lib/{plugins → widgets}/fullScreen/verticalScreen.d.ts +0 -0
- /package/lib/{plugins → widgets}/fullScreen/verticalScreen.js +0 -0
- /package/lib/{plugins → widgets}/fullScreen/verticalScreen.less +0 -0
- /package/lib/{plugins → widgets}/fullSmallIntercom/fullSmallIntercom.d.ts +0 -0
- /package/lib/{plugins → widgets}/fullSmallIntercom/fullSmallIntercom.js +0 -0
- /package/lib/{plugins → widgets}/fullSmallIntercom/fullSmallIntercom.less +0 -0
- /package/lib/{plugins → widgets}/fullSmallIntercom/index.d.ts +0 -0
- /package/lib/{plugins → widgets}/fullSmallIntercom/index.js +0 -0
- /package/lib/{plugins → widgets}/moveInteractiveControl/controlButton.d.ts +0 -0
- /package/lib/{plugins → widgets}/moveInteractiveControl/controlButton.js +0 -0
- /package/lib/{plugins → widgets}/moveInteractiveControl/controlButton.less +0 -0
- /package/lib/{plugins → widgets}/moveInteractiveControl/index.d.ts +0 -0
- /package/lib/{plugins → widgets}/moveInteractiveControl/index.js +0 -0
- /package/lib/{plugins → widgets}/moveInteractiveControl/moveInteractiveControl.d.ts +0 -0
- /package/lib/{plugins → widgets}/moveInteractiveControl/moveInteractiveControl.less +0 -0
- /package/lib/{plugins → widgets}/moveInteractiveControl/moveInteractiveControlUI.d.ts +0 -0
- /package/lib/{plugins → widgets}/moveInteractiveControl/moveInteractiveControlUI.js +0 -0
- /package/lib/{plugins → widgets}/moveInteractiveControl/moveInteractiveControlUI.less +0 -0
- /package/lib/{plugins → widgets}/muted/index.d.ts +0 -0
- /package/lib/{plugins → widgets}/muted/index.js +0 -0
- /package/lib/{plugins → widgets}/muted/muted.d.ts +0 -0
- /package/lib/{plugins → widgets}/muted/muted.js +0 -0
- /package/lib/{plugins → widgets}/muted/muted.less +0 -0
- /package/lib/{plugins → widgets}/ptz/index.d.ts +0 -0
- /package/lib/{plugins → widgets}/ptz/index.js +0 -0
- /package/lib/{plugins → widgets}/ptz/ptz.d.ts +0 -0
- /package/lib/{plugins → widgets}/ptz/ptzControl.d.ts +0 -0
- /package/lib/{plugins → widgets}/recordVideo/index.d.ts +0 -0
- /package/lib/{plugins → widgets}/recordVideo/index.js +0 -0
- /package/lib/{plugins → widgets}/recordVideo/recordVideo.d.ts +0 -0
- /package/lib/{plugins → widgets}/recordVideo/recordVideo.less +0 -0
- /package/lib/{plugins → widgets}/resolution/fullResolutionControl.d.ts +0 -0
- /package/lib/{plugins → widgets}/resolution/fullResolutionControl.js +0 -0
- /package/lib/{plugins → widgets}/resolution/index.d.ts +0 -0
- /package/lib/{plugins → widgets}/resolution/index.js +0 -0
- /package/lib/{plugins → widgets}/resolution/resolution.d.ts +0 -0
- /package/lib/{plugins → widgets}/resolution/resolution.js +0 -0
- /package/lib/{plugins → widgets}/resolution/resolution.less +0 -0
- /package/lib/{plugins → widgets}/screenshot/index.d.ts +0 -0
- /package/lib/{plugins → widgets}/screenshot/index.js +0 -0
- /package/lib/{plugins → widgets}/screenshot/screenshot.d.ts +0 -0
- /package/lib/{plugins → widgets}/screenshot/screenshot.less +0 -0
- /package/lib/{plugins → widgets}/tempHumidity/index.d.ts +0 -0
- /package/lib/{plugins → widgets}/tempHumidity/index.js +0 -0
- /package/lib/{plugins → widgets}/tempHumidity/tempHumidity.d.ts +0 -0
- /package/lib/{plugins → widgets}/tempHumidity/tempHumidity.less +0 -0
- /package/lib/{plugins → widgets}/verticalSmallIntercom/index.d.ts +0 -0
- /package/lib/{plugins → widgets}/verticalSmallIntercom/index.js +0 -0
- /package/lib/{plugins → widgets}/verticalSmallIntercom/verticalSmallIntercom.d.ts +0 -0
- /package/lib/{plugins → widgets}/verticalSmallIntercom/verticalSmallIntercom.js +0 -0
- /package/lib/{plugins → widgets}/verticalSmallIntercom/verticalSmallIntercom.less +0 -0
- /package/lib/{plugins → widgets}/videoBitKBP/index.d.ts +0 -0
- /package/lib/{plugins → widgets}/videoBitKBP/index.js +0 -0
- /package/lib/{plugins → widgets}/videoBitKBP/videoBitKBP.d.ts +0 -0
- /package/lib/{plugins → widgets}/videoBitKBP/videoBitKBP.less +0 -0
- /package/lib/{plugins → widgets}/voiceIntercom/index.d.ts +0 -0
- /package/lib/{plugins → widgets}/voiceIntercom/index.js +0 -0
- /package/lib/{plugins → widgets}/voiceIntercom/voiceIntercom.d.ts +0 -0
- /package/lib/{plugins → widgets}/voiceIntercom/voiceIntercom.js +0 -0
- /package/lib/{plugins → widgets}/voiceIntercom/voiceIntercom.less +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
3
|
const _excluded = ["title", "duration"];
|
|
4
|
-
import
|
|
4
|
+
import { getCameraConfigInfo } from '@ray-js/ray-ipc-utils';
|
|
5
5
|
import { IntercomMode, MuteMode, ClarityType } from '@ray-js/ray-ipc-utils/lib/interface';
|
|
6
6
|
import { createUseCtx } from './ctx';
|
|
7
|
-
import { FullSmallIntercom, VerticalSmallIntercom, BatteryFull, Battery, Screenshot, TempHumidity, RecordVideo, FullScreen, VideoBitKBP, Muted, Resolution, Ptz } from '../
|
|
7
|
+
import { FullSmallIntercom, VerticalSmallIntercom, BatteryFull, Battery, Screenshot, TempHumidity, RecordVideo, FullScreen, VideoBitKBP, Muted, Resolution, Ptz } from '../widgets';
|
|
8
8
|
import { authorizeStatus } from '../utils/authorize';
|
|
9
9
|
const createPlayContext = ty.createIpcPlayerContext;
|
|
10
10
|
// const createPlayContext = () => null;
|
|
@@ -72,7 +72,7 @@ const getMemoryState = devId => {
|
|
|
72
72
|
isIntercomSupported: false
|
|
73
73
|
};
|
|
74
74
|
return new Promise(resolve => {
|
|
75
|
-
|
|
75
|
+
getCameraConfigInfo(devId).then(res => {
|
|
76
76
|
if (res.code === -1) {
|
|
77
77
|
return resolve(defaultValue);
|
|
78
78
|
}
|
|
@@ -113,7 +113,6 @@ const setResolutionMemoryState = (devId, value) => {
|
|
|
113
113
|
const newData = originStorage ? _objectSpread({}, originStorage) : null;
|
|
114
114
|
if (newData) {
|
|
115
115
|
newData.cachedResolution = value;
|
|
116
|
-
console.log(newData, 'newData');
|
|
117
116
|
// @ts-ignore
|
|
118
117
|
ty.setStorageSync({
|
|
119
118
|
key: storageKey,
|
package/lib/ctx/ctx.js
CHANGED
|
@@ -32,7 +32,8 @@ export const createUseCtx = _ref => {
|
|
|
32
32
|
initBottomLeftContent,
|
|
33
33
|
initBottomRightContent,
|
|
34
34
|
initAbsoluteContent,
|
|
35
|
-
saveToAlbum = SAVE_TO_ALBUM
|
|
35
|
+
saveToAlbum = SAVE_TO_ALBUM,
|
|
36
|
+
showPtzControlTip = false
|
|
36
37
|
} = _ref2;
|
|
37
38
|
const streamStatus = useRef();
|
|
38
39
|
// 全屏、竖屏
|
|
@@ -43,7 +44,8 @@ export const createUseCtx = _ref => {
|
|
|
43
44
|
|
|
44
45
|
// 录像是否不可点击
|
|
45
46
|
const [recordingDisabled, setRecordingDisabled] = useAtom(false);
|
|
46
|
-
|
|
47
|
+
// 是否展示ptz player控制提示框
|
|
48
|
+
const [ptzControlTipDisabled, setPtzControlTipDisabled] = useAtom(showPtzControlTip);
|
|
47
49
|
// 静音 true 代表静音 false 代表不静音
|
|
48
50
|
const [mute] = useAtom(true);
|
|
49
51
|
|
|
@@ -89,7 +91,6 @@ export const createUseCtx = _ref => {
|
|
|
89
91
|
if (!devId) return;
|
|
90
92
|
try {
|
|
91
93
|
const res = await getMemoryState(devId);
|
|
92
|
-
console.log('==== getMemoryState ====xghazh', res);
|
|
93
94
|
setResolutionList(res.resolutionList);
|
|
94
95
|
_setResolution(res.resolution, true);
|
|
95
96
|
_setMute(res.mute, true);
|
|
@@ -104,7 +105,6 @@ export const createUseCtx = _ref => {
|
|
|
104
105
|
if (devId && _playState === PlayState.PLAYING) {
|
|
105
106
|
// 获取缓存的值且同步
|
|
106
107
|
getMemoryState(devId).then(res => {
|
|
107
|
-
console.log('PlayingMemoryState', res);
|
|
108
108
|
setResolutionList(res.resolutionList);
|
|
109
109
|
// 传true表示值即可,会取播放器的值
|
|
110
110
|
_setResolution(res.resolution, true);
|
|
@@ -194,7 +194,6 @@ export const createUseCtx = _ref => {
|
|
|
194
194
|
clarity: target === ClarityType.HD ? 'hd' : 'normal',
|
|
195
195
|
success: () => {
|
|
196
196
|
setResolutionMemoryState(devId, target);
|
|
197
|
-
console.log('setClarity success', target);
|
|
198
197
|
updateAtom(resolution, target);
|
|
199
198
|
resolve(true);
|
|
200
199
|
},
|
|
@@ -214,6 +213,7 @@ export const createUseCtx = _ref => {
|
|
|
214
213
|
screenType,
|
|
215
214
|
recording,
|
|
216
215
|
recordingDisabled,
|
|
216
|
+
ptzControlTipDisabled,
|
|
217
217
|
mute,
|
|
218
218
|
resolution,
|
|
219
219
|
resolutionList,
|
|
@@ -222,6 +222,7 @@ export const createUseCtx = _ref => {
|
|
|
222
222
|
intercomSupported,
|
|
223
223
|
playState,
|
|
224
224
|
setPlayState,
|
|
225
|
+
setPtzControlTipDisabled,
|
|
225
226
|
setBrandColor,
|
|
226
227
|
setVerticalMic,
|
|
227
228
|
setIntercom: async target => {
|
|
@@ -286,9 +287,7 @@ export const createUseCtx = _ref => {
|
|
|
286
287
|
const {
|
|
287
288
|
platform
|
|
288
289
|
} = getSystemInfoSync();
|
|
289
|
-
console.log(platform, 'platform');
|
|
290
290
|
openAppSystemSettingPage({
|
|
291
|
-
// scope: platform === 'ios' ? 'App-Settings' : 'App-Settings-Permission',
|
|
292
291
|
scope: 'App-Settings',
|
|
293
292
|
success: () => {
|
|
294
293
|
console.log('跳转成功');
|
|
@@ -370,12 +369,7 @@ export const createUseCtx = _ref => {
|
|
|
370
369
|
isShowGlobal: true,
|
|
371
370
|
success: res => {
|
|
372
371
|
if (res.confirm) {
|
|
373
|
-
const {
|
|
374
|
-
platform
|
|
375
|
-
} = getSystemInfoSync();
|
|
376
|
-
console.log(platform, 'platform');
|
|
377
372
|
openAppSystemSettingPage({
|
|
378
|
-
// scope: platform === 'ios' ? 'App-Settings' : 'App-Settings-Permission',
|
|
379
373
|
scope: 'App-Settings',
|
|
380
374
|
success: () => {
|
|
381
375
|
console.log('跳转成功');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './initPlayerWidgets';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './initPlayerWidgets';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UseCtx } from '../../interface';
|
|
2
2
|
type Ctx = ReturnType<UseCtx>;
|
|
3
|
-
export declare function
|
|
3
|
+
export declare function initPlayerWidgets(ctx: Ctx, options: {
|
|
4
4
|
verticalResolutionCustomClick?: boolean;
|
|
5
5
|
hideHorizontalMenu?: boolean;
|
|
6
6
|
throttleTime?: number;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import _cloneDeep from 'lodash/cloneDeep';
|
|
2
2
|
import { defaultTopLeftContent, defaultTopRightContent, defaultBottomLeftContent, defaultBottomRightContent } from '../../ctx';
|
|
3
3
|
import { hasDpCode } from '../../utils/device';
|
|
4
|
-
import { MoveInteractiveControlButton } from '../../
|
|
4
|
+
import { MoveInteractiveControlButton } from '../../widgets/moveInteractiveControl';
|
|
5
5
|
// 根据当前 dp 信息决定设置哪些 plugin
|
|
6
|
-
export async function
|
|
6
|
+
export async function initPlayerWidgets(ctx, options) {
|
|
7
7
|
ctx.addContent('topLeft', defaultTopLeftContent);
|
|
8
8
|
ctx.addContent('topRight', defaultTopRightContent);
|
|
9
9
|
const newDefaultBottomLeftContent = _cloneDeep(defaultBottomLeftContent);
|
|
10
10
|
const resolutionIndex = newDefaultBottomLeftContent.findIndex(item => item.id === 'Resolution');
|
|
11
11
|
if (resolutionIndex !== -1) {
|
|
12
|
+
// @ts-ignore
|
|
12
13
|
newDefaultBottomLeftContent[resolutionIndex].initProps = {
|
|
13
14
|
verticalResolutionCustomClick: options.verticalResolutionCustomClick
|
|
14
15
|
};
|
|
@@ -17,6 +18,7 @@ export async function initPlayerPlugins(ctx, options) {
|
|
|
17
18
|
const newDefaultBottomRightContent = _cloneDeep(defaultBottomRightContent);
|
|
18
19
|
const fullScreenIndex = newDefaultBottomRightContent.findIndex(item => item.id === 'FullScreen');
|
|
19
20
|
if (fullScreenIndex !== -1) {
|
|
21
|
+
// @ts-ignore
|
|
20
22
|
newDefaultBottomRightContent[fullScreenIndex].initProps = {
|
|
21
23
|
hideHorizontalMenu: options.hideHorizontalMenu,
|
|
22
24
|
throttleTime: options.throttleTime
|
package/lib/i18n/index.d.ts
CHANGED
|
@@ -20,6 +20,8 @@ declare const Strings: kit.I18N<{
|
|
|
20
20
|
ipc_player_authorize_confirm_text: string;
|
|
21
21
|
ipc_player_error_record_tip: string;
|
|
22
22
|
ipc_player_change_resolution_success: string;
|
|
23
|
+
ipc_player_ptz_control_tip: string;
|
|
24
|
+
ipc_player_ptz_close_control_tip: string;
|
|
23
25
|
};
|
|
24
26
|
zh: {
|
|
25
27
|
ipc_player_resolution_HD: string;
|
|
@@ -41,6 +43,8 @@ declare const Strings: kit.I18N<{
|
|
|
41
43
|
ipc_player_authorize_confirm_text: string;
|
|
42
44
|
ipc_player_error_record_tip: string;
|
|
43
45
|
ipc_player_change_resolution_success: string;
|
|
46
|
+
ipc_player_ptz_control_tip: string;
|
|
47
|
+
ipc_player_ptz_close_control_tip: string;
|
|
44
48
|
};
|
|
45
49
|
}, {
|
|
46
50
|
ipc_player_resolution_HD: string;
|
|
@@ -62,6 +66,8 @@ declare const Strings: kit.I18N<{
|
|
|
62
66
|
ipc_player_authorize_confirm_text: string;
|
|
63
67
|
ipc_player_error_record_tip: string;
|
|
64
68
|
ipc_player_change_resolution_success: string;
|
|
69
|
+
ipc_player_ptz_control_tip: string;
|
|
70
|
+
ipc_player_ptz_close_control_tip: string;
|
|
65
71
|
} | {
|
|
66
72
|
ipc_player_resolution_HD: string;
|
|
67
73
|
ipc_player_resolution_SD: string;
|
|
@@ -82,5 +88,7 @@ declare const Strings: kit.I18N<{
|
|
|
82
88
|
ipc_player_authorize_confirm_text: string;
|
|
83
89
|
ipc_player_error_record_tip: string;
|
|
84
90
|
ipc_player_change_resolution_success: string;
|
|
91
|
+
ipc_player_ptz_control_tip: string;
|
|
92
|
+
ipc_player_ptz_close_control_tip: string;
|
|
85
93
|
}>;
|
|
86
94
|
export default Strings;
|
package/lib/i18n/strings.d.ts
CHANGED
|
@@ -19,6 +19,8 @@ declare const _default: {
|
|
|
19
19
|
ipc_player_authorize_confirm_text: string;
|
|
20
20
|
ipc_player_error_record_tip: string;
|
|
21
21
|
ipc_player_change_resolution_success: string;
|
|
22
|
+
ipc_player_ptz_control_tip: string;
|
|
23
|
+
ipc_player_ptz_close_control_tip: string;
|
|
22
24
|
};
|
|
23
25
|
zh: {
|
|
24
26
|
ipc_player_resolution_HD: string;
|
|
@@ -40,6 +42,8 @@ declare const _default: {
|
|
|
40
42
|
ipc_player_authorize_confirm_text: string;
|
|
41
43
|
ipc_player_error_record_tip: string;
|
|
42
44
|
ipc_player_change_resolution_success: string;
|
|
45
|
+
ipc_player_ptz_control_tip: string;
|
|
46
|
+
ipc_player_ptz_close_control_tip: string;
|
|
43
47
|
};
|
|
44
48
|
};
|
|
45
49
|
export default _default;
|
package/lib/i18n/strings.js
CHANGED
|
@@ -18,7 +18,9 @@ export default {
|
|
|
18
18
|
ipc_player_authorize_cancel_text: 'Cancel',
|
|
19
19
|
ipc_player_authorize_confirm_text: 'Go to Settings',
|
|
20
20
|
ipc_player_error_record_tip: 'The recording has failed, please try again later.',
|
|
21
|
-
ipc_player_change_resolution_success: '
|
|
21
|
+
ipc_player_change_resolution_success: 'Switch successful',
|
|
22
|
+
ipc_player_ptz_control_tip: 'Swipe up, down, left, or right to control the PTZ direction.',
|
|
23
|
+
ipc_player_ptz_close_control_tip: 'Close'
|
|
22
24
|
},
|
|
23
25
|
zh: {
|
|
24
26
|
ipc_player_resolution_HD: '高清',
|
|
@@ -39,6 +41,8 @@ export default {
|
|
|
39
41
|
ipc_player_authorize_cancel_text: '取消',
|
|
40
42
|
ipc_player_authorize_confirm_text: '去设置',
|
|
41
43
|
ipc_player_error_record_tip: '录制出错了,请稍后再试',
|
|
42
|
-
ipc_player_change_resolution_success: '切换成功'
|
|
44
|
+
ipc_player_change_resolution_success: '切换成功',
|
|
45
|
+
ipc_player_ptz_control_tip: '上下左右滑动,控制云台方向',
|
|
46
|
+
ipc_player_ptz_close_control_tip: '关闭'
|
|
43
47
|
}
|
|
44
48
|
};
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
package/lib/interface.d.ts
CHANGED
|
@@ -42,11 +42,13 @@ export type UseCtx = (options: {
|
|
|
42
42
|
initBottomRightContent?: ComponentConfig[];
|
|
43
43
|
initAbsoluteContent?: ComponentConfig[];
|
|
44
44
|
saveToAlbum?: 0 | 1;
|
|
45
|
+
showPtzControlTip?: boolean;
|
|
45
46
|
}) => {
|
|
46
47
|
devId: string;
|
|
47
48
|
brandColor: RetAtom<string>;
|
|
48
49
|
verticalMic: RetAtom<boolean>;
|
|
49
50
|
saveToAlbum: 0 | 1;
|
|
51
|
+
showPtzControlTip: boolean;
|
|
50
52
|
screenType: RetAtom<ScreenType>;
|
|
51
53
|
recording: RetAtom<boolean>;
|
|
52
54
|
recordingDisabled: RetAtom<boolean>;
|
|
@@ -63,8 +65,10 @@ export type UseCtx = (options: {
|
|
|
63
65
|
bottomLeftContent: RetAtom<ComponentConfig[]>;
|
|
64
66
|
bottomRightContent: RetAtom<ComponentConfig[]>;
|
|
65
67
|
absoluteContent: RetAtom<ComponentConfig[]>;
|
|
68
|
+
showPtzControlTip: RetAtom<boolean>;
|
|
69
|
+
setShowPtzControlTip: (value: boolean) => void;
|
|
66
70
|
setBrandColor: (color: string) => void;
|
|
67
|
-
setVerticalMic: (
|
|
71
|
+
setVerticalMic: (value: boolean) => void;
|
|
68
72
|
setScreenType: (type: ScreenType) => void;
|
|
69
73
|
setRecordingDisabled: (type: boolean) => void;
|
|
70
74
|
setResolution: (type: string) => void;
|
package/lib/ports.output.js
CHANGED
package/lib/res/index.js
ADDED
|
Binary file
|
package/lib/ui/constant.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export declare const voiceIntercomId = "voiceIntercomId";
|
|
|
7
7
|
export declare const fullTravelRouteControlId = "fullTravelRouteControl";
|
|
8
8
|
export declare const verticalScreenId = "verticalScreenId";
|
|
9
9
|
export declare const ptzControlId = "ptzControlId";
|
|
10
|
+
export declare const ptzControlTipId = "ptzControlTipId";
|
|
10
11
|
export declare const fullResolutionId = "fullResolutionId";
|
|
11
12
|
export declare const batteryId = "Battery";
|
|
12
13
|
export declare const fullSmallIntercomId = "FullSmallIntercom";
|
package/lib/ui/constant.js
CHANGED
|
@@ -7,6 +7,7 @@ export const voiceIntercomId = 'voiceIntercomId';
|
|
|
7
7
|
export const fullTravelRouteControlId = 'fullTravelRouteControl';
|
|
8
8
|
export const verticalScreenId = 'verticalScreenId';
|
|
9
9
|
export const ptzControlId = 'ptzControlId';
|
|
10
|
+
export const ptzControlTipId = 'ptzControlTipId';
|
|
10
11
|
export const fullResolutionId = 'fullResolutionId';
|
|
11
12
|
export const batteryId = 'Battery';
|
|
12
13
|
export const fullSmallIntercomId = 'FullSmallIntercom';
|
package/lib/ui/ui.d.ts
CHANGED
package/lib/ui/ui.js
CHANGED
|
@@ -51,6 +51,7 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
51
51
|
brandColor = '#FF592A',
|
|
52
52
|
verticalMic = true,
|
|
53
53
|
eventRef: eventRefProp,
|
|
54
|
+
landscapeMode = 'standard',
|
|
54
55
|
onPlayerTap,
|
|
55
56
|
extend = {}
|
|
56
57
|
} = props;
|
|
@@ -81,12 +82,13 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
81
82
|
}
|
|
82
83
|
useImperativeHandle(eventRefProp, () => eventRef.current, [eventRef.current]);
|
|
83
84
|
const timer = useRef();
|
|
85
|
+
const [scaleMultiple, setScaleMultiple] = useState(1);
|
|
86
|
+
const [currentZoomLevel, setCurrentZoomLevel] = useState(1);
|
|
84
87
|
useEffect(() => {
|
|
85
88
|
setBrandColor(brandColor);
|
|
86
89
|
setVerticalMic(verticalMic);
|
|
87
90
|
}, []);
|
|
88
91
|
const refreshBottomLeft = value => {
|
|
89
|
-
console.log(value, '++++++++++++++----sadbjasbdjbsj');
|
|
90
92
|
event.current.emit(startTimeToHideAllComponent);
|
|
91
93
|
event.current.emit(showAllComponent);
|
|
92
94
|
event.current.emit(playerTap);
|
|
@@ -107,11 +109,21 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
107
109
|
deviceType
|
|
108
110
|
} = systemInfo.current;
|
|
109
111
|
// 针对pad 暂不支持横屏,且在ios pad模式下 会触发onResize事件, 待解决
|
|
112
|
+
|
|
110
113
|
if (deviceType === 'pad') {
|
|
111
114
|
setScreenType('vertical');
|
|
112
115
|
} else {
|
|
113
116
|
setScreenType(type === 'landscape' ? 'full' : 'vertical');
|
|
114
117
|
}
|
|
118
|
+
|
|
119
|
+
// 若为全屏模式并且要求按宽填充,即横屏时充满,主动设置模式为-1即可
|
|
120
|
+
if (type === 'landscape' && landscapeMode === 'fill') {
|
|
121
|
+
console.log('横屏时充满');
|
|
122
|
+
setScaleMultiple(-1);
|
|
123
|
+
} else {
|
|
124
|
+
// 将屏幕播放比例设为1
|
|
125
|
+
setScaleMultiple(1);
|
|
126
|
+
}
|
|
115
127
|
} catch (err) {
|
|
116
128
|
console.log(err, 'err');
|
|
117
129
|
}
|
|
@@ -207,7 +219,25 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
207
219
|
/**
|
|
208
220
|
* 视频流加载状态封装
|
|
209
221
|
*/
|
|
210
|
-
|
|
222
|
+
const onChangeStreamStatus = useMemoizedFn(code => {
|
|
223
|
+
var _props$onPlayStatus;
|
|
224
|
+
const playStateMap = {
|
|
225
|
+
[PlayerStreamStatus.PreviewSuccess]: PlayState.PLAYING,
|
|
226
|
+
// 播放中
|
|
227
|
+
[PlayerStreamStatus.PAUSE]: PlayState.PAUSE // 暂停
|
|
228
|
+
};
|
|
229
|
+
// 合并为三种状态 连接中 暂停 播放中
|
|
230
|
+
const playState = playStateMap[code] || PlayState.CONNECTING;
|
|
231
|
+
if (playState !== PlayState.PLAYING) {
|
|
232
|
+
setScaleMultiple(currentZoomLevel);
|
|
233
|
+
}
|
|
234
|
+
setPlayState(playState);
|
|
235
|
+
(_props$onPlayStatus = props.onPlayStatus) === null || _props$onPlayStatus === void 0 || _props$onPlayStatus.call(props, {
|
|
236
|
+
playState,
|
|
237
|
+
playCode: code
|
|
238
|
+
});
|
|
239
|
+
instance.changeStreamStatus(code);
|
|
240
|
+
});
|
|
211
241
|
const disablePlayerTap = useRef(false);
|
|
212
242
|
const handDisablePlayerTap = value => {
|
|
213
243
|
disablePlayerTap.current = !!value;
|
|
@@ -274,34 +304,25 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
274
304
|
height: screenType === 'vertical' ? (style === null || style === void 0 ? void 0 : style.height) || '100%' : '100vh'
|
|
275
305
|
})
|
|
276
306
|
}, /*#__PURE__*/React.createElement(IPCPlayer, _extends({
|
|
277
|
-
objectFit: "",
|
|
278
307
|
defaultMute: mute,
|
|
279
308
|
devId: devId,
|
|
280
309
|
onlineStatus: deviceOnline,
|
|
281
310
|
ipcPlayerContext: instance.IPCPlayerInstance,
|
|
282
|
-
onChangeStreamStatus:
|
|
283
|
-
|
|
284
|
-
const playStateMap = {
|
|
285
|
-
[PlayerStreamStatus.PreviewSuccess]: PlayState.PLAYING,
|
|
286
|
-
// 播放中
|
|
287
|
-
[PlayerStreamStatus.PAUSE]: PlayState.PAUSE // 暂停
|
|
288
|
-
};
|
|
289
|
-
// 合并为三种状态 连接中 暂停 播放中
|
|
290
|
-
const playState = playStateMap[code] || PlayState.CONNECTING;
|
|
291
|
-
setPlayState(playState);
|
|
292
|
-
(_props$onPlayStatus = props.onPlayStatus) === null || _props$onPlayStatus === void 0 || _props$onPlayStatus.call(props, {
|
|
293
|
-
playState,
|
|
294
|
-
playCode: code
|
|
295
|
-
});
|
|
296
|
-
instance.changeStreamStatus(code);
|
|
297
|
-
}
|
|
298
|
-
// onCtx={getIpcPlayer}
|
|
311
|
+
onChangeStreamStatus: onChangeStreamStatus
|
|
312
|
+
// onCtx={getIpcPlayerCtx}
|
|
299
313
|
// onPlayerTap={handlePlayerClick}
|
|
300
314
|
,
|
|
301
315
|
onCameraNotifyWeakNetwork: data => {
|
|
302
316
|
console.log(`onCameraNotifyWeakNetwork: ${JSON.stringify(data)}`);
|
|
303
317
|
},
|
|
304
|
-
clarity: decodeClarityDic[resolution]
|
|
318
|
+
clarity: decodeClarityDic[resolution],
|
|
319
|
+
onZoomChange: data => {
|
|
320
|
+
const {
|
|
321
|
+
zoomLevel
|
|
322
|
+
} = data === null || data === void 0 ? void 0 : data.detail;
|
|
323
|
+
setCurrentZoomLevel(zoomLevel);
|
|
324
|
+
},
|
|
325
|
+
scaleMultiple: scaleMultiple
|
|
305
326
|
// 安卓横屏问题
|
|
306
327
|
// ptzControllable={screenType === 'vertical'}
|
|
307
328
|
,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "core-js/modules/esnext.iterator.constructor.js";
|
|
2
2
|
import "core-js/modules/esnext.iterator.find.js";
|
|
3
3
|
import "core-js/modules/esnext.iterator.for-each.js";
|
|
4
|
-
import
|
|
4
|
+
import { getDevInfo } from '@ray-js/ray-ipc-utils';
|
|
5
5
|
export function getDpValue(options) {
|
|
6
6
|
return new Promise((resolve, reject) => {
|
|
7
7
|
ty.device.getDeviceInfo({
|
|
@@ -90,32 +90,6 @@ export const showMathPowValue = (value, scale) => {
|
|
|
90
90
|
}
|
|
91
91
|
return v;
|
|
92
92
|
};
|
|
93
|
-
export const getDevInfo = deviceId => {
|
|
94
|
-
return new Promise(resolve => {
|
|
95
|
-
try {
|
|
96
|
-
ty.device.getDeviceInfo({
|
|
97
|
-
deviceId,
|
|
98
|
-
success: res => {
|
|
99
|
-
resolve({
|
|
100
|
-
code: 0,
|
|
101
|
-
data: res
|
|
102
|
-
});
|
|
103
|
-
},
|
|
104
|
-
fail: err => {
|
|
105
|
-
resolve({
|
|
106
|
-
code: -1,
|
|
107
|
-
msg: err
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
});
|
|
111
|
-
} catch (err) {
|
|
112
|
-
resolve({
|
|
113
|
-
code: -1,
|
|
114
|
-
msg: String(err)
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
};
|
|
119
93
|
|
|
120
94
|
/**
|
|
121
95
|
* 根据DpCode获取枚举型DP的range是否包含对应项
|
|
@@ -123,7 +97,7 @@ export const getDevInfo = deviceId => {
|
|
|
123
97
|
*/
|
|
124
98
|
|
|
125
99
|
export const getEnumRangeIsValid = async (devId, dpCode, rangValue) => {
|
|
126
|
-
const infoData = await
|
|
100
|
+
const infoData = await getDevInfo(devId);
|
|
127
101
|
if (infoData.code === 0) {
|
|
128
102
|
var _targetSchema$propert;
|
|
129
103
|
const {
|
|
@@ -6,6 +6,7 @@ export declare const Battery: import("react").FunctionComponent<{
|
|
|
6
6
|
brandColor: import("../..").RetAtom<string>;
|
|
7
7
|
verticalMic: import("../..").RetAtom<boolean>;
|
|
8
8
|
saveToAlbum: 0 | 1;
|
|
9
|
+
showPtzControlTip: boolean;
|
|
9
10
|
screenType: import("../..").RetAtom<import("../..").ScreenType>;
|
|
10
11
|
recording: import("../..").RetAtom<boolean>;
|
|
11
12
|
recordingDisabled: import("../..").RetAtom<boolean>;
|
|
@@ -22,8 +23,9 @@ export declare const Battery: import("react").FunctionComponent<{
|
|
|
22
23
|
bottomLeftContent: import("../..").RetAtom<import("../..").ComponentConfig<any & Record<string, any>>[]>;
|
|
23
24
|
bottomRightContent: import("../..").RetAtom<import("../..").ComponentConfig<any & Record<string, any>>[]>;
|
|
24
25
|
absoluteContent: import("../..").RetAtom<import("../..").ComponentConfig<any & Record<string, any>>[]>;
|
|
26
|
+
setShowPtzControlTip: (value: boolean) => void;
|
|
25
27
|
setBrandColor: (color: string) => void;
|
|
26
|
-
setVerticalMic: (
|
|
28
|
+
setVerticalMic: (value: boolean) => void;
|
|
27
29
|
setScreenType: (type: import("../..").ScreenType) => void;
|
|
28
30
|
setRecordingDisabled: (type: boolean) => void;
|
|
29
31
|
setResolution: (type: string) => void;
|
|
@@ -51,6 +53,7 @@ export declare const BatteryFull: import("react").FunctionComponent<{
|
|
|
51
53
|
brandColor: import("../..").RetAtom<string>;
|
|
52
54
|
verticalMic: import("../..").RetAtom<boolean>;
|
|
53
55
|
saveToAlbum: 0 | 1;
|
|
56
|
+
showPtzControlTip: boolean;
|
|
54
57
|
screenType: import("../..").RetAtom<import("../..").ScreenType>;
|
|
55
58
|
recording: import("../..").RetAtom<boolean>;
|
|
56
59
|
recordingDisabled: import("../..").RetAtom<boolean>;
|
|
@@ -67,8 +70,9 @@ export declare const BatteryFull: import("react").FunctionComponent<{
|
|
|
67
70
|
bottomLeftContent: import("../..").RetAtom<import("../..").ComponentConfig<any & Record<string, any>>[]>;
|
|
68
71
|
bottomRightContent: import("../..").RetAtom<import("../..").ComponentConfig<any & Record<string, any>>[]>;
|
|
69
72
|
absoluteContent: import("../..").RetAtom<import("../..").ComponentConfig<any & Record<string, any>>[]>;
|
|
73
|
+
setShowPtzControlTip: (value: boolean) => void;
|
|
70
74
|
setBrandColor: (color: string) => void;
|
|
71
|
-
setVerticalMic: (
|
|
75
|
+
setVerticalMic: (value: boolean) => void;
|
|
72
76
|
setScreenType: (type: import("../..").ScreenType) => void;
|
|
73
77
|
setRecordingDisabled: (type: boolean) => void;
|
|
74
78
|
setResolution: (type: string) => void;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
// 非全屏电池插件
|
|
2
1
|
export * from './battery';
|
|
3
|
-
// 全屏电池插件
|
|
4
2
|
export * from './battery/batteryFull';
|
|
5
3
|
export * from './screenshot';
|
|
6
4
|
export * from './tempHumidity';
|
|
@@ -13,4 +11,5 @@ export * from './ptz';
|
|
|
13
11
|
export * from './resolution';
|
|
14
12
|
export * from './fullSmallIntercom';
|
|
15
13
|
export * from './verticalSmallIntercom';
|
|
16
|
-
export * from './moveInteractiveControl';
|
|
14
|
+
export * from './moveInteractiveControl';
|
|
15
|
+
export * from './ptzControlTip';
|
|
@@ -31,7 +31,6 @@ export function MoveInteractiveControl(props) {
|
|
|
31
31
|
dpCodes: [TYPE_CODE, STATE_CODE],
|
|
32
32
|
listenDpChange: false
|
|
33
33
|
});
|
|
34
|
-
console.log('state', state);
|
|
35
34
|
const [schemaInfo] = useSchemaInfo(devId, [TYPE_CODE]);
|
|
36
35
|
const menu = useMemo(() => {
|
|
37
36
|
if (!schemaInfo || !(schemaInfo !== null && schemaInfo !== void 0 && schemaInfo[TYPE_CODE])) {
|
|
@@ -40,8 +40,6 @@ export const Ptz = props => {
|
|
|
40
40
|
}
|
|
41
41
|
}, [screenType]);
|
|
42
42
|
const onPtz = useMemoizedFn(() => {
|
|
43
|
-
console.log(isPtzActive, 'isPtzActive');
|
|
44
|
-
console.log(hasContent('absolute', ptzControlId), 'hasContent');
|
|
45
43
|
if (!isPtzActive) {
|
|
46
44
|
showContent('bottomLeft', 'FullSmallIntercom');
|
|
47
45
|
if (!hasContent('absolute', ptzControlId)) {
|