@stream-io/video-react-native-sdk 1.42.0 → 1.44.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 +41 -6
- 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/Call/RingingCallContent/OutgoingCall.js.map +1 -1
- package/dist/commonjs/components/Participant/FloatingParticipantView/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/contexts/ThemeContext.js +10 -0
- package/dist/commonjs/contexts/ThemeContext.js.map +1 -1
- package/dist/commonjs/hooks/useScreenShareButton.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/providers/NoiseCancellation/lib.js.map +1 -1
- package/dist/commonjs/providers/StreamCall/AudioInterruptionTracer.js.map +1 -1
- package/dist/commonjs/utils/internal/callingx/callingx.js +26 -37
- 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 +6 -8
- package/dist/commonjs/utils/push/android.js.map +1 -1
- package/dist/commonjs/utils/push/libs/firebaseMessaging/index.js +0 -9
- package/dist/commonjs/utils/push/libs/firebaseMessaging/index.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/Call/RingingCallContent/OutgoingCall.js.map +1 -1
- package/dist/module/components/Participant/FloatingParticipantView/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/contexts/ThemeContext.js +10 -0
- package/dist/module/contexts/ThemeContext.js.map +1 -1
- package/dist/module/hooks/useScreenShareButton.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/providers/NoiseCancellation/lib.js.map +1 -1
- package/dist/module/providers/StreamCall/AudioInterruptionTracer.js.map +1 -1
- package/dist/module/utils/internal/callingx/callingx.js +25 -38
- 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 +7 -9
- package/dist/module/utils/push/android.js.map +1 -1
- package/dist/module/utils/push/libs/firebaseMessaging/index.js +0 -8
- package/dist/module/utils/push/libs/firebaseMessaging/index.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/FloatingParticipantView/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/contexts/ThemeContext.d.ts +10 -1
- package/dist/typescript/contexts/ThemeContext.d.ts.map +1 -1
- package/dist/typescript/hooks/useScreenShareButton.d.ts +2 -1
- package/dist/typescript/hooks/useScreenShareButton.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/providers/NoiseCancellation/lib.d.ts.map +1 -1
- package/dist/typescript/providers/StreamCall/AudioInterruptionTracer.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.map +1 -1
- package/dist/typescript/utils/push/libs/firebaseMessaging/index.d.ts +0 -1
- package/dist/typescript/utils/push/libs/firebaseMessaging/index.d.ts.map +1 -1
- package/dist/typescript/version.d.ts +1 -1
- package/expo-config-plugin/dist/withAndroidMessagingService.js +29 -3
- package/expo-config-plugin/dist/withIosScreenCapture/addBroadcastExtensionXcodeTarget.js +84 -2
- package/expo-config-plugin/dist/withIosScreenCapture/withPlistUpdates.js +3 -6
- package/expo-config-plugin/dist/withIosScreenCapture/withTarget.js +6 -4
- package/expo-config-plugin/static/AudioUploader.swift +230 -0
- package/expo-config-plugin/static/SampleHandler.swift +67 -14
- package/ios/StreamInCallManager.m +4 -0
- package/ios/StreamInCallManager.swift +44 -12
- package/ios/StreamVideoReactNative.m +15 -5
- package/package.json +27 -25
- 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/Call/RingingCallContent/OutgoingCall.tsx +1 -2
- package/src/components/Participant/FloatingParticipantView/index.tsx +1 -4
- package/src/components/Participant/ParticipantView/VideoRenderer/TrackSubscriber.tsx +56 -75
- package/src/components/Participant/ParticipantView/VideoRenderer/index.tsx +18 -7
- package/src/contexts/ThemeContext.tsx +10 -1
- package/src/hooks/useScreenShareButton.ts +2 -1
- package/src/modules/call-manager/CallManager.ts +41 -73
- package/src/modules/call-manager/native-module.d.ts +13 -0
- package/src/modules/call-manager/types.ts +0 -1
- package/src/providers/NoiseCancellation/lib.ts +1 -2
- package/src/providers/StreamCall/AudioInterruptionTracer.tsx +1 -2
- package/src/utils/StreamVideoRN/types.ts +4 -3
- package/src/utils/internal/callingx/callingx.ts +35 -44
- package/src/utils/internal/registerMediaEngine.ts +42 -0
- package/src/utils/internal/registerSDKGlobals.ts +115 -42
- package/src/utils/push/android.ts +9 -17
- package/src/utils/push/libs/firebaseMessaging/index.ts +0 -19
- package/src/version.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_videoClient","require","_videoReactBindings","_react","_reactNative","_hooks","_useIsIosScreenshareBroadcastStarted","_ScreenShareAudioManager","CanDeviceScreenShare","Platform","OS","Number","parseInt","Version","split","useScreenShareButton","screenCapturePickerViewiOSRef","onScreenShareStartedHandler","onScreenShareStoppedHandler","onMissingScreenShareStreamPermission","screenShareOptions","call","useCall","useLocalParticipant","useCallSettings","useOwnCapabilities","useCallStateHooks","callSettings","ownCapabilities","hasScreenSharingPermissions","includes","OwnCapability","SCREENSHARE","isScreenSharingEnabledInCall","screensharing","enabled","screenShareType","type","includeAudio","onScreenShareStartedHandlerRef","useRef","current","onScreenShareStoppedHandlerRef","iosScreenShareStartedFromSystem","useIsIosScreenshareBroadcastStarted","prevIosScreenShareStartedFromSystem","usePrevious","localParticipant","hasPublishedScreenShare","hasScreenShare","useEffect","screenShare","enableScreenShareAudio","enable","disable","onPress","logger","videoLoggerSystem","getLogger","info","disableScreenShareAudio","error","warn","screenShareAudioMixingManager","startInAppScreenCapture","stopInAppScreenCapture","reactTag","findNodeHandle","NativeModules","ScreenCapturePickerViewManager","show","undefined","exports"],"sourceRoot":"../../../src","sources":["hooks/useScreenShareButton.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,mBAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,oCAAA,GAAAL,OAAA;AACA,IAAAM,wBAAA,GAAAN,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;;
|
|
1
|
+
{"version":3,"names":["_videoClient","require","_videoReactBindings","_react","_reactNative","_hooks","_useIsIosScreenshareBroadcastStarted","_ScreenShareAudioManager","CanDeviceScreenShare","Platform","OS","Number","parseInt","Version","split","useScreenShareButton","screenCapturePickerViewiOSRef","onScreenShareStartedHandler","onScreenShareStoppedHandler","onMissingScreenShareStreamPermission","screenShareOptions","call","useCall","useLocalParticipant","useCallSettings","useOwnCapabilities","useCallStateHooks","callSettings","ownCapabilities","hasScreenSharingPermissions","includes","OwnCapability","SCREENSHARE","isScreenSharingEnabledInCall","screensharing","enabled","screenShareType","type","includeAudio","onScreenShareStartedHandlerRef","useRef","current","onScreenShareStoppedHandlerRef","iosScreenShareStartedFromSystem","useIsIosScreenshareBroadcastStarted","prevIosScreenShareStartedFromSystem","usePrevious","localParticipant","hasPublishedScreenShare","hasScreenShare","useEffect","screenShare","enableScreenShareAudio","enable","disable","onPress","logger","videoLoggerSystem","getLogger","info","disableScreenShareAudio","error","warn","screenShareAudioMixingManager","startInAppScreenCapture","stopInAppScreenCapture","reactTag","findNodeHandle","NativeModules","ScreenCapturePickerViewManager","show","undefined","exports"],"sourceRoot":"../../../src","sources":["hooks/useScreenShareButton.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,mBAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,oCAAA,GAAAL,OAAA;AACA,IAAAM,wBAAA,GAAAN,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;;AAsBA;AACA,MAAMO,oBAAoB,GACvBC,qBAAQ,CAACC,EAAE,KAAK,KAAK,IACpBC,MAAM,CAACC,QAAQ,CAACH,qBAAQ,CAACI,OAAO,EAAEC,KAAK,CAAC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AO,CAAC,IAAI,CAAC;IACvC;EACF,CAAC;EAED,IAAI,CAACrB,4BAA4B,IAAI,CAACzB,oBAAoB,EAAE;IAC1D,OAAO;MAAE+C,OAAO,EAAEgB,SAAS;MAAEvB,uBAAuB,EAAE;IAAM,CAAC;EAC/D;EACA,OAAO;IAAEO,OAAO;IAAEP;EAAwB,CAAC;AAC7C,CAAC;AAACwB,OAAA,CAAAzD,oBAAA,GAAAA,oBAAA","ignoreList":[]}
|
|
@@ -5,10 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.CallManager = void 0;
|
|
7
7
|
var _reactNative = require("react-native");
|
|
8
|
-
var _callingx = require("../../utils/push/libs/callingx");
|
|
9
8
|
var _videoClient = require("@stream-io/video-client");
|
|
9
|
+
var _libs = require("../../utils/push/libs");
|
|
10
10
|
const NativeManager = _reactNative.NativeModules.StreamInCallManager;
|
|
11
|
-
const CallingxModule = (0,
|
|
11
|
+
const CallingxModule = (0, _libs.getCallingxLibIfAvailable)();
|
|
12
12
|
const AUDIO_INTERRUPTION_EVENT = 'StreamInCallManagerAudioInterruption';
|
|
13
13
|
const AUDIO_DEVICE_CHANGED_EVENT = 'onAudioDeviceChanged';
|
|
14
14
|
const invariant = (condition, message) => {
|
|
@@ -249,22 +249,30 @@ class SpeakerManager {
|
|
|
249
249
|
NativeManager.setForceSpeakerphoneOn(force);
|
|
250
250
|
};
|
|
251
251
|
}
|
|
252
|
-
const shouldBypassForCallKit = () => {
|
|
253
|
-
if (_reactNative.Platform.OS !== 'ios') {
|
|
254
|
-
return false;
|
|
255
|
-
}
|
|
256
|
-
if (!CallingxModule) {
|
|
257
|
-
return false;
|
|
258
|
-
}
|
|
259
|
-
return CallingxModule.isSetup && (CallingxModule.hasRegisteredCall() || CallingxModule.isOngoingCallsEnabled);
|
|
260
|
-
};
|
|
261
252
|
class CallManager {
|
|
262
253
|
audioDevices = new AudioDevicesManager();
|
|
263
254
|
ios = new IOSCallManager();
|
|
264
255
|
speaker = new SpeakerManager();
|
|
265
256
|
|
|
266
257
|
/**
|
|
267
|
-
*
|
|
258
|
+
* The audio config recorded via {@link start}. The SDK's internal call manager reads it at the
|
|
259
|
+
* next join-time start and applies it before the native audio manager is activated.
|
|
260
|
+
*/
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* The config recorded via {@link start}.
|
|
264
|
+
*
|
|
265
|
+
* @internal Read by the SDK's internal call manager at join; not intended for app use.
|
|
266
|
+
*/
|
|
267
|
+
getStoredConfig = () => this.storedConfig;
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Records the desired audio config for the call.
|
|
271
|
+
*
|
|
272
|
+
* This does NOT start the native audio manager — the SDK owns native start/stop and applies this
|
|
273
|
+
* config at the next join-time start (before the audio manager is activated). Call it **before**
|
|
274
|
+
* joining. Calling it mid-call only updates the stored config; it does not change the running
|
|
275
|
+
* call's audio, and the new config takes effect on the next call/rejoin.
|
|
268
276
|
*
|
|
269
277
|
* @param config.audioRole The audio role to set. It can be one of the following:
|
|
270
278
|
* - `'communicator'`: (Default) For use cases like video or voice calls.
|
|
@@ -274,66 +282,41 @@ class CallManager {
|
|
|
274
282
|
* It prioritizes high-quality stereo audio streaming.
|
|
275
283
|
* Audio routing is controlled by the OS, and manual switching is not supported.
|
|
276
284
|
*
|
|
277
|
-
* @param config.deviceEndpointType
|
|
278
|
-
*
|
|
285
|
+
* @param config.deviceEndpointType Overrides the default audio device endpoint. When omitted,
|
|
286
|
+
* the SDK uses the device derived from the call settings. It can be one of the following:
|
|
287
|
+
* - `'speaker'`: For normal video or voice calls.
|
|
279
288
|
* - `'earpiece'`: For voice-only mobile call type scenarios.
|
|
280
|
-
*
|
|
281
|
-
* @param config.enableStereoAudioOutput Whether to enable stereo audio output. Only supported for listener audio role.
|
|
282
289
|
*/
|
|
283
290
|
start = config => {
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
safeNativeCall('setDefaultAudioDeviceEndpointType', () => NativeManager.setDefaultAudioDeviceEndpointType(type));
|
|
289
|
-
}
|
|
290
|
-
_videoClient.videoLoggerSystem.getLogger('CallManager').debug('start: skipping start as callkit is handling the audio session');
|
|
291
|
-
return;
|
|
292
|
-
}
|
|
293
|
-
if (isAndroidTelecomManaged()) {
|
|
294
|
-
// Telecom owns routing/focus; forward the sticky preference to callingx and run in
|
|
295
|
-
// telecom-managed mode (StreamInCallManager keeps proximity/keep-screen-on only).
|
|
296
|
-
if (config?.audioRole !== 'listener' && CallingxModule) {
|
|
297
|
-
safeNativeCall('setDefaultAudioDeviceEndpointType (callingx)', () => CallingxModule.setDefaultAudioDeviceEndpointType(config?.deviceEndpointType ?? 'speaker'));
|
|
298
|
-
}
|
|
299
|
-
NativeManager.setTelecomManagedMode(true);
|
|
300
|
-
NativeManager.setAudioRole(config?.audioRole ?? 'communicator');
|
|
301
|
-
NativeManager.start();
|
|
302
|
-
return;
|
|
303
|
-
}
|
|
304
|
-
if (_reactNative.Platform.OS === 'android') {
|
|
305
|
-
NativeManager.setTelecomManagedMode(false);
|
|
306
|
-
}
|
|
307
|
-
NativeManager.setAudioRole(config?.audioRole ?? 'communicator');
|
|
308
|
-
if (config?.audioRole === 'communicator') {
|
|
309
|
-
const type = config.deviceEndpointType ?? 'speaker';
|
|
310
|
-
NativeManager.setDefaultAudioDeviceEndpointType(type);
|
|
311
|
-
}
|
|
312
|
-
if (config?.audioRole === 'listener' && config.enableStereoAudioOutput) {
|
|
313
|
-
NativeManager.setEnableStereoAudioOutput(true);
|
|
314
|
-
}
|
|
315
|
-
NativeManager.start();
|
|
291
|
+
this.storedConfig = config;
|
|
292
|
+
_videoClient.videoLoggerSystem.getLogger('CallManager').debug('start: stored call manager config', {
|
|
293
|
+
config
|
|
294
|
+
});
|
|
316
295
|
};
|
|
317
296
|
|
|
318
297
|
/**
|
|
319
|
-
*
|
|
298
|
+
* Clears the stored audio config.
|
|
320
299
|
*/
|
|
321
300
|
stop = () => {
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
return;
|
|
325
|
-
}
|
|
326
|
-
NativeManager.stop();
|
|
301
|
+
this.storedConfig = undefined;
|
|
302
|
+
_videoClient.videoLoggerSystem.getLogger('CallManager').debug('[public] stop(): cleared stored config');
|
|
327
303
|
};
|
|
328
304
|
|
|
329
305
|
/**
|
|
330
306
|
* For debugging purposes, will emit a log event with the current audio state.
|
|
331
307
|
* in the native layer.
|
|
308
|
+
*
|
|
309
|
+
* NOTE: This method might be called outside of the call JOIN/LEFT window,
|
|
310
|
+
* so it may lead to default peer connection factory and adm being created.
|
|
332
311
|
*/
|
|
333
312
|
logAudioState = () => NativeManager.logAudioState();
|
|
334
313
|
|
|
335
314
|
/**
|
|
336
315
|
* For debugging purposes, returns the current audio state as a string.
|
|
316
|
+
*
|
|
317
|
+
* NOTE: This method might be called outside of the call JOIN/LEFT window,
|
|
318
|
+
* so it may lead to default peer connection factory and adm being created.
|
|
319
|
+
*
|
|
337
320
|
* @returns A string containing the current audio state information.
|
|
338
321
|
*/
|
|
339
322
|
getAudioStateLog = () => NativeManager.getAudioStateLog();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_videoClient","_libs","NativeManager","NativeModules","StreamInCallManager","CallingxModule","getCallingxLibIfAvailable","AUDIO_INTERRUPTION_EVENT","AUDIO_DEVICE_CHANGED_EVENT","invariant","condition","message","Error","safeNativeCall","label","fn","error","videoLoggerSystem","getLogger","warn","isAndroidTelecomManaged","Platform","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","NativeEventEmitter","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","exports"],"sourceRoot":"../../../../src","sources":["modules/call-manager/CallManager.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAWA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAEA,MAAMG,aAAa,GAAGC,0BAAa,CAACC,mBAAmB;AACvD,MAAMC,cAAc,GAAG,IAAAC,+BAAyB,EAAC,CAAC;AAClD,MAAMC,wBAAwB,GAAG,sCAAsC;AACvE,MAAMC,0BAA0B,GAAG,sBAAsB;AAEzD,MAAMC,SAAS,GAAGA,CAACC,SAAkB,EAAEC,OAAe,KAAK;EACzD,IAAI,CAACD,SAAS,EAAE,MAAM,IAAIE,KAAK,CAACD,OAAO,CAAC;AAC1C,CAAC;;AAED;AACA;AACA;AACA;AACA,MAAME,cAAc,GAAGA,CAACC,KAAa,EAAEC,EAAc,KAAW;EAC9D,IAAI;IACFA,EAAE,CAAC,CAAC;EACN,CAAC,CAAC,OAAOC,KAAK,EAAE;IACdC,8BAAiB,CAACC,SAAS,CAAC,aAAa,CAAC,CAACC,IAAI,CAAC,GAAGL,KAAK,SAAS,EAAEE,KAAK,CAAC;EAC3E;AACF,CAAC;;AAED;AACA;AACA;AACA;AACA,MAAMI,uBAAuB,GAAGA,CAAA,KAAe;EAC7C,IAAIC,qBAAQ,CAACC,EAAE,KAAK,SAAS,IAAI,CAACjB,cAAc,EAAE;IAChD,OAAO,KAAK;EACd;E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A;EACEE,IAAI,GAAGA,CAAA,KAAY;IACjB,IAAI,CAACJ,YAAY,GAAGpE,SAAS;IAC7BX,8BAAiB,CACdC,SAAS,CAAC,aAAa,CAAC,CACxBiF,KAAK,CAAC,wCAAwC,CAAC;EACpD,CAAC;;EAED;AACF;AACA;AACA;AACA;AACA;AACA;EACEE,aAAa,GAAGA,CAAA,KAAYnG,aAAa,CAACmG,aAAa,CAAC,CAAC;;EAEzD;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACEC,gBAAgB,GAAGA,CAAA,KAAcpG,aAAa,CAACoG,gBAAgB,CAAC,CAAC;AACnE;AAACC,OAAA,CAAAZ,WAAA,GAAAA,WAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["noiseCancellationLib","require","getNoiseCancellationLibThrowIfNotInstalled","Error","NoiseCancellationWrapper","constructor","getInstance","noiseCancellationInstance","ncLib","NoiseCancellation","exports"],"sourceRoot":"../../../../src","sources":["providers/NoiseCancellation/lib.ts"],"mappings":";;;;;;;AAEA,IAAIA,oBAAsC;AAE1C,IAAI;EACFA,oBAAoB,GAAGC,OAAO,CAAC,4CAA4C,CAAC;AAC9E,CAAC,CAAC,MAAM,CAAC;AAEF,SAASC,0CAA0CA,CAAA,EAAG;EAC3D,IAAI,CAACF,oBAAoB,EAAE;IACzB,MAAMG,KAAK,CACT,mHACF,CAAC;EACH;EACA,OAAOH,oBAAoB;AAC7B;AAEO,MAAMI,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"names":["noiseCancellationLib","require","getNoiseCancellationLibThrowIfNotInstalled","Error","NoiseCancellationWrapper","constructor","getInstance","noiseCancellationInstance","ncLib","NoiseCancellation","exports"],"sourceRoot":"../../../../src","sources":["providers/NoiseCancellation/lib.ts"],"mappings":";;;;;;;AAEA,IAAIA,oBAAsC;AAE1C,IAAI;EACFA,oBAAoB,GAAGC,OAAO,CAAC,4CAA4C,CAAC;AAC9E,CAAC,CAAC,MAAM,CAAC;AAEF,SAASC,0CAA0CA,CAAA,EAAG;EAC3D,IAAI,CAACF,oBAAoB,EAAE;IACzB,MAAMG,KAAK,CACT,mHACF,CAAC;EACH;EACA,OAAOH,oBAAoB;AAC7B;AAEO,MAAMI,wBAAwB,CAAC;EAI5BC,WAAWA,CAAA,EAAG,CAAC;EAEvB,OAAOC,WAAWA,CAAA,EAA4C;IAC5D,IAAI,CAAC,IAAI,CAACC,yBAAyB,EAAE;MACnC,MAAMC,KAAK,GAAGN,0CAA0C,CAAC,CAAC;MAC1D,IAAI,CAACK,yBAAyB,GAAG,IAAIC,KAAK,CAACC,iBAAiB,CAAC,CAAC;IAChE;IACA,OAAO,IAAI,CAACF,yBAAyB;EACvC;AACF;;AAEA;AACA;AACA;AACA;AAHAG,OAAA,CAAAN,wBAAA,GAAAA,wBAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_videoReactBindings","require","_react","_reactNative","_callManager","_callingx","_videoClient","AudioInterruptionTracer","call","useCall","useEffect","Platform","OS","traceAudioInterruption","event","tracer","trace","phase","videoLoggerSystem","getLogger","info","removeInCallManagerListener","callManager","ios","addAudioInterruptionListener","callingx","getCallingxLibIfAvailable","callingxSubscription","addEventListener","remove","exports"],"sourceRoot":"../../../../src","sources":["providers/StreamCall/AudioInterruptionTracer.tsx"],"mappings":";;;;;;AAAA,IAAAA,mBAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAEA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AASA;AACA;AACA;AACO,MAAMM,uBAAuB,GAAGA,CAAA,KAAM;EAC3C,MAAMC,IAAI,GAAG,IAAAC,2BAAO,EAAC,CAAC;EAEtB,IAAAC,gBAAS,EAAC,MAAM;IACd,IAAIC,qBAAQ,CAACC,EAAE,KAAK,KAAK,IAAI,CAACJ,IAAI,EAAE;MAClC;IACF;IAEA,MAAMK,sBAAsB,GAAIC,KAAgC,IAAK;MACnEN,IAAI,CAACO,MAAM,CAACC,KAAK,CAAC,yBAAyBF,KAAK,CAACG,KAAK,EAAE,EAAEH,KAAK,CAAC;MAChEI,8BAAiB,CACdC,SAAS,CAAC,MAAM,CAAC,CACjBC,IAAI,CAAC,yBAAyBN,KAAK,CAACG,KAAK,EAAE,EAAEH,KAAK,CAAC;IACxD,CAAC;IAED,MAAMO,2BAA2B,GAC/BC,wBAAW,CAACC,GAAG,CAACC,4BAA4B,CAACX,sBAAsB,CAAC;IACtE,MAAMY,QAAQ,GAAG,IAAAC,mCAAyB,EAAC,
|
|
1
|
+
{"version":3,"names":["_videoReactBindings","require","_react","_reactNative","_callManager","_callingx","_videoClient","AudioInterruptionTracer","call","useCall","useEffect","Platform","OS","traceAudioInterruption","event","tracer","trace","phase","videoLoggerSystem","getLogger","info","removeInCallManagerListener","callManager","ios","addAudioInterruptionListener","callingx","getCallingxLibIfAvailable","callingxSubscription","addEventListener","remove","exports"],"sourceRoot":"../../../../src","sources":["providers/StreamCall/AudioInterruptionTracer.tsx"],"mappings":";;;;;;AAAA,IAAAA,mBAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAEA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AASA;AACA;AACA;AACO,MAAMM,uBAAuB,GAAGA,CAAA,KAAM;EAC3C,MAAMC,IAAI,GAAG,IAAAC,2BAAO,EAAC,CAAC;EAEtB,IAAAC,gBAAS,EAAC,MAAM;IACd,IAAIC,qBAAQ,CAACC,EAAE,KAAK,KAAK,IAAI,CAACJ,IAAI,EAAE;MAClC;IACF;IAEA,MAAMK,sBAAsB,GAAIC,KAAgC,IAAK;MACnEN,IAAI,CAACO,MAAM,CAACC,KAAK,CAAC,yBAAyBF,KAAK,CAACG,KAAK,EAAE,EAAEH,KAAK,CAAC;MAChEI,8BAAiB,CACdC,SAAS,CAAC,MAAM,CAAC,CACjBC,IAAI,CAAC,yBAAyBN,KAAK,CAACG,KAAK,EAAE,EAAEH,KAAK,CAAC;IACxD,CAAC;IAED,MAAMO,2BAA2B,GAC/BC,wBAAW,CAACC,GAAG,CAACC,4BAA4B,CAACX,sBAAsB,CAAC;IACtE,MAAMY,QAAQ,GAAG,IAAAC,mCAAyB,EAAC,CACE;IAC7C,MAAMC,oBAAoB,GAAGF,QAAQ,EAAEG,gBAAgB,CACrD,sBAAsB,EACtBf,sBACF,CAAC;IAED,OAAO,MAAM;MACXQ,2BAA2B,CAAC,CAAC;MAC7BM,oBAAoB,EAAEE,MAAM,CAAC,CAAC;IAChC,CAAC;EACH,CAAC,EAAE,CAACrB,IAAI,CAAC,CAAC;EAEV,OAAO,IAAI;AACb,CAAC;AAACsB,OAAA,CAAAvB,uBAAA,GAAAA,uBAAA","ignoreList":[]}
|
|
@@ -7,6 +7,8 @@ exports.endCallingxCall = endCallingxCall;
|
|
|
7
7
|
exports.getCallDisplayName = getCallDisplayName;
|
|
8
8
|
exports.joinCallingxCall = joinCallingxCall;
|
|
9
9
|
exports.registerOutgoingCall = registerOutgoingCall;
|
|
10
|
+
exports.unwireAudioEngineSubscription = unwireAudioEngineSubscription;
|
|
11
|
+
exports.wireAudioEngineSubscription = wireAudioEngineSubscription;
|
|
10
12
|
var _reactNative = require("react-native");
|
|
11
13
|
var _callingx = require("../../push/libs/callingx");
|
|
12
14
|
var _videoClient = require("@stream-io/video-client");
|
|
@@ -17,40 +19,6 @@ var _videoClient = require("@stream-io/video-client");
|
|
|
17
19
|
|
|
18
20
|
const CallingxModule = (0, _callingx.getCallingxLibIfAvailable)();
|
|
19
21
|
|
|
20
|
-
/**
|
|
21
|
-
* Fallback when Telecom registration fails/times out on Android: no component would own audio
|
|
22
|
-
* (Telecom never took over), so re-establish StreamInCallManager in its classic (non-telecom)
|
|
23
|
-
* mode to keep the call audible.
|
|
24
|
-
*/
|
|
25
|
-
function recoverAudioToClassicMode() {
|
|
26
|
-
if (_reactNative.Platform.OS !== 'android') {
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
if (!CallingxModule?.isSetup || !CallingxModule.isTelecomBacked) {
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
// If a call is already registered, Telecom owns audio for it (the registration
|
|
33
|
-
// partially succeeded). Switching to classic mode here would fight Telecom's
|
|
34
|
-
// routing/focus — leave ownership intact.
|
|
35
|
-
if (CallingxModule.hasRegisteredCall()) {
|
|
36
|
-
_videoClient.videoLoggerSystem.getLogger('callingx').debug('recoverAudioToClassicMode: Telecom already owns a registered call; skipping classic fallback');
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
const StreamInCallManagerNativeModule = _reactNative.NativeModules.StreamInCallManager;
|
|
40
|
-
if (!StreamInCallManagerNativeModule) {
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
const logger = _videoClient.videoLoggerSystem.getLogger('callingx');
|
|
44
|
-
logger.warn('Telecom registration failed; falling back to classic StreamInCallManager audio');
|
|
45
|
-
try {
|
|
46
|
-
StreamInCallManagerNativeModule.stop();
|
|
47
|
-
StreamInCallManagerNativeModule.setTelecomManagedMode(false);
|
|
48
|
-
StreamInCallManagerNativeModule.start();
|
|
49
|
-
} catch (error) {
|
|
50
|
-
logger.error('recoverAudioToClassicMode: failed to recover audio', error);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
22
|
/**
|
|
55
23
|
* Gets the call display name. To be used for display in native call screen.
|
|
56
24
|
*/
|
|
@@ -98,7 +66,6 @@ async function registerOutgoingCall(call) {
|
|
|
98
66
|
);
|
|
99
67
|
} catch (error) {
|
|
100
68
|
logger.error(`registerOutgoingCall: Error registering outgoing call in callingx: ${call.cid}`, error);
|
|
101
|
-
recoverAudioToClassicMode();
|
|
102
69
|
}
|
|
103
70
|
}
|
|
104
71
|
|
|
@@ -134,7 +101,6 @@ async function joinCallingxCall(call, activeCalls) {
|
|
|
134
101
|
await startCallInCallingx();
|
|
135
102
|
} catch (error) {
|
|
136
103
|
logger.error(`startCallingxCall: Error starting call in callingx: ${call.cid}`, error);
|
|
137
|
-
recoverAudioToClassicMode();
|
|
138
104
|
}
|
|
139
105
|
} else if (isIncomingCall) {
|
|
140
106
|
logger.debug(`joinCallingxCall: Joining incoming call ${call.cid}`);
|
|
@@ -164,7 +130,6 @@ async function joinCallingxCall(call, activeCalls) {
|
|
|
164
130
|
await CallingxModule.answerIncomingCall(call.cid);
|
|
165
131
|
} catch (error) {
|
|
166
132
|
logger.error(`Error joining incoming call in callingx: ${call.cid}`, error);
|
|
167
|
-
recoverAudioToClassicMode();
|
|
168
133
|
}
|
|
169
134
|
}
|
|
170
135
|
}
|
|
@@ -180,4 +145,28 @@ async function endCallingxCall(call, reason) {
|
|
|
180
145
|
logger.error(`endCallingxCall: Error ending call in callingx: ${call.cid}`, error);
|
|
181
146
|
}
|
|
182
147
|
}
|
|
148
|
+
async function wireAudioEngineSubscription() {
|
|
149
|
+
if (!CallingxModule || !CallingxModule.isSetup || _reactNative.Platform.OS !== 'ios') {
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
const logger = _videoClient.videoLoggerSystem.getLogger('callingx');
|
|
153
|
+
try {
|
|
154
|
+
logger.debug('wireEngineSubscription: Wiring engine subscription');
|
|
155
|
+
CallingxModule.wireAudioEngineSubscription();
|
|
156
|
+
} catch (error) {
|
|
157
|
+
logger.error('wireAudioEngineSubscription: Error wiring engine subscription', error);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
function unwireAudioEngineSubscription() {
|
|
161
|
+
if (!CallingxModule || !CallingxModule.isSetup || _reactNative.Platform.OS !== 'ios') {
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
const logger = _videoClient.videoLoggerSystem.getLogger('callingx');
|
|
165
|
+
try {
|
|
166
|
+
logger.debug('unwireEngineSubscription: Cancelling engine subscription');
|
|
167
|
+
CallingxModule.unwireAudioEngineSubscription();
|
|
168
|
+
} catch (error) {
|
|
169
|
+
logger.error('unwireAudioEngineSubscription: Error cancelling engine subscription', error);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
183
172
|
//# sourceMappingURL=callingx.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_callingx","_videoClient","CallingxModule","getCallingxLibIfAvailable","
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_callingx","_videoClient","CallingxModule","getCallingxLibIfAvailable","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","videoLoggerSystem","getLogger","debug","cid","callDisplayName","startCall","createdBy","settings","video","enabled","error","joinCallingxCall","activeCalls","isIncomingCall","startCallInCallingx","isOngoingCallsEnabled","activeCallsToLeave","filter","c","callingState","CallingState","LEFT","activeCall","leave","reason","catch","e","displayIncomingCall","answerIncomingCall","endCallingxCall","isCallTracked","endCallWithReason","wireAudioEngineSubscription","Platform","OS","unwireAudioEngineSubscription"],"sourceRoot":"../../../../../src","sources":["utils/internal/callingx/callingx.ts"],"mappings":";;;;;;;;;;;AAIA,IAAAA,YAAA,GAAAC,OAAA;AAEA,IAAAC,SAAA,GAAAD,OAAA;AAMA,IAAAE,YAAA,GAAAF,OAAA;AAZA;AACA;AACA;AACA;;AAWA,MAAMG,cAAc,GAAG,IAAAC,mCAAyB,EAAC,CAAC;;AAElD;AACA;AACA;AACO,SAASC,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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,GAAGC,8BAAiB,CAACC,SAAS,CAAC,UAAU,CAAC;EAEtD,IAAI;IACFF,MAAM,CAACG,KAAK,CAAC,oDAAoD,CAAC;IAClEjC,cAAc,CAAC+D,2BAA2B,CAAC,CAAC;EAC9C,CAAC,CAAC,OAAOtB,KAAK,EAAE;IACdX,MAAM,CAACW,KAAK,CACV,+DAA+D,EAC/DA,KACF,CAAC;EACH;AACF;AAEO,SAASyB,6BAA6BA,CAAA,EAAG;EAC9C,IAAI,CAAClE,cAAc,IAAI,CAACA,cAAc,CAACyB,OAAO,IAAIuC,qBAAQ,CAACC,EAAE,KAAK,KAAK,EAAE;IACvE;EACF;EACA,MAAMnC,MAAM,GAAGC,8BAAiB,CAACC,SAAS,CAAC,UAAU,CAAC;EAEtD,IAAI;IACFF,MAAM,CAACG,KAAK,CAAC,0DAA0D,CAAC;IACxEjC,cAAc,CAACkE,6BAA6B,CAAC,CAAC;EAChD,CAAC,CAAC,OAAOzB,KAAK,EAAE;IACdX,MAAM,CAACW,KAAK,CACV,qEAAqE,EACrEA,KACF,CAAC;EACH;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.registerCallMediaEngine = registerCallMediaEngine;
|
|
7
|
+
var _videoClient = require("@stream-io/video-client");
|
|
8
|
+
var _reactNativeWebrtc = require("@stream-io/react-native-webrtc");
|
|
9
|
+
var _callManager = require("../../modules/call-manager");
|
|
10
|
+
const logger = _videoClient.videoLoggerSystem.getLogger('CallMediaEngine');
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Registers the React Native {@link CallMediaEngine} provider.
|
|
14
|
+
*
|
|
15
|
+
* Once registered, every `Call.ensureMediaFactory()` builds the call's native
|
|
16
|
+
* `PeerConnectionFactory` (with the call's audio configuration) and sets it as
|
|
17
|
+
* the single live factory. The WebRTC globals (`getUserMedia`/`getDisplayMedia`/
|
|
18
|
+
* `new RTCPeerConnection`) then resolve to it, so the call's tracks and peer
|
|
19
|
+
* connections are created with — and torn down with — that one native factory,
|
|
20
|
+
* which is what lets the call own its AudioDeviceModule. The engine itself only
|
|
21
|
+
* manages the factory lifecycle (`dispose` at leave).
|
|
22
|
+
*
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
function registerCallMediaEngine() {
|
|
26
|
+
(0, _videoClient.setCallMediaEngineProvider)(async () => {
|
|
27
|
+
const config = _callManager.callManager.getStoredConfig();
|
|
28
|
+
const bypassVoiceProcessing = config?.audioRole === 'listener';
|
|
29
|
+
const factory = await _reactNativeWebrtc.CallFactory.create({
|
|
30
|
+
bypassVoiceProcessing
|
|
31
|
+
});
|
|
32
|
+
logger.debug(`Created per-call factory (bypassVoiceProcessing=${bypassVoiceProcessing})`);
|
|
33
|
+
return {
|
|
34
|
+
dispose: async () => {
|
|
35
|
+
logger.debug('Disposing per-call factory');
|
|
36
|
+
return await factory.dispose();
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=registerMediaEngine.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_videoClient","require","_reactNativeWebrtc","_callManager","logger","videoLoggerSystem","getLogger","registerCallMediaEngine","setCallMediaEngineProvider","config","callManager","getStoredConfig","bypassVoiceProcessing","audioRole","factory","CallFactory","create","debug","dispose"],"sourceRoot":"../../../../src","sources":["utils/internal/registerMediaEngine.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,kBAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAEA,MAAMG,MAAM,GAAGC,8BAAiB,CAACC,SAAS,CAAC,iBAAiB,CAAC;;AAE7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,uBAAuBA,CAAA,EAAG;EACxC,IAAAC,uCAA0B,EAAC,YAAsC;IAC/D,MAAMC,MAAM,GAAGC,wBAAW,CAACC,eAAe,CAAC,CAAC;IAC5C,MAAMC,qBAAqB,GAAGH,MAAM,EAAEI,SAAS,KAAK,UAAU;IAC9D,MAAMC,OAAO,GAAG,MAAMC,8BAAW,CAACC,MAAM,CAAC;MACvCJ;IACF,CAAC,CAAC;IACFR,MAAM,CAACa,KAAK,CACV,mDAAmDL,qBAAqB,GAC1E,CAAC;IAED,OAAO;MACLM,OAAO,EAAE,MAAAA,CAAA,KAAY;QACnBd,MAAM,CAACa,KAAK,CAAC,4BAA4B,CAAC;QAC1C,OAAO,MAAMH,OAAO,CAACI,OAAO,CAAC,CAAC;MAChC;IACF,CAAC;EACH,CAAC,CAAC;AACJ","ignoreList":[]}
|
|
@@ -4,14 +4,29 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.registerSDKGlobals = registerSDKGlobals;
|
|
7
|
+
var _videoClient = require("@stream-io/video-client");
|
|
7
8
|
var _reactNative = require("react-native");
|
|
8
9
|
var _reactNativeWebrtc = require("@stream-io/react-native-webrtc");
|
|
9
10
|
var _callingx = require("../push/libs/callingx");
|
|
10
11
|
var _callingx2 = require("./callingx/callingx");
|
|
12
|
+
var _registerMediaEngine = require("./registerMediaEngine");
|
|
13
|
+
var _callManager = require("../../modules/call-manager");
|
|
11
14
|
const StreamInCallManagerNativeModule = _reactNative.NativeModules.StreamInCallManager;
|
|
12
15
|
const StreamVideoReactNativeModule = _reactNative.NativeModules.StreamVideoReactNative;
|
|
13
16
|
const CallingxModule = (0, _callingx.getCallingxLibIfAvailable)();
|
|
14
17
|
|
|
18
|
+
/**
|
|
19
|
+
* Runs a fire-and-forget native call, logging instead of throwing on a bridge
|
|
20
|
+
* error so it can't crash the caller (e.g. the join/leave flow).
|
|
21
|
+
*/
|
|
22
|
+
const safeNativeCall = (label, fn) => {
|
|
23
|
+
try {
|
|
24
|
+
fn();
|
|
25
|
+
} catch (error) {
|
|
26
|
+
_videoClient.videoLoggerSystem.getLogger('CallManager').warn(`${label} failed`, error);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
|
|
15
30
|
/**
|
|
16
31
|
* Checks if StreamInCallManager should be bypassed because CallKit is handling
|
|
17
32
|
* the audio session via CallingX.
|
|
@@ -42,71 +57,113 @@ const shouldBypassForCallKit = ({
|
|
|
42
57
|
* run it in "telecom-managed" mode where it only keeps proximity/keep-screen-on/mute.
|
|
43
58
|
*/
|
|
44
59
|
const isAndroidTelecomManaged = ({
|
|
45
|
-
|
|
60
|
+
cid
|
|
46
61
|
}) => {
|
|
47
|
-
if (_reactNative.Platform.OS !== 'android') {
|
|
62
|
+
if (_reactNative.Platform.OS !== 'android' || !CallingxModule) {
|
|
48
63
|
return false;
|
|
49
64
|
}
|
|
50
|
-
if (!CallingxModule) {
|
|
65
|
+
if (!CallingxModule.isSetup || !CallingxModule.isTelecomBacked) {
|
|
51
66
|
return false;
|
|
52
67
|
}
|
|
53
|
-
|
|
68
|
+
// Trust Telecom's actual per-call registration. A call that never registered
|
|
69
|
+
// (e.g. Telecom registration failed) is not managed, so start() falls through
|
|
70
|
+
// to the classic path — this is where audio recovery happens.
|
|
71
|
+
return CallingxModule.isCallTracked(cid);
|
|
54
72
|
};
|
|
55
73
|
const streamRNVideoSDKGlobals = {
|
|
56
74
|
callingX: {
|
|
57
75
|
joinCall: _callingx2.joinCallingxCall,
|
|
58
76
|
endCall: _callingx2.endCallingxCall,
|
|
59
|
-
registerOutgoingCall: _callingx2.registerOutgoingCall
|
|
77
|
+
registerOutgoingCall: _callingx2.registerOutgoingCall,
|
|
78
|
+
wireAudioEngineSubscription: _callingx2.wireAudioEngineSubscription,
|
|
79
|
+
unwireAudioEngineSubscription: _callingx2.unwireAudioEngineSubscription
|
|
60
80
|
},
|
|
61
81
|
callManager: {
|
|
62
82
|
setup: ({
|
|
63
83
|
defaultDevice,
|
|
64
|
-
isRingingTypeCall
|
|
84
|
+
isRingingTypeCall,
|
|
85
|
+
cid
|
|
65
86
|
}) => {
|
|
66
|
-
|
|
87
|
+
const isTelecomManaged = isAndroidTelecomManaged({
|
|
88
|
+
cid
|
|
89
|
+
});
|
|
90
|
+
const isCallKitManaged = shouldBypassForCallKit({
|
|
67
91
|
isRingingTypeCall
|
|
68
|
-
})
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
return;
|
|
92
|
+
});
|
|
93
|
+
if (_reactNative.Platform.OS === 'android') {
|
|
94
|
+
StreamInCallManagerNativeModule.setTelecomManagedMode(isTelecomManaged);
|
|
72
95
|
}
|
|
73
|
-
if (
|
|
74
|
-
|
|
75
|
-
})) {
|
|
76
|
-
// Telecom owns routing; forward the sticky preference to callingx and run the
|
|
77
|
-
// in-call manager in telecom-managed mode (proximity/keep-screen-on only).
|
|
78
|
-
CallingxModule?.setDefaultAudioDeviceEndpointType(defaultDevice);
|
|
79
|
-
StreamInCallManagerNativeModule.setTelecomManagedMode(true);
|
|
80
|
-
StreamInCallManagerNativeModule.setup();
|
|
81
|
-
return;
|
|
96
|
+
if (isTelecomManaged || isCallKitManaged) {
|
|
97
|
+
safeNativeCall('setup defaultAudioDevice (callingx)', () => CallingxModule?.setDefaultAudioDeviceEndpointType(defaultDevice));
|
|
82
98
|
}
|
|
83
|
-
if (
|
|
84
|
-
StreamInCallManagerNativeModule.
|
|
99
|
+
if (!isTelecomManaged) {
|
|
100
|
+
safeNativeCall('setup defaultAudioDevice', () => StreamInCallManagerNativeModule.setDefaultAudioDeviceEndpointType(defaultDevice));
|
|
85
101
|
}
|
|
86
|
-
StreamInCallManagerNativeModule.setDefaultAudioDeviceEndpointType(defaultDevice);
|
|
87
|
-
StreamInCallManagerNativeModule.setup();
|
|
88
102
|
},
|
|
89
103
|
start: ({
|
|
90
|
-
isRingingTypeCall
|
|
104
|
+
isRingingTypeCall,
|
|
105
|
+
cid
|
|
91
106
|
}) => {
|
|
107
|
+
// Apply the audio config a consumer recorded via `callManager.start(config)` at this single
|
|
108
|
+
// join-time start, before the native audio manager is activated.
|
|
109
|
+
const config = _callManager.callManager.getStoredConfig();
|
|
110
|
+
const deviceOverride = config?.audioRole === 'communicator' ? config.deviceEndpointType : undefined;
|
|
92
111
|
if (shouldBypassForCallKit({
|
|
93
112
|
isRingingTypeCall
|
|
94
113
|
})) {
|
|
114
|
+
// CallKit owns activation. Only forward an explicit endpoint override; the
|
|
115
|
+
// SpeakerManager-derived default was already forwarded via `setup`.
|
|
116
|
+
if (deviceOverride) {
|
|
117
|
+
safeNativeCall('start defaultAudioDevice (callingx)', () => CallingxModule?.setDefaultAudioDeviceEndpointType(deviceOverride));
|
|
118
|
+
safeNativeCall('start defaultAudioDevice', () => StreamInCallManagerNativeModule.setDefaultAudioDeviceEndpointType(deviceOverride));
|
|
119
|
+
}
|
|
95
120
|
return;
|
|
96
121
|
}
|
|
97
|
-
|
|
98
|
-
|
|
122
|
+
const isTelecomManaged = isAndroidTelecomManaged({
|
|
123
|
+
cid
|
|
124
|
+
});
|
|
125
|
+
if (_reactNative.Platform.OS === 'android') {
|
|
126
|
+
StreamInCallManagerNativeModule.setTelecomManagedMode(isTelecomManaged);
|
|
127
|
+
}
|
|
128
|
+
if (config?.audioRole) {
|
|
129
|
+
StreamInCallManagerNativeModule.setAudioRole(config.audioRole);
|
|
130
|
+
}
|
|
131
|
+
if (deviceOverride) {
|
|
132
|
+
// Override the SpeakerManager-derived default device (set via `setup`).
|
|
133
|
+
if (isTelecomManaged) {
|
|
134
|
+
safeNativeCall('start defaultAudioDevice (callingx)', () => CallingxModule?.setDefaultAudioDeviceEndpointType(deviceOverride));
|
|
135
|
+
} else {
|
|
136
|
+
safeNativeCall('start defaultAudioDevice', () => StreamInCallManagerNativeModule.setDefaultAudioDeviceEndpointType(deviceOverride));
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
const stereoOutput = config?.audioRole === 'listener';
|
|
140
|
+
StreamInCallManagerNativeModule.setEnableStereoAudioOutput(stereoOutput);
|
|
99
141
|
StreamInCallManagerNativeModule.start();
|
|
100
142
|
},
|
|
101
143
|
stop: ({
|
|
102
|
-
isRingingTypeCall
|
|
144
|
+
isRingingTypeCall,
|
|
145
|
+
shouldStopCallManager
|
|
103
146
|
}) => {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
147
|
+
// Clear the stored audio config so it doesn't carry into the next call.
|
|
148
|
+
_callManager.callManager.stop();
|
|
149
|
+
|
|
150
|
+
// We want to interact with ADM only when it was instantiated. This guards a case when
|
|
151
|
+
// leave is invoked for ringing call - in this case PC Factory and ADM are not yet created.
|
|
152
|
+
if (shouldStopCallManager) {
|
|
153
|
+
// Teardown of setMutedRecordingPrepared. Done here (before the CallKit gate)
|
|
154
|
+
// so it runs on both paths and while the call factory is still alive: leave()
|
|
155
|
+
// calls stop() before disposing the engine, so the ADM resolves to the call's
|
|
156
|
+
// factory rather than a default.
|
|
157
|
+
if (_reactNative.Platform.OS === 'ios') {
|
|
158
|
+
StreamInCallManagerNativeModule.setRecordingAlwaysPreparedMode(false);
|
|
159
|
+
}
|
|
160
|
+
if (shouldBypassForCallKit({
|
|
161
|
+
isRingingTypeCall
|
|
162
|
+
})) {
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
StreamInCallManagerNativeModule.stop();
|
|
108
166
|
}
|
|
109
|
-
StreamInCallManagerNativeModule.stop();
|
|
110
167
|
},
|
|
111
168
|
// iOS-only. Keep the AVAudioEngine mic-input (voice-processing) chain
|
|
112
169
|
// prepared while muted so the engine stays full-duplex and remote audio
|
|
@@ -120,9 +177,9 @@ const streamRNVideoSDKGlobals = {
|
|
|
120
177
|
if (enabled) {
|
|
121
178
|
// Mute via the voice-processing unit (it's the default, fail safe config here) so the input chain
|
|
122
179
|
// stays built while muted, rather than tearing the engine down.
|
|
123
|
-
|
|
180
|
+
StreamInCallManagerNativeModule.setMuteMode(_reactNativeWebrtc.AudioEngineMuteMode.VoiceProcessing);
|
|
124
181
|
}
|
|
125
|
-
|
|
182
|
+
StreamInCallManagerNativeModule.setRecordingAlwaysPreparedMode(enabled);
|
|
126
183
|
}
|
|
127
184
|
},
|
|
128
185
|
permissions: {
|
|
@@ -157,5 +214,6 @@ function registerSDKGlobals() {
|
|
|
157
214
|
if (!globalThis.streamRNVideoSDK) {
|
|
158
215
|
globalThis.streamRNVideoSDK = streamRNVideoSDKGlobals;
|
|
159
216
|
}
|
|
217
|
+
(0, _registerMediaEngine.registerCallMediaEngine)();
|
|
160
218
|
}
|
|
161
219
|
//# sourceMappingURL=registerSDKGlobals.js.map
|