agora-appbuilder-core 4.0.0-spl.16 → 4.0.0-spl.18
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/package.json
CHANGED
|
@@ -165,9 +165,18 @@ if ($config.GEO_FENCING) {
|
|
|
165
165
|
}
|
|
166
166
|
|
|
167
167
|
if ($config.LOG_ENABLED) {
|
|
168
|
-
|
|
168
|
+
if (
|
|
169
|
+
(APPBUILDER_PUBLIC_TARGET === 'wsdk' ||
|
|
170
|
+
APPBUILDER_PUBLIC_TARGET === 'rsdk') &&
|
|
171
|
+
APPBUILDER_PUBLIC_NODE_ENV === 'production'
|
|
172
|
+
) {
|
|
173
|
+
AgoraRTC.setLogLevel(4);
|
|
174
|
+
} else {
|
|
175
|
+
AgoraRTC.setLogLevel(0);
|
|
176
|
+
}
|
|
169
177
|
AgoraRTC.enableLogUpload();
|
|
170
178
|
} else {
|
|
179
|
+
AgoraRTC.setLogLevel(4);
|
|
171
180
|
AgoraRTC.disableLogUpload();
|
|
172
181
|
}
|
|
173
182
|
|
|
@@ -224,6 +233,9 @@ export default class RtcEngine {
|
|
|
224
233
|
|
|
225
234
|
async enableAudio(): Promise<void> {
|
|
226
235
|
const audioConfig: MicrophoneAudioTrackInitConfig = {
|
|
236
|
+
encoderConfig: $config.AUDIO_ENCODER_CONFIG_PRESET
|
|
237
|
+
? $config.AUDIO_ENCODER_CONFIG_PRESET
|
|
238
|
+
: undefined,
|
|
227
239
|
bypassWebAudio: Platform.OS == 'web' && isMobileOrTablet(),
|
|
228
240
|
// microphoneId: this.audioDeviceId,
|
|
229
241
|
};
|
|
@@ -257,6 +269,9 @@ export default class RtcEngine {
|
|
|
257
269
|
const audioConfig: MicrophoneAudioTrackInitConfig = {
|
|
258
270
|
bypassWebAudio: Platform.OS == 'web' && isMobileOrTablet(),
|
|
259
271
|
microphoneId: preferredMicrophoneId,
|
|
272
|
+
encoderConfig: $config.AUDIO_ENCODER_CONFIG_PRESET
|
|
273
|
+
? $config.AUDIO_ENCODER_CONFIG_PRESET
|
|
274
|
+
: undefined,
|
|
260
275
|
};
|
|
261
276
|
const videoConfig: CameraVideoTrackInitConfig = {
|
|
262
277
|
encoderConfig: this.videoProfile,
|
|
@@ -307,7 +322,32 @@ export default class RtcEngine {
|
|
|
307
322
|
localVideo = await AgoraRTC.createCameraVideoTrack(videoConfig);
|
|
308
323
|
} catch (e) {
|
|
309
324
|
videoConfig.cameraId = '';
|
|
310
|
-
|
|
325
|
+
try {
|
|
326
|
+
localVideo = await AgoraRTC.createCameraVideoTrack(videoConfig);
|
|
327
|
+
} catch (e) {
|
|
328
|
+
console.log(
|
|
329
|
+
'[RTCEngineBridge]: Provided cameraId and default camera failed, trying other available devices',
|
|
330
|
+
);
|
|
331
|
+
const devices = await navigator.mediaDevices.enumerateDevices();
|
|
332
|
+
for (let device of devices) {
|
|
333
|
+
if (device.kind === 'videoinput') {
|
|
334
|
+
videoConfig.cameraId = device.deviceId;
|
|
335
|
+
try {
|
|
336
|
+
localVideo = await AgoraRTC.createCameraVideoTrack(
|
|
337
|
+
videoConfig,
|
|
338
|
+
);
|
|
339
|
+
break;
|
|
340
|
+
} catch (e) {
|
|
341
|
+
console.log(
|
|
342
|
+
'[RTCEngineBridge]:',
|
|
343
|
+
'Camera not available with deviceId' + device,
|
|
344
|
+
'Reason: ',
|
|
345
|
+
e,
|
|
346
|
+
);
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
}
|
|
311
351
|
}
|
|
312
352
|
this.localStream.video = localVideo;
|
|
313
353
|
this.videoDeviceId = localVideo
|
package/template/global.d.ts
CHANGED
package/template/index.rsdk.tsx
CHANGED
|
@@ -28,10 +28,6 @@ interface AppBuilderReactSdkInterface extends AppBuilderSdkApiInterface {
|
|
|
28
28
|
View: React.FC;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
if (APPBUILDER_PUBLIC_NODE_ENV === 'production') {
|
|
32
|
-
AgoraRTC.setLogLevel(4);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
31
|
const AppBuilderReactSdkApi: AppBuilderReactSdkInterface = {
|
|
36
32
|
...AppBuilderSdkApi,
|
|
37
33
|
View: SDKAppWrapper,
|
package/template/index.wsdk.tsx
CHANGED
|
@@ -10,10 +10,6 @@ import AgoraRTC from 'agora-rtc-sdk-ng';
|
|
|
10
10
|
export * from 'customization-api';
|
|
11
11
|
export * from 'customization-implementation';
|
|
12
12
|
|
|
13
|
-
if (APPBUILDER_PUBLIC_NODE_ENV === 'production') {
|
|
14
|
-
AgoraRTC.setLogLevel(4);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
13
|
const AppBuilderWebSdkApi: AppBuilderSdkApiInterface = AppBuilderSdkApi;
|
|
18
14
|
|
|
19
15
|
// init code
|