@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
|
@@ -3,6 +3,16 @@
|
|
|
3
3
|
import React, { createContext, useContext, useMemo } from 'react';
|
|
4
4
|
import { defaultTheme } from '../theme/theme';
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Recursively marks every property of `T` as optional.
|
|
8
|
+
*
|
|
9
|
+
* The `extends object` guard is required, not cosmetic: `Theme` carries a
|
|
10
|
+
* `[component: string]: any` index signature, which the mapped type inherits.
|
|
11
|
+
* Without the guard that index signature becomes `DeepPartial<any>`, an
|
|
12
|
+
* all-object type that no primitive leaf can satisfy, and every theme override
|
|
13
|
+
* fails to typecheck. Guarding short-circuits `any` back to `any`.
|
|
14
|
+
*/
|
|
15
|
+
|
|
6
16
|
/**
|
|
7
17
|
* @deprecated Use StreamThemeInputValue instead.
|
|
8
18
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","createContext","useContext","useMemo","defaultTheme","jsx","_jsx","isObject","value","Array","isArray","merge","target","source","key","sourceValue","undefined","targetValue","mergeThemes","params","style","theme","finalTheme","Object","keys","length","JSON","parse","stringify","DEFAULT_BASE_CONTEXT_VALUE","ThemeContext","StreamTheme","props","children","mergedStyle","modifiedTheme","Provider","ThemeProvider","useTheme","Error"],"sourceRoot":"../../../src","sources":["contexts/ThemeContext.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IACVC,aAAa,EAEbC,UAAU,EACVC,OAAO,QACF,OAAO;AAEd,SAASC,YAAY,QAAoB,gBAAgB;;
|
|
1
|
+
{"version":3,"names":["React","createContext","useContext","useMemo","defaultTheme","jsx","_jsx","isObject","value","Array","isArray","merge","target","source","key","sourceValue","undefined","targetValue","mergeThemes","params","style","theme","finalTheme","Object","keys","length","JSON","parse","stringify","DEFAULT_BASE_CONTEXT_VALUE","ThemeContext","StreamTheme","props","children","mergedStyle","modifiedTheme","Provider","ThemeProvider","useTheme","Error"],"sourceRoot":"../../../src","sources":["contexts/ThemeContext.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IACVC,aAAa,EAEbC,UAAU,EACVC,OAAO,QACF,OAAO;AAEd,SAASC,YAAY,QAAoB,gBAAgB;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAUA;AACA;AACA;AAFA,SAAAC,GAAA,IAAAC,IAAA;AAcA,MAAMC,QAAQ,GAAIC,KAAc,IAC9B,OAAOA,KAAK,KAAK,QAAQ,IAAIA,KAAK,KAAK,IAAI,IAAI,CAACC,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC;AAEtE,MAAMG,KAAK,GAAGA,CACZC,MAAS,EACTC,MAAsB,KACnB;EACH,KAAK,MAAMC,GAAG,IAAID,MAAM,EAAE;IACxB,MAAME,WAAW,GAAGF,MAAM,CAACC,GAAG,CAAC;IAC/B,IAAIC,WAAW,KAAKC,SAAS,EAAE;IAE/B,MAAMC,WAAW,GAAGL,MAAM,CAACE,GAAG,CAAY;IAC1C,IAAIP,QAAQ,CAACQ,WAAW,CAAC,IAAIR,QAAQ,CAACU,WAAW,CAAC,EAAE;MAClDN,KAAK,CAACM,WAAW,EAAEF,WAAmD,CAAC;IACzE,CAAC,MAAM;MACLH,MAAM,CAACE,GAAG,CAAY,GAAGC,WAAyB;IACpD;EACF;AACF,CAAC;AAED,OAAO,MAAMG,WAAW,GAAIC,MAA0B,IAAK;EACzD,MAAM;IAAEC,KAAK;IAAEC;EAAM,CAAC,GAAGF,MAAM;EAC/B,MAAMG,UAAU,GACd,CAACD,KAAK,IAAIE,MAAM,CAACC,IAAI,CAACH,KAAK,CAAC,CAACI,MAAM,KAAK,CAAC,GACrCC,IAAI,CAACC,KAAK,CAACD,IAAI,CAACE,SAAS,CAACxB,YAAY,CAAC,CAAC,GACxCsB,IAAI,CAACC,KAAK,CAACD,IAAI,CAACE,SAAS,CAACP,KAAK,CAAC,CAC5B;EAEV,IAAID,KAAK,EAAE;IACTT,KAAK,CAACW,UAAU,EAAEF,KAAK,CAAC;EAC1B;EAEA,OAAOE,UAAU;AACnB,CAAC;AAED,MAAMO,0BAA0B,GAAG,CAAC,CAAC;AAErC,OAAO,MAAMC,YAAY,gBAAG7B,aAAa,CACvC4B,0BACF,CAAC;AAED,OAAO,MAAME,WAEZ,GAAIC,KAAK,IAAK;EACb,MAAM;IAAEC,QAAQ;IAAEC,WAAW;IAAEd,KAAK;IAAEC;EAAM,CAAC,GAAGW,KAAK;EAErD,MAAMG,aAAa,GAAGhC,OAAO,CAAC,MAAM;IAClC,IAAI+B,WAAW,EAAE;MACf,OAAOA,WAAW;IACpB;IAEA,OAAOhB,WAAW,CAAC;MAAEE,KAAK;MAAEC;IAAM,CAAC,CAAC;EACtC,CAAC,EAAE,CAACa,WAAW,EAAEd,KAAK,EAAEC,KAAK,CAAC,CAAC;EAE/B,oBACEf,IAAA,CAACwB,YAAY,CAACM,QAAQ;IAAC5B,KAAK,EAAE2B,aAAc;IAAAF,QAAA,EACzCA;EAAQ,CACY,CAAC;AAE5B,CAAC;;AAED;AACA;AACA;AACA,OAAO,MAAMI,aAAa,GAAGN,WAAW;AAExC,OAAO,MAAMO,QAAQ,GAAGA,CAAA,KAAM;EAC5B,MAAMjB,KAAK,GAAGnB,UAAU,CAAC4B,YAAY,CAAC;EAEtC,IAAIT,KAAK,KAAKQ,0BAA0B,EAAE;IACxC,MAAM,IAAIU,KAAK,CACb,sOACF,CAAC;EACH;EACA,OAAO;IAAElB;EAAM,CAAC;AAClB,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["hasScreenShare","OwnCapability","videoLoggerSystem","useCall","useCallStateHooks","useEffect","useRef","findNodeHandle","NativeModules","Platform","usePrevious","useIsIosScreenshareBroadcastStarted","screenShareAudioMixingManager","CanDeviceScreenShare","OS","Number","parseInt","Version","split","useScreenShareButton","screenCapturePickerViewiOSRef","onScreenShareStartedHandler","onScreenShareStoppedHandler","onMissingScreenShareStreamPermission","screenShareOptions","call","useLocalParticipant","useCallSettings","useOwnCapabilities","callSettings","ownCapabilities","hasScreenSharingPermissions","includes","SCREENSHARE","isScreenSharingEnabledInCall","screensharing","enabled","screenShareType","type","includeAudio","onScreenShareStartedHandlerRef","current","onScreenShareStoppedHandlerRef","iosScreenShareStartedFromSystem","prevIosScreenShareStartedFromSystem","localParticipant","hasPublishedScreenShare","screenShare","enableScreenShareAudio","enable","disable","onPress","logger","getLogger","info","disableScreenShareAudio","error","warn","startInAppScreenCapture","stopInAppScreenCapture","reactTag","ScreenCapturePickerViewManager","show","undefined"],"sourceRoot":"../../../src","sources":["hooks/useScreenShareButton.ts"],"mappings":";;AAAA,SACEA,cAAc,EACdC,aAAa,EACbC,iBAAiB,QACZ,yBAAyB;AAChC,SAASC,OAAO,EAAEC,iBAAiB,QAAQ,iCAAiC;AAC5E,SAAgBC,SAAS,EAAEC,MAAM,QAAQ,OAAO;AAChD,SAASC,cAAc,EAAEC,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AACtE,SAASC,WAAW,QAAQ,gBAAgB;AAC5C,SAASC,mCAAmC,QAAQ,uCAAuC;AAC3F,SAASC,6BAA6B,QAAQ,oCAAoC;;AAElF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;;
|
|
1
|
+
{"version":3,"names":["hasScreenShare","OwnCapability","videoLoggerSystem","useCall","useCallStateHooks","useEffect","useRef","findNodeHandle","NativeModules","Platform","usePrevious","useIsIosScreenshareBroadcastStarted","screenShareAudioMixingManager","CanDeviceScreenShare","OS","Number","parseInt","Version","split","useScreenShareButton","screenCapturePickerViewiOSRef","onScreenShareStartedHandler","onScreenShareStoppedHandler","onMissingScreenShareStreamPermission","screenShareOptions","call","useLocalParticipant","useCallSettings","useOwnCapabilities","callSettings","ownCapabilities","hasScreenSharingPermissions","includes","SCREENSHARE","isScreenSharingEnabledInCall","screensharing","enabled","screenShareType","type","includeAudio","onScreenShareStartedHandlerRef","current","onScreenShareStoppedHandlerRef","iosScreenShareStartedFromSystem","prevIosScreenShareStartedFromSystem","localParticipant","hasPublishedScreenShare","screenShare","enableScreenShareAudio","enable","disable","onPress","logger","getLogger","info","disableScreenShareAudio","error","warn","startInAppScreenCapture","stopInAppScreenCapture","reactTag","ScreenCapturePickerViewManager","show","undefined"],"sourceRoot":"../../../src","sources":["hooks/useScreenShareButton.ts"],"mappings":";;AAAA,SACEA,cAAc,EACdC,aAAa,EACbC,iBAAiB,QACZ,yBAAyB;AAChC,SAASC,OAAO,EAAEC,iBAAiB,QAAQ,iCAAiC;AAC5E,SAAgBC,SAAS,EAAEC,MAAM,QAAQ,OAAO;AAChD,SAASC,cAAc,EAAEC,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AACtE,SAASC,WAAW,QAAQ,gBAAgB;AAC5C,SAASC,mCAAmC,QAAQ,uCAAuC;AAC3F,SAASC,6BAA6B,QAAQ,oCAAoC;;AAElF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;;AAsBA;AACA,MAAMC,oBAAoB,GACvBJ,QAAQ,CAACK,EAAE,KAAK,KAAK,IACpBC,MAAM,CAACC,QAAQ,CAACP,QAAQ,CAACQ,OAAO,EAAEC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE,EAAE,CAAC,IAAI,EAAE,IACnET,QAAQ,CAACK,EAAE,KAAK,SAAS;AAE3B,OAAO,MAAMK,oBAAoB,GAAGA,CAKlCC,6BAA0D,EAK1DC,2BAAwC,EAKxCC,2BAAwC,EAKxCC,oCAAiD,EAIjDC,kBAAuC,KACpC;EACH,MAAMC,IAAI,GAAGtB,OAAO,CAAC,CAAC;EACtB,MAAM;IAAEuB,mBAAmB;IAAEC,eAAe;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AAiB,CAACmD,SAAS,CAAC,sBAAsB,CAAC;UAClED,MAAM,CAACK,IAAI,CAAC,uCAAuC,EAAED,KAAK,CAAC;QAC7D;MACF,CAAC,MAAM,IAAI/C,QAAQ,CAACK,EAAE,KAAK,KAAK,EAAE;QAChC;QACA,MAAM8C,QAAQ,GAAGrD,cAAc,CAACa,6BAA6B,CAACqB,OAAO,CAAC;QACtE,MAAMjC,aAAa,CAACqD,8BAA8B,CAACC,IAAI,CAACF,QAAQ,CAAC;QACjE;QACA;MACF,CAAC,MAAM;QACL;QACA,IAAI;UACF,MAAMnC,IAAI,EAAEsB,WAAW,CAACE,MAAM,CAAC,CAAC;UAChC5B,2BAA2B,GAAG,CAAC;QACjC,CAAC,CAAC,OAAOmC,KAAK,EAAE;UACd;UACA,MAAMJ,MAAM,GAAGlD,iBAAiB,CAACmD,SAAS,CAAC,sBAAsB,CAAC;UAClED,MAAM,CAACE,IAAI,CACT,mEAAmE,EACnEE,KACF,CAAC;QACH;MACF;IACF,CAAC,MAAM,IAAIV,uBAAuB,EAAE;MAClCxB,2BAA2B,GAAG,CAAC;MAC/B;MACA,IAAIb,QAAQ,CAACK,EAAE,KAAK,KAAK,IAAIuB,eAAe,KAAK,OAAO,EAAE;QACxD,MAAMzB,6BAA6B,CAAC+C,sBAAsB,CAAC,CAAC;MAC9D;MACA,MAAMlC,IAAI,EAAEsB,WAAW,CAACG,OAAO,CAAC,IAAI,CAAC;IACvC;EACF,CAAC;EAED,IAAI,CAAChB,4BAA4B,IAAI,CAACrB,oBAAoB,EAAE;IAC1D,OAAO;MAAEsC,OAAO,EAAEY,SAAS;MAAEjB,uBAAuB,EAAE;IAAM,CAAC;EAC/D;EACA,OAAO;IAAEK,OAAO;IAAEL;EAAwB,CAAC;AAC7C,CAAC","ignoreList":[]}
|
|
@@ -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,QAAQ,uBAAuB;AAEjE,MAAMC,aAAa,GAAGJ,aAAa,CAACK,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,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":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["noiseCancellationLib","require","getNoiseCancellationLibThrowIfNotInstalled","Error","NoiseCancellationWrapper","constructor","getInstance","noiseCancellationInstance","ncLib","NoiseCancellation"],"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;AAET,OAAO,SAASC,0CAA0CA,CAAA,EAAG;EAC3D,IAAI,CAACF,oBAAoB,EAAE;IACzB,MAAMG,KAAK,CACT,mHACF,CAAC;EACH;EACA,OAAOH,oBAAoB;AAC7B;AAEA,OAAO,MAAMI,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"names":["noiseCancellationLib","require","getNoiseCancellationLibThrowIfNotInstalled","Error","NoiseCancellationWrapper","constructor","getInstance","noiseCancellationInstance","ncLib","NoiseCancellation"],"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;AAET,OAAO,SAASC,0CAA0CA,CAAA,EAAG;EAC3D,IAAI,CAACF,oBAAoB,EAAE;IACzB,MAAMG,KAAK,CACT,mHACF,CAAC;EACH;EACA,OAAOH,oBAAoB;AAC7B;AAEA,OAAO,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","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useCall","useEffect","Platform","callManager","getCallingxLibIfAvailable","videoLoggerSystem","AudioInterruptionTracer","call","OS","traceAudioInterruption","event","tracer","trace","phase","getLogger","info","removeInCallManagerListener","ios","addAudioInterruptionListener","callingx","callingxSubscription","addEventListener","remove"],"sourceRoot":"../../../../src","sources":["providers/StreamCall/AudioInterruptionTracer.tsx"],"mappings":";;AAAA,SAASA,OAAO,QAAQ,iCAAiC;AACzD,SAASC,SAAS,QAAQ,OAAO;AACjC,SAASC,QAAQ,QAAQ,cAAc;AACvC,SAASC,WAAW,QAAQ,4BAA4B;AAExD,SAASC,yBAAyB,QAAQ,gCAAgC;AAC1E,SAASC,iBAAiB,QAAQ,yBAAyB;AAS3D;AACA;AACA;AACA,OAAO,MAAMC,uBAAuB,GAAGA,CAAA,KAAM;EAC3C,MAAMC,IAAI,GAAGP,OAAO,CAAC,CAAC;EAEtBC,SAAS,CAAC,MAAM;IACd,IAAIC,QAAQ,CAACM,EAAE,KAAK,KAAK,IAAI,CAACD,IAAI,EAAE;MAClC;IACF;IAEA,MAAME,sBAAsB,GAAIC,KAAgC,IAAK;MACnEH,IAAI,CAACI,MAAM,CAACC,KAAK,CAAC,yBAAyBF,KAAK,CAACG,KAAK,EAAE,EAAEH,KAAK,CAAC;MAChEL,iBAAiB,CACdS,SAAS,CAAC,MAAM,CAAC,CACjBC,IAAI,CAAC,yBAAyBL,KAAK,CAACG,KAAK,EAAE,EAAEH,KAAK,CAAC;IACxD,CAAC;IAED,MAAMM,2BAA2B,GAC/Bb,WAAW,CAACc,GAAG,CAACC,4BAA4B,CAACT,sBAAsB,CAAC;IACtE,MAAMU,QAAQ,GAAGf,yBAAyB,CAAC,
|
|
1
|
+
{"version":3,"names":["useCall","useEffect","Platform","callManager","getCallingxLibIfAvailable","videoLoggerSystem","AudioInterruptionTracer","call","OS","traceAudioInterruption","event","tracer","trace","phase","getLogger","info","removeInCallManagerListener","ios","addAudioInterruptionListener","callingx","callingxSubscription","addEventListener","remove"],"sourceRoot":"../../../../src","sources":["providers/StreamCall/AudioInterruptionTracer.tsx"],"mappings":";;AAAA,SAASA,OAAO,QAAQ,iCAAiC;AACzD,SAASC,SAAS,QAAQ,OAAO;AACjC,SAASC,QAAQ,QAAQ,cAAc;AACvC,SAASC,WAAW,QAAQ,4BAA4B;AAExD,SAASC,yBAAyB,QAAQ,gCAAgC;AAC1E,SAASC,iBAAiB,QAAQ,yBAAyB;AAS3D;AACA;AACA;AACA,OAAO,MAAMC,uBAAuB,GAAGA,CAAA,KAAM;EAC3C,MAAMC,IAAI,GAAGP,OAAO,CAAC,CAAC;EAEtBC,SAAS,CAAC,MAAM;IACd,IAAIC,QAAQ,CAACM,EAAE,KAAK,KAAK,IAAI,CAACD,IAAI,EAAE;MAClC;IACF;IAEA,MAAME,sBAAsB,GAAIC,KAAgC,IAAK;MACnEH,IAAI,CAACI,MAAM,CAACC,KAAK,CAAC,yBAAyBF,KAAK,CAACG,KAAK,EAAE,EAAEH,KAAK,CAAC;MAChEL,iBAAiB,CACdS,SAAS,CAAC,MAAM,CAAC,CACjBC,IAAI,CAAC,yBAAyBL,KAAK,CAACG,KAAK,EAAE,EAAEH,KAAK,CAAC;IACxD,CAAC;IAED,MAAMM,2BAA2B,GAC/Bb,WAAW,CAACc,GAAG,CAACC,4BAA4B,CAACT,sBAAsB,CAAC;IACtE,MAAMU,QAAQ,GAAGf,yBAAyB,CAAC,CACE;IAC7C,MAAMgB,oBAAoB,GAAGD,QAAQ,EAAEE,gBAAgB,CACrD,sBAAsB,EACtBZ,sBACF,CAAC;IAED,OAAO,MAAM;MACXO,2BAA2B,CAAC,CAAC;MAC7BI,oBAAoB,EAAEE,MAAM,CAAC,CAAC;IAChC,CAAC;EACH,CAAC,EAAE,CAACf,IAAI,CAAC,CAAC;EAEV,OAAO,IAAI;AACb,CAAC","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
|
*/
|
|
@@ -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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,CAAC;EACH;AACF;AAEA,OAAO,eAAeqB,2BAA2BA,CAAA,EAAG;EAClD,IAAI,CAAC5D,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,oDAAoD,CAAC;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":[]}
|