@ray-js/ray-ipc-utils 1.1.8 → 1.1.9
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/service/index.js +8 -4
- package/package.json +1 -1
package/lib/service/index.js
CHANGED
|
@@ -178,13 +178,14 @@ export const getCameraConfigInfo = async function (deviceId) {
|
|
|
178
178
|
intercomInfo.supportedIntercomModes = supportedIntercomModes.map(mode => intercomCallMode[mode]);
|
|
179
179
|
// 获取APP当前存储的对讲模式, 因目前设置页对讲设置使用的还是原生页面,需要读取APP缓存保持一致
|
|
180
180
|
|
|
181
|
+
console.log(type, '=========');
|
|
181
182
|
if (type === 'native') {
|
|
182
183
|
const appIntercomCached = await getCurrentSupportedTalkMode(deviceId);
|
|
183
184
|
if (appIntercomCached.code !== 0) {
|
|
184
185
|
intercomInfo.cachedIntercomMode = intercomCallMode[supportedIntercomModes[0]];
|
|
185
186
|
} else {
|
|
186
187
|
var _appIntercomCached$da;
|
|
187
|
-
intercomInfo.cachedIntercomMode = intercomCallMode[appIntercomCached === null || appIntercomCached === void 0 || (_appIntercomCached$da = appIntercomCached.data) === null || _appIntercomCached$da === void 0 ? void 0 : _appIntercomCached$da.talkbackMode];
|
|
188
|
+
intercomInfo.cachedIntercomMode = intercomCallMode[appIntercomCached === null || appIntercomCached === void 0 || (_appIntercomCached$da = appIntercomCached.data) === null || _appIntercomCached$da === void 0 ? void 0 : _appIntercomCached$da.talkbackMode] || defaultIntercomMode;
|
|
188
189
|
}
|
|
189
190
|
} else {
|
|
190
191
|
// 针对mini程序,直接使用接口返回的第一项数据
|
|
@@ -229,10 +230,12 @@ export const getCameraConfigInfo = async function (deviceId) {
|
|
|
229
230
|
setNativeStorage(`${deviceId}_microphone`, microphoneSettings);
|
|
230
231
|
if (type === 'native') {
|
|
231
232
|
const appIntercomCached = await getCurrentSupportedTalkMode(deviceId);
|
|
233
|
+
console.log(appIntercomCached, 'appIntercomCached');
|
|
232
234
|
// 如果接口返回成功,则取接口返回值
|
|
233
235
|
if (appIntercomCached.code === 0) {
|
|
234
236
|
var _appIntercomCached$da2;
|
|
235
|
-
|
|
237
|
+
console.log(appIntercomCached, 'appIntercomCached====');
|
|
238
|
+
intercomInfo.cachedIntercomMode = intercomCallMode[appIntercomCached === null || appIntercomCached === void 0 || (_appIntercomCached$da2 = appIntercomCached.data) === null || _appIntercomCached$da2 === void 0 ? void 0 : _appIntercomCached$da2.talkbackMode] || defaultIntercomMode;
|
|
236
239
|
}
|
|
237
240
|
}
|
|
238
241
|
setNativeStorage(`${deviceId}_intercom`, intercomInfo);
|
|
@@ -245,13 +248,14 @@ export const getCameraConfigInfo = async function (deviceId) {
|
|
|
245
248
|
// 对于对讲缓存的方式每次需从APP获取更新
|
|
246
249
|
const intercomStorageData = intercomStorage === null || intercomStorage === void 0 || (_intercomStorage$data2 = intercomStorage.data) === null || _intercomStorage$data2 === void 0 ? void 0 : _intercomStorage$data2.data;
|
|
247
250
|
intercomInfo = intercomStorageData;
|
|
251
|
+
console.log(type, 'type=====');
|
|
248
252
|
if (type === 'native') {
|
|
249
253
|
const appIntercomCached = await getCurrentSupportedTalkMode(deviceId);
|
|
250
254
|
if (appIntercomCached.code !== 0) {
|
|
251
|
-
intercomInfo.cachedIntercomMode = intercomCallMode[supportedIntercomModes[0]];
|
|
255
|
+
intercomInfo.cachedIntercomMode = intercomCallMode[supportedIntercomModes[0]] || defaultIntercomMode;
|
|
252
256
|
} else {
|
|
253
257
|
var _appIntercomCached$da3;
|
|
254
|
-
intercomInfo.cachedIntercomMode = intercomCallMode[appIntercomCached === null || appIntercomCached === void 0 || (_appIntercomCached$da3 = appIntercomCached.data) === null || _appIntercomCached$da3 === void 0 ? void 0 : _appIntercomCached$da3.talkbackMode];
|
|
258
|
+
intercomInfo.cachedIntercomMode = intercomCallMode[appIntercomCached === null || appIntercomCached === void 0 || (_appIntercomCached$da3 = appIntercomCached.data) === null || _appIntercomCached$da3 === void 0 ? void 0 : _appIntercomCached$da3.talkbackMode] || defaultIntercomMode;
|
|
255
259
|
}
|
|
256
260
|
if (intercomStorageData.cachedIntercomMode !== intercomInfo.cachedIntercomMode) {
|
|
257
261
|
setNativeStorage(`${deviceId}_intercom`, intercomInfo);
|