@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
|
@@ -6,55 +6,28 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.useLoopbackRecording = useLoopbackRecording;
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
|
-
var _rxjs = require("rxjs");
|
|
10
9
|
var _videoClient = require("@stream-io/video-client");
|
|
11
10
|
var _videoReactBindings = require("@stream-io/video-react-bindings");
|
|
12
11
|
/** @internal */
|
|
13
12
|
const {
|
|
14
13
|
StreamVideoReactNative
|
|
15
14
|
} = _reactNative.NativeModules;
|
|
16
|
-
|
|
17
|
-
// Upper bound on how long `startRecording` will wait for the SFU to
|
|
18
|
-
// echo loopback tracks back via the Subscriber. Tuned generously since
|
|
19
|
-
// this includes connection setup; consumers that want shorter feedback
|
|
20
|
-
// should call `stopRecording` to cancel the wait early.
|
|
21
|
-
const STREAMS_WAIT_TIMEOUT_MS = 10 * 1000;
|
|
22
|
-
const DEFAULT_RECORDING_DURATION = 10 * 1000;
|
|
23
|
-
const MIN_RECORDING_DURATION = 5 * 1000;
|
|
24
|
-
const MAX_RECORDING_DURATION = 2 * 60 * 1000;
|
|
25
|
-
/**
|
|
26
|
-
* Records the SFU loopback streams (audio + video) on the local participant
|
|
27
|
-
* to a local MP4 file. Designed for the `allowOwnTracksLoopback` pre-call test mode:
|
|
28
|
-
* the SFU echoes the caller's published tracks back through the Subscriber
|
|
29
|
-
* peer connection. The hook identifies the loopback streams on the local
|
|
30
|
-
* participant by reference inequality against
|
|
31
|
-
* `call.camera.state.mediaStream` / `call.microphone.state.mediaStream` —
|
|
32
|
-
* the canonical references to the local capture — and captures them.
|
|
33
|
-
*/
|
|
15
|
+
/** Records SFU loopback streams to a local MP4 file. */
|
|
34
16
|
function useLoopbackRecording() {
|
|
35
17
|
const call = (0, _videoReactBindings.useCall)();
|
|
36
18
|
const {
|
|
37
19
|
useCallCallingState,
|
|
38
20
|
useParticipantCount,
|
|
39
|
-
useLocalParticipant
|
|
40
|
-
useCameraState,
|
|
41
|
-
useMicrophoneState
|
|
21
|
+
useLocalParticipant
|
|
42
22
|
} = (0, _videoReactBindings.useCallStateHooks)();
|
|
43
23
|
const callingState = useCallCallingState();
|
|
44
24
|
const participantCount = useParticipantCount();
|
|
45
25
|
const localParticipant = useLocalParticipant();
|
|
46
|
-
const {
|
|
47
|
-
mediaStream: cameraStream
|
|
48
|
-
} = useCameraState();
|
|
49
|
-
const {
|
|
50
|
-
mediaStream: microphoneStream
|
|
51
|
-
} = useMicrophoneState();
|
|
52
26
|
const [recordingState, setRecordingState] = (0, _react.useState)('idle');
|
|
53
27
|
const recordingStateRef = (0, _react.useRef)('idle');
|
|
54
28
|
const isMountedRef = (0, _react.useRef)(true);
|
|
55
|
-
// Used to abort the awaiting-streams wait on stop / leave / unmount.
|
|
56
29
|
const awaitAbortRef = (0, _react.useRef)(null);
|
|
57
|
-
const loopbackStreams = (0, _react.useMemo)(() =>
|
|
30
|
+
const loopbackStreams = (0, _react.useMemo)(() => (0, _videoClient.getLoopbackStreams)(call, localParticipant), [call, localParticipant]);
|
|
58
31
|
const updateState = (0, _react.useCallback)(next => {
|
|
59
32
|
recordingStateRef.current = next;
|
|
60
33
|
if (isMountedRef.current) {
|
|
@@ -80,7 +53,7 @@ function useLoopbackRecording() {
|
|
|
80
53
|
}, []);
|
|
81
54
|
const startRecording = (0, _react.useCallback)(async ({
|
|
82
55
|
includeVideo = true,
|
|
83
|
-
maxDurationMs =
|
|
56
|
+
maxDurationMs = _videoClient.DEFAULT_LOOPBACK_RECORDING_DURATION_MS
|
|
84
57
|
} = {}) => {
|
|
85
58
|
if (!call) {
|
|
86
59
|
return null;
|
|
@@ -95,51 +68,30 @@ function useLoopbackRecording() {
|
|
|
95
68
|
}
|
|
96
69
|
awaitAbortRef.current = new AbortController();
|
|
97
70
|
updateState('awaiting-streams');
|
|
98
|
-
let audioTrack;
|
|
99
71
|
try {
|
|
100
|
-
const streams = await waitForLoopbackStreams(call, {
|
|
72
|
+
const streams = await (0, _videoClient.waitForLoopbackStreams)(call, {
|
|
101
73
|
includeVideo,
|
|
102
74
|
signal: awaitAbortRef.current.signal,
|
|
103
|
-
timeoutMs:
|
|
75
|
+
timeoutMs: _videoClient.LOOPBACK_STREAMS_WAIT_TIMEOUT_MS
|
|
104
76
|
});
|
|
105
77
|
if (streams === null) {
|
|
106
78
|
_videoClient.videoLoggerSystem.getLogger('useLoopbackRecording').warn('timed out waiting for loopback streams');
|
|
107
79
|
return null;
|
|
108
80
|
}
|
|
109
|
-
audioTrack = streams.audioTrack;
|
|
110
|
-
const videoTrackId = streams.videoTrack?.id;
|
|
111
|
-
|
|
112
|
-
// The loopback audio track lands disabled (the SDK default-mutes
|
|
113
|
-
// it to prevent echo). Enable it so the native recording
|
|
114
|
-
// pipeline receives PCM; `finally` returns it to muted.
|
|
115
|
-
if (audioTrack) {
|
|
116
|
-
audioTrack.enabled = true;
|
|
117
|
-
}
|
|
118
81
|
updateState('recording');
|
|
119
|
-
const clampedDuration = Math.min(MAX_RECORDING_DURATION, Math.max(MIN_RECORDING_DURATION, maxDurationMs));
|
|
120
|
-
|
|
121
|
-
// Pre-size the native encoder to the publisher's max video
|
|
122
|
-
// publish-option dimension. Without this, the encoder locks to
|
|
123
|
-
// whatever the SFU happens to echo *first* and stays there for the
|
|
124
|
-
// rest of the recording even after the network improves and
|
|
125
|
-
// higher layers arrive.
|
|
126
82
|
const publishMaxDim = call.getMaxVideoPublishDimension();
|
|
127
83
|
try {
|
|
128
|
-
|
|
129
|
-
videoTrackId,
|
|
130
|
-
maxDurationMs:
|
|
84
|
+
return await (0, _videoClient.withLoopbackAudioEnabled)(streams, () => StreamVideoReactNative.startTrackRecording({
|
|
85
|
+
videoTrackId: streams.videoTrack?.id,
|
|
86
|
+
maxDurationMs: (0, _videoClient.clampLoopbackRecordingDuration)(maxDurationMs),
|
|
131
87
|
targetWidth: publishMaxDim?.width,
|
|
132
88
|
targetHeight: publishMaxDim?.height
|
|
133
|
-
});
|
|
134
|
-
return uri;
|
|
89
|
+
}));
|
|
135
90
|
} catch (error) {
|
|
136
91
|
_videoClient.videoLoggerSystem.getLogger('useLoopbackRecording').error('failed to start recording', error);
|
|
137
92
|
throw new Error('failed to start recording');
|
|
138
93
|
}
|
|
139
94
|
} finally {
|
|
140
|
-
if (audioTrack) {
|
|
141
|
-
audioTrack.enabled = false;
|
|
142
|
-
}
|
|
143
95
|
awaitAbortRef.current = null;
|
|
144
96
|
updateState('idle');
|
|
145
97
|
}
|
|
@@ -161,21 +113,12 @@ function useLoopbackRecording() {
|
|
|
161
113
|
throw new Error('failed to get recordings');
|
|
162
114
|
}
|
|
163
115
|
}, []);
|
|
164
|
-
|
|
165
|
-
// Auto-stop on call leave / end. Aborts an awaiting-streams wait or
|
|
166
|
-
// signals native finalisation depending on which phase we're in.
|
|
167
|
-
// Without this, leaving the call mid-recording would leave native
|
|
168
|
-
// encoders mid-write while the SFU subscriber tracks end under their
|
|
169
|
-
// feet — undefined final file state.
|
|
170
116
|
(0, _react.useEffect)(() => {
|
|
171
117
|
if (callingState === _videoClient.CallingState.LEFT || callingState === _videoClient.CallingState.IDLE) {
|
|
172
118
|
_videoClient.videoLoggerSystem.getLogger('useLoopbackRecording').debug('auto-stopping recording on call leave / end');
|
|
173
119
|
stopRecording().catch(() => {});
|
|
174
120
|
}
|
|
175
121
|
}, [callingState, stopRecording]);
|
|
176
|
-
|
|
177
|
-
// Auto-stop if another participant joins. Loopback recording is a
|
|
178
|
-
// single-user pre-call test.
|
|
179
122
|
(0, _react.useEffect)(() => {
|
|
180
123
|
if (recordingState !== 'idle' && participantCount > 1) {
|
|
181
124
|
stopRecording().catch(() => {});
|
|
@@ -200,64 +143,4 @@ function useLoopbackRecording() {
|
|
|
200
143
|
loopbackAudioStream: loopbackStreams.loopbackAudioStream
|
|
201
144
|
};
|
|
202
145
|
}
|
|
203
|
-
function getLoopbackStreamsFor(participant, cameraStream, microphoneStream) {
|
|
204
|
-
return {
|
|
205
|
-
loopbackVideoStream: participant?.videoStream && participant.videoStream !== cameraStream ? participant.videoStream : undefined,
|
|
206
|
-
loopbackAudioStream: participant?.audioStream && participant.audioStream !== microphoneStream ? participant.audioStream : undefined
|
|
207
|
-
};
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
/**
|
|
211
|
-
* Subscribe to `localParticipant$` and resolve once the requested loopback
|
|
212
|
-
* streams are present on the participant. Aborts cleanly on `signal`
|
|
213
|
-
* (resolves `null`) and rejects on timeout.
|
|
214
|
-
*/
|
|
215
|
-
function waitForLoopbackStreams(call, opts) {
|
|
216
|
-
return new Promise((resolve, reject) => {
|
|
217
|
-
const initial = getLoopbackStreams(call.state.localParticipant, call.camera.state.mediaStream, call.microphone.state.mediaStream, opts.includeVideo);
|
|
218
|
-
if (initial) {
|
|
219
|
-
resolve(initial);
|
|
220
|
-
return;
|
|
221
|
-
}
|
|
222
|
-
const cleanup = () => {
|
|
223
|
-
subscription.unsubscribe();
|
|
224
|
-
if (timeoutId !== undefined) {
|
|
225
|
-
clearTimeout(timeoutId);
|
|
226
|
-
}
|
|
227
|
-
opts.signal.removeEventListener('abort', onAbort);
|
|
228
|
-
};
|
|
229
|
-
const onAbort = () => {
|
|
230
|
-
cleanup();
|
|
231
|
-
resolve(null);
|
|
232
|
-
};
|
|
233
|
-
opts.signal.addEventListener('abort', onAbort);
|
|
234
|
-
const timeoutId = setTimeout(() => {
|
|
235
|
-
cleanup();
|
|
236
|
-
reject(new Error('useLoopbackRecording: timed out waiting for loopback streams. ' + 'Ensure the call was joined with `allowOwnTracksLoopback: true` and ' + 'that the SFU is configured to echo self-sub tracks.'));
|
|
237
|
-
}, opts.timeoutMs);
|
|
238
|
-
const subscription = (0, _rxjs.combineLatest)([call.state.localParticipant$, call.camera.state.mediaStream$, call.microphone.state.mediaStream$]).subscribe(([participant, cameraStream, microphoneStream]) => {
|
|
239
|
-
const ready = getLoopbackStreams(participant, cameraStream, microphoneStream, opts.includeVideo);
|
|
240
|
-
if (ready) {
|
|
241
|
-
cleanup();
|
|
242
|
-
resolve(ready);
|
|
243
|
-
}
|
|
244
|
-
});
|
|
245
|
-
});
|
|
246
|
-
}
|
|
247
|
-
function getLoopbackStreams(participant, cameraStream, microphoneStream, includeVideo) {
|
|
248
|
-
if (!participant) return undefined;
|
|
249
|
-
const {
|
|
250
|
-
loopbackAudioStream,
|
|
251
|
-
loopbackVideoStream
|
|
252
|
-
} = getLoopbackStreamsFor(participant, cameraStream, microphoneStream);
|
|
253
|
-
const audioTrack = loopbackAudioStream?.getAudioTracks()[0];
|
|
254
|
-
const videoTrack = includeVideo ? loopbackVideoStream?.getVideoTracks()[0] : undefined;
|
|
255
|
-
if (!audioTrack || includeVideo && !videoTrack) {
|
|
256
|
-
return undefined;
|
|
257
|
-
}
|
|
258
|
-
return {
|
|
259
|
-
audioTrack,
|
|
260
|
-
videoTrack
|
|
261
|
-
};
|
|
262
|
-
}
|
|
263
146
|
//# sourceMappingURL=useLoopbackRecording.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactNative","
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_videoClient","_videoReactBindings","StreamVideoReactNative","NativeModules","useLoopbackRecording","call","useCall","useCallCallingState","useParticipantCount","useLocalParticipant","useCallStateHooks","callingState","participantCount","localParticipant","recordingState","setRecordingState","useState","recordingStateRef","useRef","isMountedRef","awaitAbortRef","loopbackStreams","useMemo","getLoopbackStreams","updateState","useCallback","next","current","stopRecording","videoLoggerSystem","getLogger","debug","abort","stopTrackRecording","error","Error","startRecording","includeVideo","maxDurationMs","DEFAULT_LOOPBACK_RECORDING_DURATION_MS","warn","state","AbortController","streams","waitForLoopbackStreams","signal","timeoutMs","LOOPBACK_STREAMS_WAIT_TIMEOUT_MS","publishMaxDim","getMaxVideoPublishDimension","withLoopbackAudioEnabled","startTrackRecording","videoTrackId","videoTrack","id","clampLoopbackRecordingDuration","targetWidth","width","targetHeight","height","clearRecordings","clearStreamRecordings","getRecordings","list","getStreamRecordings","useEffect","CallingState","LEFT","IDLE","catch","loopbackVideoStream","loopbackAudioStream"],"sourceRo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;IAC3B,OAAO,MAAM;MACXR,YAAY,CAACQ,OAAO,GAAG,KAAK;MAC5BE,8BAAiB,CACdC,SAAS,CAAC,sBAAsB,CAAC,CACjCC,KAAK,CAAC,oCAAoC,CAAC;MAC9CH,aAAa,CAAC,CAAC,CAACyC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IACjC,CAAC;EACH,CAAC,EAAE,CAACzC,aAAa,CAAC,CAAC;EAEnB,OAAO;IACLQ,cAAc;IACdR,aAAa;IACbgC,eAAe;IACfE,aAAa;IACbhD,cAAc;IACdwD,mBAAmB,EAAEjD,eAAe,CAACiD,mBAAmB;IACxDC,mBAAmB,EAAElD,eAAe,CAACkD;EACvC,CAAC;AACH","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,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AI,CAACF,YAAY,GAAGE,MAAM;IAC1BjF,8BAAiB,CACdC,SAAS,CAAC,aAAa,CAAC,CACxBiF,KAAK,CAAC,mCAAmC,EAAE;MAAED;IAAO,CAAC,CAAC;EAC3D,CAAC;;EAED;AACF;AACA;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":[]}
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.StreamVideoRN = void 0;
|
|
7
7
|
var _pushLogoutCallback = _interopRequireDefault(require("../internal/pushLogoutCallback"));
|
|
8
8
|
var _setupIosVoipPushEvents = require("../push/setupIosVoipPushEvents");
|
|
9
|
+
var _setupAndroidPushEvents = require("../push/setupAndroidPushEvents");
|
|
9
10
|
var _setupCallingExpEvents = require("../push/setupCallingExpEvents");
|
|
10
11
|
var _callingx = require("../push/libs/callingx");
|
|
11
12
|
var _reactNative = require("react-native");
|
|
@@ -108,6 +109,7 @@ class StreamVideoRN {
|
|
|
108
109
|
}
|
|
109
110
|
(0, _setupCallingExpEvents.setupCallingExpEvents)(pushConfig);
|
|
110
111
|
(0, _setupIosVoipPushEvents.setupIosVoipPushEvents)(pushConfig);
|
|
112
|
+
(0, _setupAndroidPushEvents.setupAndroidPushEvents)(pushConfig);
|
|
111
113
|
}
|
|
112
114
|
static getConfig() {
|
|
113
115
|
return this.config;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_pushLogoutCallback","_interopRequireDefault","require","_setupIosVoipPushEvents","_setupCallingExpEvents","_callingx","_reactNative","_videoClient","e","__esModule","default","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","getCallingxLib","videoLoggerSystem","getLogger","info","JSON","stringify","options","extractCallingExpOptions","setup","Error","setupCallingExpEvents","setupIosVoipPushEvents","getConfig","onPushLogout","callbacks","pushLogoutCallbacks","current","resolve","all","map","callback","then","clearPushLogoutCallbacks","playBusyTone","NativeModules","StreamVideoReactNative","stopBusyTone","androidHasAudioOutputHardware","Platform","OS","hasAudioOutputHardware","androidHasMicrophoneHardware","hasMicrophoneHardware","androidHasCameraHardware","hasCameraHardware","exports"],"sourceRoot":"../../../../src","sources":["utils/StreamVideoRN/index.ts"],"mappings":";;;;;;AACA,IAAAA,mBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,uBAAA,GAAAD,OAAA;AACA,IAAAE,
|
|
1
|
+
{"version":3,"names":["_pushLogoutCallback","_interopRequireDefault","require","_setupIosVoipPushEvents","_setupAndroidPushEvents","_setupCallingExpEvents","_callingx","_reactNative","_videoClient","e","__esModule","default","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","getCallingxLib","videoLoggerSystem","getLogger","info","JSON","stringify","options","extractCallingExpOptions","setup","Error","setupCallingExpEvents","setupIosVoipPushEvents","setupAndroidPushEvents","getConfig","onPushLogout","callbacks","pushLogoutCallbacks","current","resolve","all","map","callback","then","clearPushLogoutCallbacks","playBusyTone","NativeModules","StreamVideoReactNative","stopBusyTone","androidHasAudioOutputHardware","Platform","OS","hasAudioOutputHardware","androidHasMicrophoneHardware","hasMicrophoneHardware","androidHasCameraHardware","hasCameraHardware","exports"],"sourceRoot":"../../../../src","sources":["utils/StreamVideoRN/index.ts"],"mappings":";;;;;;AACA,IAAAA,mBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,uBAAA,GAAAD,OAAA;AACA,IAAAE,uBAAA,GAAAF,OAAA;AACA,IAAAG,sBAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AAIA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AAA4D,SAAAD,uBAAAQ,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE5D;;AAKA;AACA,SAASG,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,GAA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,CAACC,EAAE,KAAK,SAAS,EAC3B,MAAM,IAAIrB,KAAK,CACb,oEACF,CAAC;IACH,OAAOgB,0BAAa,CAACC,sBAAsB,CAACO,qBAAqB,CAAC,CAAC;EACrE;;EAEA;AACF;AACA;AACA;EACE,aAAaC,wBAAwBA,CAAA,EAAqB;IACxD,IAAIL,qBAAQ,CAACC,EAAE,KAAK,SAAS,EAC3B,MAAM,IAAIrB,KAAK,CACb,gEACF,CAAC;IACH,OAAOgB,0BAAa,CAACC,sBAAsB,CAACS,iBAAiB,CAAC,CAAC;EACjE;AACF;AAACC,OAAA,CAAA3C,aAAA,GAAAA,aAAA","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
|
*/
|
|
@@ -69,12 +37,12 @@ function getCallDisplayName(callMembers, participants, currentUserId) {
|
|
|
69
37
|
|
|
70
38
|
// if no names are found, we use the name of the current user
|
|
71
39
|
if (names.length === 0) {
|
|
72
|
-
names = [participants.find(participant => participant.userId === currentUserId)?.name
|
|
40
|
+
names = [participants.find(participant => participant.userId === currentUserId)?.name || 'Call'];
|
|
73
41
|
}
|
|
74
42
|
return names.sort().join(', ');
|
|
75
43
|
}
|
|
76
44
|
function getCallDisplayNameFromCall(call) {
|
|
77
|
-
return call.state.custom?.display_name
|
|
45
|
+
return call.state.custom?.display_name || getCallDisplayName(call.state.members, call.state.participants, call.currentUserId);
|
|
78
46
|
}
|
|
79
47
|
async function registerOutgoingCall(call) {
|
|
80
48
|
if (!CallingxModule || !CallingxModule.isSetup || call.isOwnTracksLoopbackAllowed) {
|
|
@@ -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
|