@stream-io/video-react-native-sdk 1.43.0 → 1.45.0
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/CHANGELOG.md +44 -1
- package/dist/commonjs/components/Call/CallControls/internal/ReactionsPicker.js.map +1 -1
- package/dist/commonjs/components/Call/Lobby/Lobby.js +4 -9
- package/dist/commonjs/components/Call/Lobby/Lobby.js.map +1 -1
- package/dist/commonjs/components/Call/Lobby/LobbyCameraPreview.js +93 -0
- package/dist/commonjs/components/Call/Lobby/LobbyCameraPreview.js.map +1 -0
- package/dist/commonjs/components/Call/Lobby/index.js +11 -0
- package/dist/commonjs/components/Call/Lobby/index.js.map +1 -1
- package/dist/commonjs/components/Participant/ParticipantView/VideoRenderer/TrackSubscriber.js +4 -15
- package/dist/commonjs/components/Participant/ParticipantView/VideoRenderer/TrackSubscriber.js.map +1 -1
- package/dist/commonjs/components/Participant/ParticipantView/VideoRenderer/index.js +10 -4
- package/dist/commonjs/components/Participant/ParticipantView/VideoRenderer/index.js.map +1 -1
- package/dist/commonjs/hooks/push/useCallingExpWithCallingStateEffect.js +9 -5
- package/dist/commonjs/hooks/push/useCallingExpWithCallingStateEffect.js.map +1 -1
- package/dist/commonjs/hooks/useLoopbackRecording.js +10 -127
- package/dist/commonjs/hooks/useLoopbackRecording.js.map +1 -1
- package/dist/commonjs/modules/call-manager/CallManager.js +37 -54
- package/dist/commonjs/modules/call-manager/CallManager.js.map +1 -1
- package/dist/commonjs/utils/StreamVideoRN/index.js +2 -0
- package/dist/commonjs/utils/StreamVideoRN/index.js.map +1 -1
- package/dist/commonjs/utils/internal/callingx/callingx.js +28 -39
- package/dist/commonjs/utils/internal/callingx/callingx.js.map +1 -1
- package/dist/commonjs/utils/internal/registerMediaEngine.js +41 -0
- package/dist/commonjs/utils/internal/registerMediaEngine.js.map +1 -0
- package/dist/commonjs/utils/internal/registerSDKGlobals.js +93 -35
- package/dist/commonjs/utils/internal/registerSDKGlobals.js.map +1 -1
- package/dist/commonjs/utils/push/android.js +13 -175
- package/dist/commonjs/utils/push/android.js.map +1 -1
- package/dist/commonjs/utils/push/internal/android.js +186 -0
- package/dist/commonjs/utils/push/internal/android.js.map +1 -0
- package/dist/commonjs/utils/push/libs/firebaseMessaging/index.js +8 -9
- package/dist/commonjs/utils/push/libs/firebaseMessaging/index.js.map +1 -1
- package/dist/commonjs/utils/push/libs/firebaseMessaging/lib.js +1 -1
- package/dist/commonjs/utils/push/libs/firebaseMessaging/lib.js.map +1 -1
- package/dist/commonjs/utils/push/setupAndroidPushEvents.js +25 -0
- package/dist/commonjs/utils/push/setupAndroidPushEvents.js.map +1 -0
- package/dist/commonjs/utils/push/setupCallingExpEvents.js +6 -2
- package/dist/commonjs/utils/push/setupCallingExpEvents.js.map +1 -1
- package/dist/commonjs/utils/push/setupIosVoipPushEvents.js +6 -7
- package/dist/commonjs/utils/push/setupIosVoipPushEvents.js.map +1 -1
- package/dist/commonjs/utils/push/utils.js.map +1 -1
- package/dist/commonjs/version.js +1 -1
- package/dist/module/components/Call/CallControls/internal/ReactionsPicker.js.map +1 -1
- package/dist/module/components/Call/Lobby/Lobby.js +4 -9
- package/dist/module/components/Call/Lobby/Lobby.js.map +1 -1
- package/dist/module/components/Call/Lobby/LobbyCameraPreview.js +87 -0
- package/dist/module/components/Call/Lobby/LobbyCameraPreview.js.map +1 -0
- package/dist/module/components/Call/Lobby/index.js +1 -0
- package/dist/module/components/Call/Lobby/index.js.map +1 -1
- package/dist/module/components/Participant/ParticipantView/VideoRenderer/TrackSubscriber.js +6 -17
- package/dist/module/components/Participant/ParticipantView/VideoRenderer/TrackSubscriber.js.map +1 -1
- package/dist/module/components/Participant/ParticipantView/VideoRenderer/index.js +11 -5
- package/dist/module/components/Participant/ParticipantView/VideoRenderer/index.js.map +1 -1
- package/dist/module/hooks/push/useCallingExpWithCallingStateEffect.js +9 -5
- package/dist/module/hooks/push/useCallingExpWithCallingStateEffect.js.map +1 -1
- package/dist/module/hooks/useLoopbackRecording.js +10 -127
- package/dist/module/hooks/useLoopbackRecording.js.map +1 -1
- package/dist/module/modules/call-manager/CallManager.js +36 -53
- package/dist/module/modules/call-manager/CallManager.js.map +1 -1
- package/dist/module/utils/StreamVideoRN/index.js +2 -0
- package/dist/module/utils/StreamVideoRN/index.js.map +1 -1
- package/dist/module/utils/internal/callingx/callingx.js +27 -40
- package/dist/module/utils/internal/callingx/callingx.js.map +1 -1
- package/dist/module/utils/internal/registerMediaEngine.js +37 -0
- package/dist/module/utils/internal/registerMediaEngine.js.map +1 -0
- package/dist/module/utils/internal/registerSDKGlobals.js +95 -37
- package/dist/module/utils/internal/registerSDKGlobals.js.map +1 -1
- package/dist/module/utils/push/android.js +16 -178
- package/dist/module/utils/push/android.js.map +1 -1
- package/dist/module/utils/push/internal/android.js +182 -0
- package/dist/module/utils/push/internal/android.js.map +1 -0
- package/dist/module/utils/push/libs/firebaseMessaging/index.js +8 -8
- package/dist/module/utils/push/libs/firebaseMessaging/index.js.map +1 -1
- package/dist/module/utils/push/libs/firebaseMessaging/lib.js +1 -1
- package/dist/module/utils/push/libs/firebaseMessaging/lib.js.map +1 -1
- package/dist/module/utils/push/setupAndroidPushEvents.js +21 -0
- package/dist/module/utils/push/setupAndroidPushEvents.js.map +1 -0
- package/dist/module/utils/push/setupCallingExpEvents.js +6 -2
- package/dist/module/utils/push/setupCallingExpEvents.js.map +1 -1
- package/dist/module/utils/push/setupIosVoipPushEvents.js +6 -7
- package/dist/module/utils/push/setupIosVoipPushEvents.js.map +1 -1
- package/dist/module/utils/push/utils.js.map +1 -1
- package/dist/module/version.js +1 -1
- package/dist/typescript/components/Call/Lobby/Lobby.d.ts.map +1 -1
- package/dist/typescript/components/Call/Lobby/LobbyCameraPreview.d.ts +28 -0
- package/dist/typescript/components/Call/Lobby/LobbyCameraPreview.d.ts.map +1 -0
- package/dist/typescript/components/Call/Lobby/index.d.ts +1 -0
- package/dist/typescript/components/Call/Lobby/index.d.ts.map +1 -1
- package/dist/typescript/components/Participant/ParticipantView/VideoRenderer/TrackSubscriber.d.ts +11 -6
- package/dist/typescript/components/Participant/ParticipantView/VideoRenderer/TrackSubscriber.d.ts.map +1 -1
- package/dist/typescript/components/Participant/ParticipantView/VideoRenderer/index.d.ts.map +1 -1
- package/dist/typescript/hooks/push/useCallingExpWithCallingStateEffect.d.ts.map +1 -1
- package/dist/typescript/hooks/useLoopbackRecording.d.ts +12 -69
- package/dist/typescript/hooks/useLoopbackRecording.d.ts.map +1 -1
- package/dist/typescript/modules/call-manager/CallManager.d.ts +28 -6
- package/dist/typescript/modules/call-manager/CallManager.d.ts.map +1 -1
- package/dist/typescript/modules/call-manager/types.d.ts +0 -1
- package/dist/typescript/modules/call-manager/types.d.ts.map +1 -1
- package/dist/typescript/utils/StreamVideoRN/index.d.ts.map +1 -1
- package/dist/typescript/utils/StreamVideoRN/types.d.ts +3 -0
- package/dist/typescript/utils/StreamVideoRN/types.d.ts.map +1 -1
- package/dist/typescript/utils/internal/callingx/callingx.d.ts +2 -0
- package/dist/typescript/utils/internal/callingx/callingx.d.ts.map +1 -1
- package/dist/typescript/utils/internal/registerMediaEngine.d.ts +15 -0
- package/dist/typescript/utils/internal/registerMediaEngine.d.ts.map +1 -0
- package/dist/typescript/utils/internal/registerSDKGlobals.d.ts.map +1 -1
- package/dist/typescript/utils/push/android.d.ts +3 -4
- package/dist/typescript/utils/push/android.d.ts.map +1 -1
- package/dist/typescript/utils/push/internal/android.d.ts +8 -0
- package/dist/typescript/utils/push/internal/android.d.ts.map +1 -0
- package/dist/typescript/utils/push/libs/firebaseMessaging/index.d.ts +6 -5
- package/dist/typescript/utils/push/libs/firebaseMessaging/index.d.ts.map +1 -1
- package/dist/typescript/utils/push/libs/firebaseMessaging/lib.d.ts +2 -2
- package/dist/typescript/utils/push/libs/firebaseMessaging/lib.d.ts.map +1 -1
- package/dist/typescript/utils/push/setupAndroidPushEvents.d.ts +3 -0
- package/dist/typescript/utils/push/setupAndroidPushEvents.d.ts.map +1 -0
- package/dist/typescript/utils/push/setupCallingExpEvents.d.ts.map +1 -1
- package/dist/typescript/utils/push/setupIosVoipPushEvents.d.ts.map +1 -1
- package/dist/typescript/utils/push/utils.d.ts +2 -2
- package/dist/typescript/utils/push/utils.d.ts.map +1 -1
- package/dist/typescript/version.d.ts +1 -1
- package/ios/StreamInCallManager.m +4 -0
- package/ios/StreamInCallManager.swift +42 -10
- package/ios/TracksRecorder/RecorderVideoSink.swift +92 -5
- package/package.json +8 -8
- package/src/components/Call/CallControls/internal/ReactionsPicker.tsx +2 -2
- package/src/components/Call/Lobby/Lobby.tsx +4 -11
- package/src/components/Call/Lobby/LobbyCameraPreview.tsx +99 -0
- package/src/components/Call/Lobby/index.ts +1 -0
- package/src/components/Participant/ParticipantView/VideoRenderer/TrackSubscriber.tsx +56 -75
- package/src/components/Participant/ParticipantView/VideoRenderer/index.tsx +18 -7
- package/src/hooks/push/useCallingExpWithCallingStateEffect.ts +12 -5
- package/src/hooks/useLoopbackRecording.ts +36 -248
- package/src/modules/call-manager/CallManager.ts +40 -71
- package/src/modules/call-manager/native-module.d.ts +13 -0
- package/src/modules/call-manager/types.ts +0 -1
- package/src/utils/StreamVideoRN/index.ts +2 -0
- package/src/utils/StreamVideoRN/types.ts +3 -0
- package/src/utils/internal/callingx/callingx.ts +37 -46
- package/src/utils/internal/registerMediaEngine.ts +42 -0
- package/src/utils/internal/registerSDKGlobals.ts +115 -42
- package/src/utils/push/android.ts +20 -253
- package/src/utils/push/internal/android.ts +252 -0
- package/src/utils/push/libs/firebaseMessaging/index.ts +14 -22
- package/src/utils/push/libs/firebaseMessaging/lib.ts +3 -3
- package/src/utils/push/setupAndroidPushEvents.ts +25 -0
- package/src/utils/push/setupCallingExpEvents.ts +6 -3
- package/src/utils/push/setupIosVoipPushEvents.ts +8 -7
- package/src/utils/push/utils.ts +2 -4
- package/src/version.ts +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { NativeEventEmitter, NativeModules, Platform } from 'react-native';
|
|
4
|
-
import { getCallingxLibIfAvailable } from '../../utils/push/libs/callingx';
|
|
5
4
|
import { videoLoggerSystem } from '@stream-io/video-client';
|
|
5
|
+
import { getCallingxLibIfAvailable } from '../../utils/push/libs';
|
|
6
6
|
const NativeManager = NativeModules.StreamInCallManager;
|
|
7
7
|
const CallingxModule = getCallingxLibIfAvailable();
|
|
8
8
|
const AUDIO_INTERRUPTION_EVENT = 'StreamInCallManagerAudioInterruption';
|
|
@@ -245,22 +245,30 @@ class SpeakerManager {
|
|
|
245
245
|
NativeManager.setForceSpeakerphoneOn(force);
|
|
246
246
|
};
|
|
247
247
|
}
|
|
248
|
-
const shouldBypassForCallKit = () => {
|
|
249
|
-
if (Platform.OS !== 'ios') {
|
|
250
|
-
return false;
|
|
251
|
-
}
|
|
252
|
-
if (!CallingxModule) {
|
|
253
|
-
return false;
|
|
254
|
-
}
|
|
255
|
-
return CallingxModule.isSetup && (CallingxModule.hasRegisteredCall() || CallingxModule.isOngoingCallsEnabled);
|
|
256
|
-
};
|
|
257
248
|
export class CallManager {
|
|
258
249
|
audioDevices = new AudioDevicesManager();
|
|
259
250
|
ios = new IOSCallManager();
|
|
260
251
|
speaker = new SpeakerManager();
|
|
261
252
|
|
|
262
253
|
/**
|
|
263
|
-
*
|
|
254
|
+
* The audio config recorded via {@link start}. The SDK's internal call manager reads it at the
|
|
255
|
+
* next join-time start and applies it before the native audio manager is activated.
|
|
256
|
+
*/
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* The config recorded via {@link start}.
|
|
260
|
+
*
|
|
261
|
+
* @internal Read by the SDK's internal call manager at join; not intended for app use.
|
|
262
|
+
*/
|
|
263
|
+
getStoredConfig = () => this.storedConfig;
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* Records the desired audio config for the call.
|
|
267
|
+
*
|
|
268
|
+
* This does NOT start the native audio manager — the SDK owns native start/stop and applies this
|
|
269
|
+
* config at the next join-time start (before the audio manager is activated). Call it **before**
|
|
270
|
+
* joining. Calling it mid-call only updates the stored config; it does not change the running
|
|
271
|
+
* call's audio, and the new config takes effect on the next call/rejoin.
|
|
264
272
|
*
|
|
265
273
|
* @param config.audioRole The audio role to set. It can be one of the following:
|
|
266
274
|
* - `'communicator'`: (Default) For use cases like video or voice calls.
|
|
@@ -270,66 +278,41 @@ export class CallManager {
|
|
|
270
278
|
* It prioritizes high-quality stereo audio streaming.
|
|
271
279
|
* Audio routing is controlled by the OS, and manual switching is not supported.
|
|
272
280
|
*
|
|
273
|
-
* @param config.deviceEndpointType
|
|
274
|
-
*
|
|
281
|
+
* @param config.deviceEndpointType Overrides the default audio device endpoint. When omitted,
|
|
282
|
+
* the SDK uses the device derived from the call settings. It can be one of the following:
|
|
283
|
+
* - `'speaker'`: For normal video or voice calls.
|
|
275
284
|
* - `'earpiece'`: For voice-only mobile call type scenarios.
|
|
276
|
-
*
|
|
277
|
-
* @param config.enableStereoAudioOutput Whether to enable stereo audio output. Only supported for listener audio role.
|
|
278
285
|
*/
|
|
279
286
|
start = config => {
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
safeNativeCall('setDefaultAudioDeviceEndpointType', () => NativeManager.setDefaultAudioDeviceEndpointType(type));
|
|
285
|
-
}
|
|
286
|
-
videoLoggerSystem.getLogger('CallManager').debug('start: skipping start as callkit is handling the audio session');
|
|
287
|
-
return;
|
|
288
|
-
}
|
|
289
|
-
if (isAndroidTelecomManaged()) {
|
|
290
|
-
// Telecom owns routing/focus; forward the sticky preference to callingx and run in
|
|
291
|
-
// telecom-managed mode (StreamInCallManager keeps proximity/keep-screen-on only).
|
|
292
|
-
if (config?.audioRole !== 'listener' && CallingxModule) {
|
|
293
|
-
safeNativeCall('setDefaultAudioDeviceEndpointType (callingx)', () => CallingxModule.setDefaultAudioDeviceEndpointType(config?.deviceEndpointType ?? 'speaker'));
|
|
294
|
-
}
|
|
295
|
-
NativeManager.setTelecomManagedMode(true);
|
|
296
|
-
NativeManager.setAudioRole(config?.audioRole ?? 'communicator');
|
|
297
|
-
NativeManager.start();
|
|
298
|
-
return;
|
|
299
|
-
}
|
|
300
|
-
if (Platform.OS === 'android') {
|
|
301
|
-
NativeManager.setTelecomManagedMode(false);
|
|
302
|
-
}
|
|
303
|
-
NativeManager.setAudioRole(config?.audioRole ?? 'communicator');
|
|
304
|
-
if (config?.audioRole === 'communicator') {
|
|
305
|
-
const type = config.deviceEndpointType ?? 'speaker';
|
|
306
|
-
NativeManager.setDefaultAudioDeviceEndpointType(type);
|
|
307
|
-
}
|
|
308
|
-
if (config?.audioRole === 'listener' && config.enableStereoAudioOutput) {
|
|
309
|
-
NativeManager.setEnableStereoAudioOutput(true);
|
|
310
|
-
}
|
|
311
|
-
NativeManager.start();
|
|
287
|
+
this.storedConfig = config;
|
|
288
|
+
videoLoggerSystem.getLogger('CallManager').debug('start: stored call manager config', {
|
|
289
|
+
config
|
|
290
|
+
});
|
|
312
291
|
};
|
|
313
292
|
|
|
314
293
|
/**
|
|
315
|
-
*
|
|
294
|
+
* Clears the stored audio config.
|
|
316
295
|
*/
|
|
317
296
|
stop = () => {
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
return;
|
|
321
|
-
}
|
|
322
|
-
NativeManager.stop();
|
|
297
|
+
this.storedConfig = undefined;
|
|
298
|
+
videoLoggerSystem.getLogger('CallManager').debug('[public] stop(): cleared stored config');
|
|
323
299
|
};
|
|
324
300
|
|
|
325
301
|
/**
|
|
326
302
|
* For debugging purposes, will emit a log event with the current audio state.
|
|
327
303
|
* in the native layer.
|
|
304
|
+
*
|
|
305
|
+
* NOTE: This method might be called outside of the call JOIN/LEFT window,
|
|
306
|
+
* so it may lead to default peer connection factory and adm being created.
|
|
328
307
|
*/
|
|
329
308
|
logAudioState = () => NativeManager.logAudioState();
|
|
330
309
|
|
|
331
310
|
/**
|
|
332
311
|
* For debugging purposes, returns the current audio state as a string.
|
|
312
|
+
*
|
|
313
|
+
* NOTE: This method might be called outside of the call JOIN/LEFT window,
|
|
314
|
+
* so it may lead to default peer connection factory and adm being created.
|
|
315
|
+
*
|
|
333
316
|
* @returns A string containing the current audio state information.
|
|
334
317
|
*/
|
|
335
318
|
getAudioStateLog = () => NativeManager.getAudioStateLog();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeEventEmitter","NativeModules","Platform","
|
|
1
|
+
{"version":3,"names":["NativeEventEmitter","NativeModules","Platform","videoLoggerSystem","getCallingxLibIfAvailable","NativeManager","StreamInCallManager","CallingxModule","AUDIO_INTERRUPTION_EVENT","AUDIO_DEVICE_CHANGED_EVENT","invariant","condition","message","Error","safeNativeCall","label","fn","error","getLogger","warn","isAndroidTelecomManaged","OS","isSetup","isTelecomBacked","hasRegisteredCall","isOngoingCallsEnabled","getTelecomContext","undefined","callId","getRegisteredCallIds","cx","endpointTypeToDisplayName","type","snapshotToState","snapshot","devices","endpoints","map","e","id","name","selectedDeviceId","currentEndpoint","currentEndpointType","AudioDevicesManager","interruptionReassertSetup","ensureInterruptionReassert","addEventListener","event","phase","reapplyAudioRoute","getStatus","tc","getAvailableAudioEndpoints","getAudioDeviceStatus","select","deviceId","requestAudioEndpointChange","catch","chooseAudioDeviceEndpoint","addChangeListener","onChange","active","unsubscribes","cxSub","then","state","push","remove","eventEmitter","sdkSub","addListener","forEach","unsubscribe","IOSCallManager","showDeviceSelector","showAudioRoutePicker","addAudioInterruptionListener","onInterruption","s","SpeakerManager","setMute","mute","muteAudioOutput","unmuteAudioOutput","setForceSpeakerphoneOn","force","target","find","CallManager","audioDevices","ios","speaker","getStoredConfig","storedConfig","start","config","debug","stop","logAudioState","getAudioStateLog"],"sourceRoot":"../../../../src","sources":["modules/call-manager/CallManager.ts"],"mappings":";;AAAA,SAASA,kBAAkB,EAAEC,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AAW1E,SAASC,iBAAiB,QAAQ,yBAAyB;AAC3D,SAASC,yBAAyB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,CACxBC,IAAI,CACH,0BAA0BmE,KAAK,+BAA+B1D,MAAM,cAAc,EAClFX,KACF,CAAC;MACL,CAAC,CAAC;MACJ;IACF;IACAZ,aAAa,CAACgF,sBAAsB,CAACC,KAAK,CAAC;EAC7C,CAAC;AACH;AAEA,OAAO,MAAMG,WAAW,CAAC;EACvBC,YAAY,GAAG,IAAI9C,mBAAmB,CAAC,CAAC;EACxC+C,GAAG,GAAG,IAAIjB,cAAc,CAAC,CAAC;EAC1BkB,OAAO,GAAG,IAAIZ,cAAc,CAAC,CAAC;;EAE9B;AACF;AACA;AACA;;EAGE;AACF;AACA;AACA;AACA;EACEa,eAAe,GAAGA,CAAA,KAChB,IAAI,CAACC,YAAY;;EAEnB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEC,KAAK,GAAIC,MAAkC,IAAW;IACpD,IAAI,CAACF,YAAY,GAAGE,MAAM;IAC1B7F,iBAAiB,CACde,SAAS,CAAC,aAAa,CAAC,CACxB+E,KAAK,CAAC,mCAAmC,EAAE;MAAED;IAAO,CAAC,CAAC;EAC3D,CAAC;;EAED;AACF;AACA;EACEE,IAAI,GAAGA,CAAA,KAAY;IACjB,IAAI,CAACJ,YAAY,GAAGnE,SAAS;IAC7BxB,iBAAiB,CACde,SAAS,CAAC,aAAa,CAAC,CACxB+E,KAAK,CAAC,wCAAwC,CAAC;EACpD,CAAC;;EAED;AACF;AACA;AACA;AACA;AACA;AACA;EACEE,aAAa,GAAGA,CAAA,KAAY9F,aAAa,CAAC8F,aAAa,CAAC,CAAC;;EAEzD;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACEC,gBAAgB,GAAGA,CAAA,KAAc/F,aAAa,CAAC+F,gBAAgB,CAAC,CAAC;AACnE","ignoreList":[]}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import pushLogoutCallbacks from '../internal/pushLogoutCallback';
|
|
4
4
|
import { setupIosVoipPushEvents } from '../push/setupIosVoipPushEvents';
|
|
5
|
+
import { setupAndroidPushEvents } from '../push/setupAndroidPushEvents';
|
|
5
6
|
import { setupCallingExpEvents } from '../push/setupCallingExpEvents';
|
|
6
7
|
import { extractCallingExpOptions, getCallingxLib } from '../push/libs/callingx';
|
|
7
8
|
import { NativeModules, Platform } from 'react-native';
|
|
@@ -104,6 +105,7 @@ export class StreamVideoRN {
|
|
|
104
105
|
}
|
|
105
106
|
setupCallingExpEvents(pushConfig);
|
|
106
107
|
setupIosVoipPushEvents(pushConfig);
|
|
108
|
+
setupAndroidPushEvents(pushConfig);
|
|
107
109
|
}
|
|
108
110
|
static getConfig() {
|
|
109
111
|
return this.config;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["pushLogoutCallbacks","setupIosVoipPushEvents","setupCallingExpEvents","extractCallingExpOptions","getCallingxLib","NativeModules","Platform","videoLoggerSystem","deepMerge","target","source","result","key","undefined","Array","isArray","DEFAULT_STREAM_VIDEO_CONFIG","foregroundService","android","channel","id","name","notificationTexts","title","body","taskToRun","Promise","StreamVideoRN","config","updateConfig","setPushConfig","pushConfig","push","callingx","getLogger","info","JSON","stringify","options","setup","Error","getConfig","onPushLogout","callbacks","current","resolve","all","map","callback","then","clearPushLogoutCallbacks","playBusyTone","StreamVideoReactNative","stopBusyTone","androidHasAudioOutputHardware","OS","hasAudioOutputHardware","androidHasMicrophoneHardware","hasMicrophoneHardware","androidHasCameraHardware","hasCameraHardware"],"sourceRoot":"../../../../src","sources":["utils/StreamVideoRN/index.ts"],"mappings":";;AACA,OAAOA,mBAAmB,MAAM,gCAAgC;AAChE,SAASC,sBAAsB,QAAQ,gCAAgC;AACvE,SAASC,qBAAqB,QAAQ,+BAA+B;AACrE,SACEC,wBAAwB,EACxBC,cAAc,QACT,uBAAuB;AAC9B,SAASC,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AACtD,SAASC,iBAAiB,QAAQ,yBAA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1D;IACA,IAAI,CAACD,MAAM,GAAGpB,SAAS,CAAC,IAAI,CAACoB,MAAM,EAAEC,YAAY,CAAC;EACpD;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,OAAOC,aAAaA,CAACC,UAAkD,EAAE;IACvE,IAAI,IAAI,CAACH,MAAM,CAACI,IAAI,EAAE;MACpB;MACA;IACF;IAEA,IAAI,CAACJ,MAAM,CAACI,IAAI,GAAGD,UAAU;IAE7B,IAAI;MACF,MAAME,QAAQ,GAAG7B,cAAc,CAAC,CAAC;MACjCG,iBAAiB,CACd2B,SAAS,CAAC,6BAA6B,CAAC,CACxCC,IAAI,CAACC,IAAI,CAACC,SAAS,CAAC,IAAI,CAACT,MAAM,CAAC,CAAC;MACpC,MAAMU,OAAO,GAAGnC,wBAAwB,CAAC,IAAI,CAACyB,MAAM,CAAC;MACrDK,QAAQ,CAACM,KAAK,CAACD,OAAO,CAAC;IACzB,CAAC,CAAC,MAAM;MACN,MAAM,IAAIE,KAAK,CACb,iKACF,CAAC;IACH;IAEAtC,qBAAqB,CAAC6B,UAAU,CAAC;
|
|
1
|
+
{"version":3,"names":["pushLogoutCallbacks","setupIosVoipPushEvents","setupAndroidPushEvents","setupCallingExpEvents","extractCallingExpOptions","getCallingxLib","NativeModules","Platform","videoLoggerSystem","deepMerge","target","source","result","key","undefined","Array","isArray","DEFAULT_STREAM_VIDEO_CONFIG","foregroundService","android","channel","id","name","notificationTexts","title","body","taskToRun","Promise","StreamVideoRN","config","updateConfig","setPushConfig","pushConfig","push","callingx","getLogger","info","JSON","stringify","options","setup","Error","getConfig","onPushLogout","callbacks","current","resolve","all","map","callback","then","clearPushLogoutCallbacks","playBusyTone","StreamVideoReactNative","stopBusyTone","androidHasAudioOutputHardware","OS","hasAudioOutputHardware","androidHasMicrophoneHardware","hasMicrophoneHardware","androidHasCameraHardware","hasCameraHardware"],"sourceRoot":"../../../../src","sources":["utils/StreamVideoRN/index.ts"],"mappings":";;AACA,OAAOA,mBAAmB,MAAM,gCAAgC;AAChE,SAASC,sBAAsB,QAAQ,gCAAgC;AACvE,SAASC,sBAAsB,QAAQ,gCAAgC;AACvE,SAASC,qBAAqB,QAAQ,+BAA+B;AACrE,SACEC,wBAAwB,EACxBC,cAAc,QACT,uBAAuB;AAC9B,SAASC,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AACtD,SAASC,iBAAiB,QAAQ,yBAAyB;;AAE3D;;AAKA;AACA,SAASC,SAASA,CAChBC,MAAS,EACTC,MAAsB,EACnB;EACH,MAAMC,MAAM,GAAG;IAAE,GAAGF;EAAO,CAAC;EAE5B,KAAK,MAAMG,GAAG,IAAIF,MAAM,EAAE;IACxB,IAAIA,MAAM,CAACE,GAAG,CAAC,KAAKC,SAAS,EAAE;MAC7B,IACE,OAAOH,MAAM,CAACE,GAAG,CAAC,KAAK,QAAQ,IAC/BF,MAAM,CAACE,GAAG,CAAC,KAAK,IAAI,IACpB,CAACE,KAAK,CAACC,OAAO,CAACL,MAAM,CAACE,GAAG,CAAC,CAAC,IAC3B,OAAOH,MAAM,CAACG,GAAG,CAAC,KAAK,QAAQ,IAC/BH,MAAM,CAACG,GAAG,CAAC,KAAK,IAAI,IACpB,CAACE,KAAK,CAACC,OAAO,CAACN,MAAM,CAACG,GAAG,CAAC,CAAC,EAC3B;QACAD,MAAM,CAACC,GAAG,CAAC,GAAGJ,SAAS,CACrBC,MAAM,CAACG,GAAG,CAAC,EACXF,MAAM,CAACE,GAAG,CACZ,CAAC;MACH,CAAC,MAAM;QACLD,MAAM,CAACC,GAAG,CAAC,GAAGF,MAAM,CAACE,GAAG,CAAkB;MAC5C;IACF;EACF;EAEA,OAAOD,MAAM;AACf;AAEA,MAAMK,2BAA8C,GAAG;EACrDC,iBAAiB,EAAE;IAC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B,CAACM,qBAAqB,CAAC,CAAC;EACrE;;EAEA;AACF;AACA;AACA;EACE,aAAaC,wBAAwBA,CAAA,EAAqB;IACxD,IAAIrD,QAAQ,CAACiD,EAAE,KAAK,SAAS,EAC3B,MAAM,IAAIf,KAAK,CACb,gEACF,CAAC;IACH,OAAOnC,aAAa,CAAC+C,sBAAsB,CAACQ,iBAAiB,CAAC,CAAC;EACjE;AACF","ignoreList":[]}
|
|
@@ -4,45 +4,11 @@
|
|
|
4
4
|
* Internal utils for callingx library usage from video-client.
|
|
5
5
|
* See @./registerSDKGlobals.ts for more usage details.
|
|
6
6
|
*/
|
|
7
|
-
import {
|
|
7
|
+
import { Platform } from 'react-native';
|
|
8
8
|
import { getCallingxLibIfAvailable } from '../../push/libs/callingx';
|
|
9
9
|
import { CallingState, videoLoggerSystem } from '@stream-io/video-client';
|
|
10
10
|
const CallingxModule = getCallingxLibIfAvailable();
|
|
11
11
|
|
|
12
|
-
/**
|
|
13
|
-
* Fallback when Telecom registration fails/times out on Android: no component would own audio
|
|
14
|
-
* (Telecom never took over), so re-establish StreamInCallManager in its classic (non-telecom)
|
|
15
|
-
* mode to keep the call audible.
|
|
16
|
-
*/
|
|
17
|
-
function recoverAudioToClassicMode() {
|
|
18
|
-
if (Platform.OS !== 'android') {
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
if (!CallingxModule?.isSetup || !CallingxModule.isTelecomBacked) {
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
// If a call is already registered, Telecom owns audio for it (the registration
|
|
25
|
-
// partially succeeded). Switching to classic mode here would fight Telecom's
|
|
26
|
-
// routing/focus — leave ownership intact.
|
|
27
|
-
if (CallingxModule.hasRegisteredCall()) {
|
|
28
|
-
videoLoggerSystem.getLogger('callingx').debug('recoverAudioToClassicMode: Telecom already owns a registered call; skipping classic fallback');
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
const StreamInCallManagerNativeModule = NativeModules.StreamInCallManager;
|
|
32
|
-
if (!StreamInCallManagerNativeModule) {
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
const logger = videoLoggerSystem.getLogger('callingx');
|
|
36
|
-
logger.warn('Telecom registration failed; falling back to classic StreamInCallManager audio');
|
|
37
|
-
try {
|
|
38
|
-
StreamInCallManagerNativeModule.stop();
|
|
39
|
-
StreamInCallManagerNativeModule.setTelecomManagedMode(false);
|
|
40
|
-
StreamInCallManagerNativeModule.start();
|
|
41
|
-
} catch (error) {
|
|
42
|
-
logger.error('recoverAudioToClassicMode: failed to recover audio', error);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
12
|
/**
|
|
47
13
|
* Gets the call display name. To be used for display in native call screen.
|
|
48
14
|
*/
|
|
@@ -61,12 +27,12 @@ export function getCallDisplayName(callMembers, participants, currentUserId) {
|
|
|
61
27
|
|
|
62
28
|
// if no names are found, we use the name of the current user
|
|
63
29
|
if (names.length === 0) {
|
|
64
|
-
names = [participants.find(participant => participant.userId === currentUserId)?.name
|
|
30
|
+
names = [participants.find(participant => participant.userId === currentUserId)?.name || 'Call'];
|
|
65
31
|
}
|
|
66
32
|
return names.sort().join(', ');
|
|
67
33
|
}
|
|
68
34
|
function getCallDisplayNameFromCall(call) {
|
|
69
|
-
return call.state.custom?.display_name
|
|
35
|
+
return call.state.custom?.display_name || getCallDisplayName(call.state.members, call.state.participants, call.currentUserId);
|
|
70
36
|
}
|
|
71
37
|
export async function registerOutgoingCall(call) {
|
|
72
38
|
if (!CallingxModule || !CallingxModule.isSetup || call.isOwnTracksLoopbackAllowed) {
|
|
@@ -90,7 +56,6 @@ export async function registerOutgoingCall(call) {
|
|
|
90
56
|
);
|
|
91
57
|
} catch (error) {
|
|
92
58
|
logger.error(`registerOutgoingCall: Error registering outgoing call in callingx: ${call.cid}`, error);
|
|
93
|
-
recoverAudioToClassicMode();
|
|
94
59
|
}
|
|
95
60
|
}
|
|
96
61
|
|
|
@@ -126,7 +91,6 @@ export async function joinCallingxCall(call, activeCalls) {
|
|
|
126
91
|
await startCallInCallingx();
|
|
127
92
|
} catch (error) {
|
|
128
93
|
logger.error(`startCallingxCall: Error starting call in callingx: ${call.cid}`, error);
|
|
129
|
-
recoverAudioToClassicMode();
|
|
130
94
|
}
|
|
131
95
|
} else if (isIncomingCall) {
|
|
132
96
|
logger.debug(`joinCallingxCall: Joining incoming call ${call.cid}`);
|
|
@@ -156,7 +120,6 @@ export async function joinCallingxCall(call, activeCalls) {
|
|
|
156
120
|
await CallingxModule.answerIncomingCall(call.cid);
|
|
157
121
|
} catch (error) {
|
|
158
122
|
logger.error(`Error joining incoming call in callingx: ${call.cid}`, error);
|
|
159
|
-
recoverAudioToClassicMode();
|
|
160
123
|
}
|
|
161
124
|
}
|
|
162
125
|
}
|
|
@@ -172,4 +135,28 @@ export async function endCallingxCall(call, reason) {
|
|
|
172
135
|
logger.error(`endCallingxCall: Error ending call in callingx: ${call.cid}`, error);
|
|
173
136
|
}
|
|
174
137
|
}
|
|
138
|
+
export async function wireAudioEngineSubscription() {
|
|
139
|
+
if (!CallingxModule || !CallingxModule.isSetup || Platform.OS !== 'ios') {
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
const logger = videoLoggerSystem.getLogger('callingx');
|
|
143
|
+
try {
|
|
144
|
+
logger.debug('wireEngineSubscription: Wiring engine subscription');
|
|
145
|
+
CallingxModule.wireAudioEngineSubscription();
|
|
146
|
+
} catch (error) {
|
|
147
|
+
logger.error('wireAudioEngineSubscription: Error wiring engine subscription', error);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
export function unwireAudioEngineSubscription() {
|
|
151
|
+
if (!CallingxModule || !CallingxModule.isSetup || Platform.OS !== 'ios') {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
const logger = videoLoggerSystem.getLogger('callingx');
|
|
155
|
+
try {
|
|
156
|
+
logger.debug('unwireEngineSubscription: Cancelling engine subscription');
|
|
157
|
+
CallingxModule.unwireAudioEngineSubscription();
|
|
158
|
+
} catch (error) {
|
|
159
|
+
logger.error('unwireAudioEngineSubscription: Error cancelling engine subscription', error);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
175
162
|
//# sourceMappingURL=callingx.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["Platform","getCallingxLibIfAvailable","CallingState","videoLoggerSystem","CallingxModule","getCallDisplayName","callMembers","participants","currentUserId","names","length","flatMap","member","user","id","name","participant","userId","find","sort","join","getCallDisplayNameFromCall","call","state","custom","display_name","members","registerOutgoingCall","isSetup","isOwnTracksLoopbackAllowed","isOutcomingCall","ringing","isCreatedByMe","logger","getLogger","debug","cid","callDisplayName","startCall","createdBy","settings","video","enabled","error","joinCallingxCall","activeCalls","isIncomingCall","startCallInCallingx","isOngoingCallsEnabled","activeCallsToLeave","filter","c","callingState","LEFT","activeCall","leave","reason","catch","e","displayIncomingCall","answerIncomingCall","endCallingxCall","isCallTracked","endCallWithReason","wireAudioEngineSubscription","OS","unwireAudioEngineSubscription"],"sourceRoot":"../../../../../src","sources":["utils/internal/callingx/callingx.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,cAAc;AAEvC,SAASC,yBAAyB,QAAQ,0BAA0B;AAMpE,SAASC,YAAY,EAAEC,iBAAiB,QAAQ,yBAAyB;AAEzE,MAAMC,cAAc,GAAGH,yBAAyB,CAAC,CAAC;;AAElD;AACA;AACA;AACA,OAAO,SAASI,kBAAkBA,CAChCC,WAAyC,EACzCC,YAAkD,EAClDC,aAAiC,EACzB;EACR,IAAI,CAACF,WAAW,IAAI,CAACC,YAAY,IAAI,CAACC,aAAa,EAAE;IACnD,OAAO,MAAM;EACf;EAEA,IAAIC,KAAe,GAAG,EAAE;EAExB,IAAIH,WAAW,CAACI,MAAM,GAAG,CAAC,EAAE;IAC1B;IACAD,KAAK,GAAGH,WAAW,CAACK,OAAO,CAAEC,MAAM,IACjCA,M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IAClE/B,cAAc,CAAC4D,2BAA2B,CAAC,CAAC;EAC9C,CAAC,CAAC,OAAOrB,KAAK,EAAE;IACdV,MAAM,CAACU,KAAK,CACV,+DAA+D,EAC/DA,KACF,CAAC;EACH;AACF;AAEA,OAAO,SAASuB,6BAA6BA,CAAA,EAAG;EAC9C,IAAI,CAAC9D,cAAc,IAAI,CAACA,cAAc,CAACwB,OAAO,IAAI5B,QAAQ,CAACiE,EAAE,KAAK,KAAK,EAAE;IACvE;EACF;EACA,MAAMhC,MAAM,GAAG9B,iBAAiB,CAAC+B,SAAS,CAAC,UAAU,CAAC;EAEtD,IAAI;IACFD,MAAM,CAACE,KAAK,CAAC,0DAA0D,CAAC;IACxE/B,cAAc,CAAC8D,6BAA6B,CAAC,CAAC;EAChD,CAAC,CAAC,OAAOvB,KAAK,EAAE;IACdV,MAAM,CAACU,KAAK,CACV,qEAAqE,EACrEA,KACF,CAAC;EACH;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { setCallMediaEngineProvider, videoLoggerSystem } from '@stream-io/video-client';
|
|
4
|
+
import { CallFactory } from '@stream-io/react-native-webrtc';
|
|
5
|
+
import { callManager } from '../../modules/call-manager';
|
|
6
|
+
const logger = videoLoggerSystem.getLogger('CallMediaEngine');
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Registers the React Native {@link CallMediaEngine} provider.
|
|
10
|
+
*
|
|
11
|
+
* Once registered, every `Call.ensureMediaFactory()` builds the call's native
|
|
12
|
+
* `PeerConnectionFactory` (with the call's audio configuration) and sets it as
|
|
13
|
+
* the single live factory. The WebRTC globals (`getUserMedia`/`getDisplayMedia`/
|
|
14
|
+
* `new RTCPeerConnection`) then resolve to it, so the call's tracks and peer
|
|
15
|
+
* connections are created with — and torn down with — that one native factory,
|
|
16
|
+
* which is what lets the call own its AudioDeviceModule. The engine itself only
|
|
17
|
+
* manages the factory lifecycle (`dispose` at leave).
|
|
18
|
+
*
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
export function registerCallMediaEngine() {
|
|
22
|
+
setCallMediaEngineProvider(async () => {
|
|
23
|
+
const config = callManager.getStoredConfig();
|
|
24
|
+
const bypassVoiceProcessing = config?.audioRole === 'listener';
|
|
25
|
+
const factory = await CallFactory.create({
|
|
26
|
+
bypassVoiceProcessing
|
|
27
|
+
});
|
|
28
|
+
logger.debug(`Created per-call factory (bypassVoiceProcessing=${bypassVoiceProcessing})`);
|
|
29
|
+
return {
|
|
30
|
+
dispose: async () => {
|
|
31
|
+
logger.debug('Disposing per-call factory');
|
|
32
|
+
return await factory.dispose();
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=registerMediaEngine.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["setCallMediaEngineProvider","videoLoggerSystem","CallFactory","callManager","logger","getLogger","registerCallMediaEngine","config","getStoredConfig","bypassVoiceProcessing","audioRole","factory","create","debug","dispose"],"sourceRoot":"../../../../src","sources":["utils/internal/registerMediaEngine.ts"],"mappings":";;AAAA,SAEEA,0BAA0B,EAC1BC,iBAAiB,QACZ,yBAAyB;AAChC,SAASC,WAAW,QAAQ,gCAAgC;AAC5D,SAASC,WAAW,QAAQ,4BAA4B;AAExD,MAAMC,MAAM,GAAGH,iBAAiB,CAACI,SAAS,CAAC,iBAAiB,CAAC;;AAE7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,uBAAuBA,CAAA,EAAG;EACxCN,0BAA0B,CAAC,YAAsC;IAC/D,MAAMO,MAAM,GAAGJ,WAAW,CAACK,eAAe,CAAC,CAAC;IAC5C,MAAMC,qBAAqB,GAAGF,MAAM,EAAEG,SAAS,KAAK,UAAU;IAC9D,MAAMC,OAAO,GAAG,MAAMT,WAAW,CAACU,MAAM,CAAC;MACvCH;IACF,CAAC,CAAC;IACFL,MAAM,CAACS,KAAK,CACV,mDAAmDJ,qBAAqB,GAC1E,CAAC;IAED,OAAO;MACLK,OAAO,EAAE,MAAAA,CAAA,KAAY;QACnBV,MAAM,CAACS,KAAK,CAAC,4BAA4B,CAAC;QAC1C,OAAO,MAAMF,OAAO,CAACG,OAAO,CAAC,CAAC;MAChC;IACF,CAAC;EACH,CAAC,CAAC;AACJ","ignoreList":[]}
|
|
@@ -1,13 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
import { videoLoggerSystem } from '@stream-io/video-client';
|
|
3
4
|
import { NativeModules, PermissionsAndroid, Platform } from 'react-native';
|
|
4
|
-
import {
|
|
5
|
+
import { AudioEngineMuteMode, audioDeviceModuleEvents } from '@stream-io/react-native-webrtc';
|
|
5
6
|
import { getCallingxLibIfAvailable } from '../push/libs/callingx';
|
|
6
|
-
import { endCallingxCall, registerOutgoingCall, joinCallingxCall } from './callingx/callingx';
|
|
7
|
+
import { endCallingxCall, registerOutgoingCall, joinCallingxCall, wireAudioEngineSubscription, unwireAudioEngineSubscription } from './callingx/callingx';
|
|
8
|
+
import { registerCallMediaEngine } from './registerMediaEngine';
|
|
9
|
+
import { callManager as publicCallManager } from '../../modules/call-manager';
|
|
7
10
|
const StreamInCallManagerNativeModule = NativeModules.StreamInCallManager;
|
|
8
11
|
const StreamVideoReactNativeModule = NativeModules.StreamVideoReactNative;
|
|
9
12
|
const CallingxModule = getCallingxLibIfAvailable();
|
|
10
13
|
|
|
14
|
+
/**
|
|
15
|
+
* Runs a fire-and-forget native call, logging instead of throwing on a bridge
|
|
16
|
+
* error so it can't crash the caller (e.g. the join/leave flow).
|
|
17
|
+
*/
|
|
18
|
+
const safeNativeCall = (label, fn) => {
|
|
19
|
+
try {
|
|
20
|
+
fn();
|
|
21
|
+
} catch (error) {
|
|
22
|
+
videoLoggerSystem.getLogger('CallManager').warn(`${label} failed`, error);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
|
|
11
26
|
/**
|
|
12
27
|
* Checks if StreamInCallManager should be bypassed because CallKit is handling
|
|
13
28
|
* the audio session via CallingX.
|
|
@@ -38,71 +53,113 @@ const shouldBypassForCallKit = ({
|
|
|
38
53
|
* run it in "telecom-managed" mode where it only keeps proximity/keep-screen-on/mute.
|
|
39
54
|
*/
|
|
40
55
|
const isAndroidTelecomManaged = ({
|
|
41
|
-
|
|
56
|
+
cid
|
|
42
57
|
}) => {
|
|
43
|
-
if (Platform.OS !== 'android') {
|
|
58
|
+
if (Platform.OS !== 'android' || !CallingxModule) {
|
|
44
59
|
return false;
|
|
45
60
|
}
|
|
46
|
-
if (!CallingxModule) {
|
|
61
|
+
if (!CallingxModule.isSetup || !CallingxModule.isTelecomBacked) {
|
|
47
62
|
return false;
|
|
48
63
|
}
|
|
49
|
-
|
|
64
|
+
// Trust Telecom's actual per-call registration. A call that never registered
|
|
65
|
+
// (e.g. Telecom registration failed) is not managed, so start() falls through
|
|
66
|
+
// to the classic path — this is where audio recovery happens.
|
|
67
|
+
return CallingxModule.isCallTracked(cid);
|
|
50
68
|
};
|
|
51
69
|
const streamRNVideoSDKGlobals = {
|
|
52
70
|
callingX: {
|
|
53
71
|
joinCall: joinCallingxCall,
|
|
54
72
|
endCall: endCallingxCall,
|
|
55
|
-
registerOutgoingCall: registerOutgoingCall
|
|
73
|
+
registerOutgoingCall: registerOutgoingCall,
|
|
74
|
+
wireAudioEngineSubscription: wireAudioEngineSubscription,
|
|
75
|
+
unwireAudioEngineSubscription: unwireAudioEngineSubscription
|
|
56
76
|
},
|
|
57
77
|
callManager: {
|
|
58
78
|
setup: ({
|
|
59
79
|
defaultDevice,
|
|
60
|
-
isRingingTypeCall
|
|
80
|
+
isRingingTypeCall,
|
|
81
|
+
cid
|
|
61
82
|
}) => {
|
|
62
|
-
|
|
83
|
+
const isTelecomManaged = isAndroidTelecomManaged({
|
|
84
|
+
cid
|
|
85
|
+
});
|
|
86
|
+
const isCallKitManaged = shouldBypassForCallKit({
|
|
63
87
|
isRingingTypeCall
|
|
64
|
-
})
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
return;
|
|
88
|
+
});
|
|
89
|
+
if (Platform.OS === 'android') {
|
|
90
|
+
StreamInCallManagerNativeModule.setTelecomManagedMode(isTelecomManaged);
|
|
68
91
|
}
|
|
69
|
-
if (
|
|
70
|
-
|
|
71
|
-
})) {
|
|
72
|
-
// Telecom owns routing; forward the sticky preference to callingx and run the
|
|
73
|
-
// in-call manager in telecom-managed mode (proximity/keep-screen-on only).
|
|
74
|
-
CallingxModule?.setDefaultAudioDeviceEndpointType(defaultDevice);
|
|
75
|
-
StreamInCallManagerNativeModule.setTelecomManagedMode(true);
|
|
76
|
-
StreamInCallManagerNativeModule.setup();
|
|
77
|
-
return;
|
|
92
|
+
if (isTelecomManaged || isCallKitManaged) {
|
|
93
|
+
safeNativeCall('setup defaultAudioDevice (callingx)', () => CallingxModule?.setDefaultAudioDeviceEndpointType(defaultDevice));
|
|
78
94
|
}
|
|
79
|
-
if (
|
|
80
|
-
StreamInCallManagerNativeModule.
|
|
95
|
+
if (!isTelecomManaged) {
|
|
96
|
+
safeNativeCall('setup defaultAudioDevice', () => StreamInCallManagerNativeModule.setDefaultAudioDeviceEndpointType(defaultDevice));
|
|
81
97
|
}
|
|
82
|
-
StreamInCallManagerNativeModule.setDefaultAudioDeviceEndpointType(defaultDevice);
|
|
83
|
-
StreamInCallManagerNativeModule.setup();
|
|
84
98
|
},
|
|
85
99
|
start: ({
|
|
86
|
-
isRingingTypeCall
|
|
100
|
+
isRingingTypeCall,
|
|
101
|
+
cid
|
|
87
102
|
}) => {
|
|
103
|
+
// Apply the audio config a consumer recorded via `callManager.start(config)` at this single
|
|
104
|
+
// join-time start, before the native audio manager is activated.
|
|
105
|
+
const config = publicCallManager.getStoredConfig();
|
|
106
|
+
const deviceOverride = config?.audioRole === 'communicator' ? config.deviceEndpointType : undefined;
|
|
88
107
|
if (shouldBypassForCallKit({
|
|
89
108
|
isRingingTypeCall
|
|
90
109
|
})) {
|
|
110
|
+
// CallKit owns activation. Only forward an explicit endpoint override; the
|
|
111
|
+
// SpeakerManager-derived default was already forwarded via `setup`.
|
|
112
|
+
if (deviceOverride) {
|
|
113
|
+
safeNativeCall('start defaultAudioDevice (callingx)', () => CallingxModule?.setDefaultAudioDeviceEndpointType(deviceOverride));
|
|
114
|
+
safeNativeCall('start defaultAudioDevice', () => StreamInCallManagerNativeModule.setDefaultAudioDeviceEndpointType(deviceOverride));
|
|
115
|
+
}
|
|
91
116
|
return;
|
|
92
117
|
}
|
|
93
|
-
|
|
94
|
-
|
|
118
|
+
const isTelecomManaged = isAndroidTelecomManaged({
|
|
119
|
+
cid
|
|
120
|
+
});
|
|
121
|
+
if (Platform.OS === 'android') {
|
|
122
|
+
StreamInCallManagerNativeModule.setTelecomManagedMode(isTelecomManaged);
|
|
123
|
+
}
|
|
124
|
+
if (config?.audioRole) {
|
|
125
|
+
StreamInCallManagerNativeModule.setAudioRole(config.audioRole);
|
|
126
|
+
}
|
|
127
|
+
if (deviceOverride) {
|
|
128
|
+
// Override the SpeakerManager-derived default device (set via `setup`).
|
|
129
|
+
if (isTelecomManaged) {
|
|
130
|
+
safeNativeCall('start defaultAudioDevice (callingx)', () => CallingxModule?.setDefaultAudioDeviceEndpointType(deviceOverride));
|
|
131
|
+
} else {
|
|
132
|
+
safeNativeCall('start defaultAudioDevice', () => StreamInCallManagerNativeModule.setDefaultAudioDeviceEndpointType(deviceOverride));
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
const stereoOutput = config?.audioRole === 'listener';
|
|
136
|
+
StreamInCallManagerNativeModule.setEnableStereoAudioOutput(stereoOutput);
|
|
95
137
|
StreamInCallManagerNativeModule.start();
|
|
96
138
|
},
|
|
97
139
|
stop: ({
|
|
98
|
-
isRingingTypeCall
|
|
140
|
+
isRingingTypeCall,
|
|
141
|
+
shouldStopCallManager
|
|
99
142
|
}) => {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
143
|
+
// Clear the stored audio config so it doesn't carry into the next call.
|
|
144
|
+
publicCallManager.stop();
|
|
145
|
+
|
|
146
|
+
// We want to interact with ADM only when it was instantiated. This guards a case when
|
|
147
|
+
// leave is invoked for ringing call - in this case PC Factory and ADM are not yet created.
|
|
148
|
+
if (shouldStopCallManager) {
|
|
149
|
+
// Teardown of setMutedRecordingPrepared. Done here (before the CallKit gate)
|
|
150
|
+
// so it runs on both paths and while the call factory is still alive: leave()
|
|
151
|
+
// calls stop() before disposing the engine, so the ADM resolves to the call's
|
|
152
|
+
// factory rather than a default.
|
|
153
|
+
if (Platform.OS === 'ios') {
|
|
154
|
+
StreamInCallManagerNativeModule.setRecordingAlwaysPreparedMode(false);
|
|
155
|
+
}
|
|
156
|
+
if (shouldBypassForCallKit({
|
|
157
|
+
isRingingTypeCall
|
|
158
|
+
})) {
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
StreamInCallManagerNativeModule.stop();
|
|
104
162
|
}
|
|
105
|
-
StreamInCallManagerNativeModule.stop();
|
|
106
163
|
},
|
|
107
164
|
// iOS-only. Keep the AVAudioEngine mic-input (voice-processing) chain
|
|
108
165
|
// prepared while muted so the engine stays full-duplex and remote audio
|
|
@@ -116,9 +173,9 @@ const streamRNVideoSDKGlobals = {
|
|
|
116
173
|
if (enabled) {
|
|
117
174
|
// Mute via the voice-processing unit (it's the default, fail safe config here) so the input chain
|
|
118
175
|
// stays built while muted, rather than tearing the engine down.
|
|
119
|
-
|
|
176
|
+
StreamInCallManagerNativeModule.setMuteMode(AudioEngineMuteMode.VoiceProcessing);
|
|
120
177
|
}
|
|
121
|
-
|
|
178
|
+
StreamInCallManagerNativeModule.setRecordingAlwaysPreparedMode(enabled);
|
|
122
179
|
}
|
|
123
180
|
},
|
|
124
181
|
permissions: {
|
|
@@ -153,5 +210,6 @@ export function registerSDKGlobals() {
|
|
|
153
210
|
if (!globalThis.streamRNVideoSDK) {
|
|
154
211
|
globalThis.streamRNVideoSDK = streamRNVideoSDKGlobals;
|
|
155
212
|
}
|
|
213
|
+
registerCallMediaEngine();
|
|
156
214
|
}
|
|
157
215
|
//# sourceMappingURL=registerSDKGlobals.js.map
|