@ray-js/ipc-player-integration 0.0.1-beta-48 → 0.0.1-beta-49
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
CHANGED
|
@@ -3,7 +3,7 @@ import "core-js/modules/esnext.iterator.filter.js";
|
|
|
3
3
|
import "core-js/modules/esnext.iterator.find.js";
|
|
4
4
|
import "core-js/modules/esnext.iterator.map.js";
|
|
5
5
|
import { useRef, useCallback, useEffect } from 'react';
|
|
6
|
-
import { getSystemInfoSync, showModal, openSystemSettingPage } from '@ray-js/ray';
|
|
6
|
+
import { getSystemInfoSync, showModal, openSystemSettingPage, openAppSystemSettingPage } from '@ray-js/ray';
|
|
7
7
|
import Strings from '../i18n';
|
|
8
8
|
import { useAtom, updateAtom, getDefaultStore, useStore } from './store';
|
|
9
9
|
import { PlayState, IntercomMode } from '../interface';
|
|
@@ -147,10 +147,6 @@ export const createUseCtx = _ref => {
|
|
|
147
147
|
});
|
|
148
148
|
console.log('喇叭调用失败', JSON.stringify(err));
|
|
149
149
|
reject(err);
|
|
150
|
-
|
|
151
|
-
// const errObj = err.innerError || err || {};
|
|
152
|
-
// const errMsg = errObj.errorMsg || I18n.t('error_setMute');
|
|
153
|
-
// toast({ title: errMsg });
|
|
154
150
|
}
|
|
155
151
|
});
|
|
156
152
|
});
|
|
@@ -238,8 +234,9 @@ export const createUseCtx = _ref => {
|
|
|
238
234
|
platform
|
|
239
235
|
} = getSystemInfoSync();
|
|
240
236
|
console.log(platform, 'platform');
|
|
241
|
-
|
|
242
|
-
scope: platform === 'ios' ? 'App-Settings' : 'App-Settings-Permission',
|
|
237
|
+
openAppSystemSettingPage({
|
|
238
|
+
// scope: platform === 'ios' ? 'App-Settings' : 'App-Settings-Permission',
|
|
239
|
+
scope: 'App-Settings',
|
|
243
240
|
success: () => {
|
|
244
241
|
console.log('跳转成功');
|
|
245
242
|
}
|
|
@@ -257,6 +254,7 @@ export const createUseCtx = _ref => {
|
|
|
257
254
|
resolve(true);
|
|
258
255
|
},
|
|
259
256
|
fail: err => {
|
|
257
|
+
console.log(err, '结束对讲失败');
|
|
260
258
|
updateAtom(intercom, true);
|
|
261
259
|
reject(err);
|
|
262
260
|
}
|
package/lib/plugins/ptz/ptz.less
CHANGED
|
@@ -4,6 +4,7 @@ import { useSetState, useUpdateEffect } from 'ahooks';
|
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import IpcUtils from '@ray-js/ray-ipc-utils';
|
|
6
6
|
import Strings from '../../i18n';
|
|
7
|
+
import { PlayState } from '../../interface';
|
|
7
8
|
import { UIEventContext } from '../../ui/context';
|
|
8
9
|
import { pauseTimeToHideAllComponent } from '../../ui/constant';
|
|
9
10
|
import { useStore, getDefaultStore } from '../../ctx/store';
|
|
@@ -87,12 +88,14 @@ export function RecordVideo(props) {
|
|
|
87
88
|
recording,
|
|
88
89
|
brandColor,
|
|
89
90
|
screenType,
|
|
90
|
-
recordingDisabled
|
|
91
|
+
recordingDisabled,
|
|
92
|
+
playState
|
|
91
93
|
} = useStore({
|
|
92
94
|
recording: recordingAtom,
|
|
93
95
|
brandColor: props.brandColor,
|
|
94
96
|
screenType: props.screenType,
|
|
95
|
-
recordingDisabled: props.recordingDisabled
|
|
97
|
+
recordingDisabled: props.recordingDisabled,
|
|
98
|
+
playState: props.playState
|
|
96
99
|
});
|
|
97
100
|
const [state, setState] = useSetState({
|
|
98
101
|
showTimer: false,
|
|
@@ -100,6 +103,22 @@ export function RecordVideo(props) {
|
|
|
100
103
|
shotUrl: ''
|
|
101
104
|
});
|
|
102
105
|
|
|
106
|
+
/**
|
|
107
|
+
* 针对 playState为非连接中状态时,如果处于录制中, 结束录制
|
|
108
|
+
*/
|
|
109
|
+
useEffect(() => {
|
|
110
|
+
(async () => {
|
|
111
|
+
if (playState !== PlayState.PLAYING) {
|
|
112
|
+
if (recording) {
|
|
113
|
+
setState({
|
|
114
|
+
showTimer: false
|
|
115
|
+
});
|
|
116
|
+
await setRecording(false);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
})();
|
|
120
|
+
}, [playState, recording]);
|
|
121
|
+
|
|
103
122
|
/** 设置5秒后关闭录制成功弹窗 */
|
|
104
123
|
const timer = useRef();
|
|
105
124
|
const timeToCloseRecordToast = () => {
|
|
@@ -29,7 +29,6 @@ export const Resolution = props => {
|
|
|
29
29
|
event
|
|
30
30
|
} = useContext(UIEventContext);
|
|
31
31
|
const onResolution = useMemoizedFn(() => {
|
|
32
|
-
console.log('你触发了高标清点击了吗');
|
|
33
32
|
event.emit('resolutionBtnControlClick');
|
|
34
33
|
console.log(`screenType: ${screenType}`);
|
|
35
34
|
if (screenType === 'full') {
|
|
@@ -3,9 +3,9 @@ import React, { useRef, useContext, useState, useEffect } from 'react';
|
|
|
3
3
|
import { View } from '@ray-js/ray';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import Svg from '@ray-js/svg';
|
|
6
|
-
import { useStore, getDefaultStore } from '../../ctx/store';
|
|
6
|
+
import { useStore, getDefaultStore, updateAtom } from '../../ctx/store';
|
|
7
7
|
import './voiceIntercom.less';
|
|
8
|
-
import { PlayerStreamStatus, IntercomMode } from '../../interface';
|
|
8
|
+
import { PlayerStreamStatus, IntercomMode, PlayState } from '../../interface';
|
|
9
9
|
import { UIEventContext } from '../../ui/context';
|
|
10
10
|
import { radialGradient } from '../../utils';
|
|
11
11
|
import { startTimeToHideAllComponent, pauseTimeToHideAllComponent } from '../../ui/constant';
|
|
@@ -41,13 +41,15 @@ export const VoiceIntercom = props => {
|
|
|
41
41
|
mute,
|
|
42
42
|
intercom,
|
|
43
43
|
intercomMode,
|
|
44
|
-
brandColor
|
|
44
|
+
brandColor,
|
|
45
|
+
playState
|
|
45
46
|
} = useStore({
|
|
46
47
|
recording: props.recording,
|
|
47
48
|
mute: props.mute,
|
|
48
49
|
intercom: props.intercom,
|
|
49
50
|
intercomMode: props.intercomMode,
|
|
50
|
-
brandColor: props.brandColor
|
|
51
|
+
brandColor: props.brandColor,
|
|
52
|
+
playState: props.playState
|
|
51
53
|
});
|
|
52
54
|
// 对讲开始之前的静音状态
|
|
53
55
|
const originMuteStatusBeforeVoice = useRef(mute);
|
|
@@ -69,6 +71,20 @@ export const VoiceIntercom = props => {
|
|
|
69
71
|
}
|
|
70
72
|
event.emit(pauseTimeToHideAllComponent);
|
|
71
73
|
};
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* 针对 playState为非连接中状态时,如果处于对讲中, 结束对讲
|
|
77
|
+
*/
|
|
78
|
+
useEffect(() => {
|
|
79
|
+
(async () => {
|
|
80
|
+
console.log('=== 开始结束对讲 ====', intercom);
|
|
81
|
+
if (playState !== PlayState.PLAYING) {
|
|
82
|
+
if (intercom) {
|
|
83
|
+
updateAtom(props.intercom, false);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
})();
|
|
87
|
+
}, [playState, intercom]);
|
|
72
88
|
const endVoice = async () => {
|
|
73
89
|
console.log('=== 结束对讲 ====');
|
|
74
90
|
// 对讲结束之后,统一关闭静态状态
|
package/lib/ui/ui.js
CHANGED
|
@@ -295,11 +295,10 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
295
295
|
ptzControllable: screenType === 'vertical',
|
|
296
296
|
privateState: privateState,
|
|
297
297
|
onPlayerTap: data => {
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
console.log('res===on onVideoTap', data);
|
|
298
|
+
if (disablePlayerTap.current) {
|
|
299
|
+
console.log('playerTap 事件已禁止');
|
|
300
|
+
return;
|
|
301
|
+
}
|
|
303
302
|
eventRef.current.emit(playerTap);
|
|
304
303
|
console.log(prevTriggerEvent.current, 'prevTriggerEvent.current');
|
|
305
304
|
if (prevTriggerEvent.current === hideAllComponent) {
|
|
@@ -307,7 +306,7 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
307
306
|
} else {
|
|
308
307
|
triggerEvent(hideAllComponent);
|
|
309
308
|
}
|
|
310
|
-
onPlayerTap(data);
|
|
309
|
+
onPlayerTap && onPlayerTap(data);
|
|
311
310
|
return false; // eslint-disable-line
|
|
312
311
|
} // 对应原来的onVideoTap
|
|
313
312
|
,
|