@ray-js/ray-ipc-utils 1.1.0-beta-11 → 1.1.0-beta-12

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.
@@ -80,12 +80,14 @@ export const setNativeStorage = (key, data) => {
80
80
  key,
81
81
  data,
82
82
  success: res => {
83
+ console.log(res, '______');
83
84
  resolve({
84
85
  code: 0,
85
86
  data: res
86
87
  });
87
88
  },
88
89
  fail: err => {
90
+ console.log(err, '___________');
89
91
  resolve({
90
92
  code: -1,
91
93
  msg: err
@@ -147,6 +147,7 @@ export const getCameraConfigInfo = async deviceId => {
147
147
  })) {
148
148
  // 非虚拟机设备,请求接口
149
149
  if (!isVirtualDevice) {
150
+ var _microphoneStorage$da, _intercomStorage$data, _resolutionStorage$da, _maxZoomSettingsStora;
150
151
  const rtcInfo = await getIpcConfigInfo(deviceId);
151
152
  if (rtcInfo.code === 0) {
152
153
  var _rtcApiResult$audioAt, _rtcApiResult$audioAt2, _rtcApiResult$audioAt3;
@@ -184,41 +185,46 @@ export const getCameraConfigInfo = async deviceId => {
184
185
  // 4. 最大倍数模块
185
186
  maxZoomSettings = (rtcApiResult === null || rtcApiResult === void 0 ? void 0 : rtcApiResult.maxZoomInTimes) !== 0 ? rtcApiResult === null || rtcApiResult === void 0 ? void 0 : rtcApiResult.maxZoomInTimes : 6;
186
187
  }
187
-
188
+ // 由于utils为统一返回,多加了一层data,所以需要取data.data
188
189
  // 1. 设置拾音器缓存
189
- if (!microphoneStorage.data) {
190
+ const microphoneStorageData = microphoneStorage === null || microphoneStorage === void 0 || (_microphoneStorage$da = microphoneStorage.data) === null || _microphoneStorage$da === void 0 ? void 0 : _microphoneStorage$da.data;
191
+ if (!microphoneStorageData) {
190
192
  setNativeStorage(`${deviceId}_microphone`, microphoneSettings);
191
193
  }
192
194
  // 2. 设置对讲缓存
193
- if (!intercomStorage.data) {
195
+ const intercomStorageData = intercomStorage === null || intercomStorage === void 0 || (_intercomStorage$data = intercomStorage.data) === null || _intercomStorage$data === void 0 ? void 0 : _intercomStorage$data.data;
196
+ if (!intercomStorageData) {
194
197
  setNativeStorage(`${deviceId}_intercom`, intercomInfo);
195
198
  }
196
199
 
197
200
  // 3. 设置视频清晰度缓存
198
- if (!resolutionStorage.data) {
201
+ const resolutionStorageData = resolutionStorage === null || resolutionStorage === void 0 || (_resolutionStorage$da = resolutionStorage.data) === null || _resolutionStorage$da === void 0 ? void 0 : _resolutionStorage$da.data;
202
+ if (!resolutionStorageData) {
199
203
  setNativeStorage(`${deviceId}_resolution`, videoResolution);
200
204
  }
201
205
 
202
206
  // 4. 设置最大倍数缓存
203
- if (!maxZoomSettingsStorage.data) {
207
+ const maxZoomSettingsStorageData = maxZoomSettingsStorage === null || maxZoomSettingsStorage === void 0 || (_maxZoomSettingsStora = maxZoomSettingsStorage.data) === null || _maxZoomSettingsStora === void 0 ? void 0 : _maxZoomSettingsStora.data;
208
+ if (!maxZoomSettingsStorageData) {
204
209
  setNativeStorage(`${deviceId}_maxZoomSettings`, maxZoomSettings);
205
210
  }
206
211
  }
207
212
  } else {
208
- var _appIntercomCached$da2, _intercomStorage$data;
213
+ var _intercomStorage$data2, _appIntercomCached$da2, _resolutionStorage$da2, _microphoneStorage$da2, _maxZoomSettingsStora2;
209
214
  // 对于对讲缓存的方式每次需从APP获取更新
210
- intercomInfo = intercomStorage.data;
215
+ const intercomStorageData = intercomStorage === null || intercomStorage === void 0 || (_intercomStorage$data2 = intercomStorage.data) === null || _intercomStorage$data2 === void 0 ? void 0 : _intercomStorage$data2.data;
216
+ intercomInfo = intercomStorageData;
211
217
  const appIntercomCached = await getCurrentSupportedTalkMode(deviceId);
212
218
  if (appIntercomCached.code !== 0) {
213
219
  throw appIntercomCached.msg;
214
220
  }
215
221
  intercomInfo.cachedIntercomMode = intercomCallMode[appIntercomCached === null || appIntercomCached === void 0 || (_appIntercomCached$da2 = appIntercomCached.data) === null || _appIntercomCached$da2 === void 0 ? void 0 : _appIntercomCached$da2.talkbackMode];
216
- if ((intercomStorage === null || intercomStorage === void 0 || (_intercomStorage$data = intercomStorage.data) === null || _intercomStorage$data === void 0 ? void 0 : _intercomStorage$data.cachedIntercomMode) !== intercomInfo.cachedIntercomMode) {
222
+ if (intercomStorageData.cachedIntercomMode !== intercomInfo.cachedIntercomMode) {
217
223
  setNativeStorage(`${deviceId}_intercom`, intercomInfo);
218
224
  }
219
- videoResolution = resolutionStorage.data;
220
- microphoneSettings = microphoneStorage.data;
221
- maxZoomSettings = maxZoomSettingsStorage.data;
225
+ videoResolution = resolutionStorage === null || resolutionStorage === void 0 || (_resolutionStorage$da2 = resolutionStorage.data) === null || _resolutionStorage$da2 === void 0 ? void 0 : _resolutionStorage$da2.data;
226
+ microphoneSettings = microphoneStorage === null || microphoneStorage === void 0 || (_microphoneStorage$da2 = microphoneStorage.data) === null || _microphoneStorage$da2 === void 0 ? void 0 : _microphoneStorage$da2.data;
227
+ maxZoomSettings = maxZoomSettingsStorage === null || maxZoomSettingsStorage === void 0 || (_maxZoomSettingsStora2 = maxZoomSettingsStorage.data) === null || _maxZoomSettingsStora2 === void 0 ? void 0 : _maxZoomSettingsStora2.data;
222
228
  }
223
229
  const ipcConfig = {
224
230
  videoResolution,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/ray-ipc-utils",
3
- "version": "1.1.0-beta-11",
3
+ "version": "1.1.0-beta-12",
4
4
  "description": "IPC 工具库",
5
5
  "main": "lib/index",
6
6
  "files": [