@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
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.onRingNotificationReceived = void 0;
|
|
7
|
+
var _videoClient = require("@stream-io/video-client");
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _libs = require("../libs");
|
|
10
|
+
var _StreamVideoRN = require("../../StreamVideoRN");
|
|
11
|
+
var _constants = require("./constants");
|
|
12
|
+
var _utils = require("./utils");
|
|
13
|
+
/**
|
|
14
|
+
* Handles a Stream Video `call.ring` push payload: connects the WS to watch the ringing call
|
|
15
|
+
* and auto-dismisses it if it has already ended/been handled elsewhere. Non-ringing types are
|
|
16
|
+
* ignored (their display is app responsibility). Android-only; a no-op on other platforms.
|
|
17
|
+
*/
|
|
18
|
+
const onRingNotificationReceived = async data => {
|
|
19
|
+
/* Example data from firebase
|
|
20
|
+
"message": {
|
|
21
|
+
"data": {
|
|
22
|
+
call_cid: 'audio_room:dcc1638c-e90d-4dcb-bf3b-8fa7767bfbb0',
|
|
23
|
+
call_display_name: '',
|
|
24
|
+
created_by_display_name: 'tommaso',
|
|
25
|
+
created_by_id: 'tommaso-03dcddb7-e9e2-42ec-b2f3-5043aac666ee',
|
|
26
|
+
receiver_id: 'martin-21824f17-319b-401b-a61b-fcab646f0d3f',
|
|
27
|
+
sender: 'stream.video',
|
|
28
|
+
type: 'call.live_started',
|
|
29
|
+
version: 'v2'
|
|
30
|
+
},
|
|
31
|
+
// other stuff
|
|
32
|
+
}
|
|
33
|
+
*/
|
|
34
|
+
if (_reactNative.Platform.OS !== 'android') return;
|
|
35
|
+
const nativeLog = (message, level = 'debug') => (0, _libs.getCallingxLibIfAvailable)()?.log(`[callingx - onRingNotificationReceived]: ${message}`, level);
|
|
36
|
+
const pushConfig = _StreamVideoRN.StreamVideoRN.getConfig().push;
|
|
37
|
+
if (!pushConfig || !data || data.sender !== 'stream.video' || data.type !== 'call.ring') {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
const call_cid = data.call_cid;
|
|
41
|
+
const callingx = (0, _libs.getCallingxLib)();
|
|
42
|
+
if (_constants.pushUnsubscriptionCallbacks.has(call_cid)) {
|
|
43
|
+
nativeLog(`call_cid ${call_cid} is already being watched, skipping the duplicate call.ring notification`);
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const asForegroundService = (0, _utils.canListenToWS)();
|
|
47
|
+
const backgroundTaskOwner = `push:${call_cid}`;
|
|
48
|
+
nativeLog(`call.ring for callCid: ${call_cid} asForegroundService=${asForegroundService}`);
|
|
49
|
+
const finishBackgroundTask = () => {
|
|
50
|
+
nativeLog(`Finishing background task for callCid: ${call_cid}`);
|
|
51
|
+
callingx.releaseBackgroundTask(backgroundTaskOwner);
|
|
52
|
+
};
|
|
53
|
+
if (asForegroundService) {
|
|
54
|
+
// initialize the callback array immediately to avoid race condition
|
|
55
|
+
_constants.pushUnsubscriptionCallbacks.set(call_cid, []);
|
|
56
|
+
// The owner is added synchronously inside acquireBackgroundTask (before its own await), so it
|
|
57
|
+
// is registered immediately even though we don't await the returned promise here.
|
|
58
|
+
nativeLog(`acquiring background task for callCid: ${call_cid}`);
|
|
59
|
+
callingx.acquireBackgroundTask(backgroundTaskOwner).catch(e => {
|
|
60
|
+
nativeLog(`Failed to acquire background task for callCid: ${call_cid} error: ${e}`, 'error');
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
let client;
|
|
64
|
+
try {
|
|
65
|
+
client = await pushConfig.createStreamVideoClient();
|
|
66
|
+
if (!client) {
|
|
67
|
+
nativeLog(`video client not found, skipping the call.ring notification`);
|
|
68
|
+
if (asForegroundService) {
|
|
69
|
+
finishBackgroundTask();
|
|
70
|
+
}
|
|
71
|
+
await callingx.stopService();
|
|
72
|
+
_constants.pushUnsubscriptionCallbacks.delete(call_cid);
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
} catch (error) {
|
|
76
|
+
//we need to release the background task and stop the service to avoid stale owner
|
|
77
|
+
nativeLog(`Failed to create video client: ${error}`, 'error');
|
|
78
|
+
if (asForegroundService) {
|
|
79
|
+
finishBackgroundTask();
|
|
80
|
+
}
|
|
81
|
+
await callingx.stopService();
|
|
82
|
+
_constants.pushUnsubscriptionCallbacks.delete(call_cid);
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
if (asForegroundService) {
|
|
86
|
+
// Listen to call events from WS with the keep-alive headless task, bound to the call service.
|
|
87
|
+
(async () => {
|
|
88
|
+
try {
|
|
89
|
+
nativeLog(`onRingingCall (fg service) for callCid: ${call_cid}`);
|
|
90
|
+
const callFromPush = await client.onRingingCall(call_cid);
|
|
91
|
+
const {
|
|
92
|
+
mustEndCall,
|
|
93
|
+
endCallReason
|
|
94
|
+
} = (0, _utils.shouldCallBeClosed)(callFromPush, data);
|
|
95
|
+
if (mustEndCall) {
|
|
96
|
+
nativeLog(`Closing fg service callCid: ${call_cid} endCallReason: ${endCallReason}`);
|
|
97
|
+
callingx.endCallWithReason(call_cid, endCallReason);
|
|
98
|
+
callFromPush.leave({
|
|
99
|
+
reject: false
|
|
100
|
+
}).catch(error => {
|
|
101
|
+
nativeLog(`Failed to leave already-ended ringing call ${call_cid}: ${error}`, 'error');
|
|
102
|
+
});
|
|
103
|
+
finishBackgroundTask();
|
|
104
|
+
_constants.pushUnsubscriptionCallbacks.delete(call_cid);
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// prevent subscriptions in case of call being left and subscriptions being already cleared
|
|
109
|
+
const unsubscribeFunctions = _constants.pushUnsubscriptionCallbacks.get(call_cid);
|
|
110
|
+
if (!unsubscribeFunctions) {
|
|
111
|
+
nativeLog(`ring cancelled during onRingingCall for callCid: ${call_cid}, releasing background task`);
|
|
112
|
+
finishBackgroundTask();
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
nativeLog(`watching WS for ringing callCid: ${call_cid}`);
|
|
116
|
+
// check if service needs to be closed if accept/decline event was done on another device
|
|
117
|
+
const unsubscribe = callFromPush.on('all', event => {
|
|
118
|
+
const _canListenToWS = (0, _utils.canListenToWS)();
|
|
119
|
+
if (!_canListenToWS) {
|
|
120
|
+
nativeLog(`Closing fg service from event ${event.type} callCid: ${call_cid} canListenToWS: ${_canListenToWS}`);
|
|
121
|
+
unsubscribeFunctions.forEach(fn => fn());
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
const {
|
|
125
|
+
mustEndCall: mustEndCallFromEvent,
|
|
126
|
+
endCallReason: endCallReasonFromEvent
|
|
127
|
+
} = (0, _utils.shouldCallBeClosed)(callFromPush, data);
|
|
128
|
+
if (mustEndCallFromEvent) {
|
|
129
|
+
nativeLog(`Closing fg service from event ${event.type} callCid: ${call_cid} shouldCallBeClosed`);
|
|
130
|
+
callingx.endCallWithReason(call_cid, endCallReasonFromEvent);
|
|
131
|
+
unsubscribeFunctions.forEach(fn => fn());
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
// check if service needs to be closed if call was left
|
|
136
|
+
const stateSubscription = callFromPush.state.callingState$.subscribe(callingState => {
|
|
137
|
+
if (callingState === _videoClient.CallingState.IDLE || callingState === _videoClient.CallingState.LEFT) {
|
|
138
|
+
nativeLog(`Closing fg service from callingState callCid: ${call_cid} callingState: ${callingState}`);
|
|
139
|
+
unsubscribeFunctions.forEach(fn => fn());
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
//stop background task when app comes to foreground
|
|
144
|
+
const appStateSubscription = _reactNative.AppState.addEventListener('change', nextAppState => {
|
|
145
|
+
const _canListenToWS = (0, _utils.canListenToWS)();
|
|
146
|
+
nativeLog(`AppState changed to: ${nextAppState} for callCid: ${call_cid} canListenToWS: ${_canListenToWS}`);
|
|
147
|
+
if (!_canListenToWS) {
|
|
148
|
+
unsubscribeFunctions.forEach(fn => fn());
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
unsubscribeFunctions.push(unsubscribe);
|
|
153
|
+
unsubscribeFunctions.push(() => stateSubscription.unsubscribe());
|
|
154
|
+
unsubscribeFunctions.push(() => appStateSubscription.remove());
|
|
155
|
+
unsubscribeFunctions.push(finishBackgroundTask);
|
|
156
|
+
unsubscribeFunctions.push(() => _constants.pushUnsubscriptionCallbacks.delete(call_cid));
|
|
157
|
+
nativeLog(`WS subscriptions registered for callCid: ${call_cid}`);
|
|
158
|
+
} catch (error) {
|
|
159
|
+
nativeLog(`Failed to start background task with callCid: ${call_cid} error: ${error}`, 'error');
|
|
160
|
+
_constants.pushUnsubscriptionCallbacks.delete(call_cid);
|
|
161
|
+
finishBackgroundTask();
|
|
162
|
+
}
|
|
163
|
+
})();
|
|
164
|
+
}
|
|
165
|
+
if (asForegroundService) {
|
|
166
|
+
// no need to check if call has be closed as that will be handled by the fg service
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
nativeLog(`onRingingCall (foreground) for callCid: ${call_cid}`);
|
|
170
|
+
const callFromPush = await client.onRingingCall(call_cid);
|
|
171
|
+
const {
|
|
172
|
+
mustEndCall,
|
|
173
|
+
endCallReason
|
|
174
|
+
} = (0, _utils.shouldCallBeClosed)(callFromPush, data);
|
|
175
|
+
if (mustEndCall) {
|
|
176
|
+
nativeLog(`Removing incoming call notification immediately with callCid: ${call_cid} as it should be closed`);
|
|
177
|
+
callingx.endCallWithReason(call_cid, endCallReason);
|
|
178
|
+
callFromPush.leave({
|
|
179
|
+
reject: false
|
|
180
|
+
}).catch(error => {
|
|
181
|
+
nativeLog(`Failed to leave already-ended ringing call ${call_cid}: ${error}`, 'error');
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
exports.onRingNotificationReceived = onRingNotificationReceived;
|
|
186
|
+
//# sourceMappingURL=android.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_videoClient","require","_reactNative","_libs","_StreamVideoRN","_constants","_utils","onRingNotificationReceived","data","Platform","OS","nativeLog","message","level","getCallingxLibIfAvailable","log","pushConfig","StreamVideoRN","getConfig","push","sender","type","call_cid","callingx","getCallingxLib","pushUnsubscriptionCallbacks","has","asForegroundService","canListenToWS","backgroundTaskOwner","finishBackgroundTask","releaseBackgroundTask","set","acquireBackgroundTask","catch","e","client","createStreamVideoClient","stopService","delete","error","callFromPush","onRingingCall","mustEndCall","endCallReason","shouldCallBeClosed","endCallWithReason","leave","reject","unsubscribeFunctions","get","unsubscribe","on","event","_canListenToWS","forEach","fn","mustEndCallFromEvent","endCallReasonFromEvent","stateSubscription","state","callingState$","subscribe","callingState","CallingState","IDLE","LEFT","appStateSubscription","AppState","addEventListener","nextAppState","remove","exports"],"sourceRoot":"../../../../../src","sources":["utils/push/internal/android.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAMA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAKA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAEA;AACA;AACA;AACA;AACA;AACO,MAAMM,0BAA0B,GAAG,MACxCC,IAAmC,IAChC;EACH;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,IAAIC,qBAAQ,CAACC,EAAE,KAAK,SAAS,EAAE;EAE/B,MAAMC,SAAS,GAAGA,CAChBC,OAAe,EACfC,KAA0C,GAAG,OAAO,KAEpD,IAAAC,+BAAyB,EAAC,CAAC,EAAEC,GAAG,CAC9B,4CAA4CH,OAAO,EAAE,EACrDC,KACF,CAAC;EAEH,MAAMG,UAAU,GAAGC,4BAAa,CAACC,SAAS,CAAC,CAAC,CAACC,IAAI;EACjD,IACE,CAACH,UAAU,IACX,CAACR,IAAI,IACLA,IAAI,CAACY,MAAM,KAAK,cAAc,IAC9BZ,IAAI,CAACa,IAAI,KAAK,WAAW,EACzB;IACA;EACF;EAEA,MAA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AEC,MAAM,EAAE;IAAM,CAAC,CAAC,CAACd,KAAK,CAAEM,KAAK,IAAK;MACrD7B,SAAS,CACP,8CAA8CW,QAAQ,KAAKkB,KAAK,EAAE,EAClE,OACF,CAAC;IACH,CAAC,CAAC;EACJ;AACF,CAAC;AAACgC,OAAA,CAAAjE,0BAAA,GAAAA,0BAAA","ignoreList":[]}
|
|
@@ -4,21 +4,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getFirebaseMessagingLib = getFirebaseMessagingLib;
|
|
7
|
-
exports.getFirebaseMessagingLibNoThrow = getFirebaseMessagingLibNoThrow;
|
|
8
7
|
var _lib = require("./lib");
|
|
9
|
-
var _videoClient = require("@stream-io/video-client");
|
|
10
8
|
const INSTALLATION_INSTRUCTION = 'Please see https://rnfirebase.io/messaging/usage#installation for installation instructions';
|
|
11
|
-
function
|
|
9
|
+
function getFirebaseMessagingModule() {
|
|
12
10
|
if (!_lib.lib) {
|
|
13
11
|
throw Error('@react-native-firebase/messaging is not installed. ' + INSTALLATION_INSTRUCTION);
|
|
14
12
|
}
|
|
15
13
|
return _lib.lib;
|
|
16
14
|
}
|
|
17
|
-
function
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
function getFirebaseMessagingLib() {
|
|
16
|
+
const messagingModule = getFirebaseMessagingModule();
|
|
17
|
+
const messaging = messagingModule.getMessaging();
|
|
18
|
+
return () => ({
|
|
19
|
+
getToken: () => messagingModule.getToken(messaging),
|
|
20
|
+
onTokenRefresh: listener => messagingModule.onTokenRefresh(messaging, listener)
|
|
21
|
+
});
|
|
23
22
|
}
|
|
24
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_lib","require","
|
|
1
|
+
{"version":3,"names":["_lib","require","INSTALLATION_INSTRUCTION","getFirebaseMessagingModule","lib","Error","getFirebaseMessagingLib","messagingModule","messaging","getMessaging","getToken","onTokenRefresh","listener"],"sourceRoot":"../../../../../../src","sources":["utils/push/libs/firebaseMessaging/index.ts"],"mappings":";;;;;;AAAA,IAAAA,IAAA,GAAAC,OAAA;AAEA,MAAMC,wBAAwB,GAC5B,6FAA6F;AAM/F,SAASC,0BAA0BA,CAAA,EAAG;EACpC,IAAI,CAACC,QAAG,EAAE;IACR,MAAMC,KAAK,CACT,qDAAqD,GACnDH,wBACJ,CAAC;EACH;EACA,OAAOE,QAAG;AACZ;AAEO,SAASE,uBAAuBA,CAAA,EAAG;EACxC,MAAMC,eAAe,GAAGJ,0BAA0B,CAAC,CAAC;EACpD,MAAMK,SAAS,GAAGD,eAAe,CAACE,YAAY,CAAC,CAAC;EAChD,OAAO,OAAO;IACZC,QAAQ,EAAEA,CAAA,KAAMH,eAAe,CAACG,QAAQ,CAACF,SAAS,CAAC;IACnDG,cAAc,EAAGC,QAAiC,IAChDL,eAAe,CAACI,cAAc,CAACH,SAAS,EAAEI,QAAQ;EACtD,CAAC,CAAC;AACJ","ignoreList":[]}
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.lib = void 0;
|
|
7
7
|
let lib = exports.lib = void 0;
|
|
8
8
|
try {
|
|
9
|
-
exports.lib = lib = require('@react-native-firebase/messaging')
|
|
9
|
+
exports.lib = lib = require('@react-native-firebase/messaging');
|
|
10
10
|
} catch {}
|
|
11
11
|
|
|
12
12
|
/*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["lib","exports","require"
|
|
1
|
+
{"version":3,"names":["lib","exports","require"],"sourceRoot":"../../../../../../src","sources":["utils/push/libs/firebaseMessaging/lib.ts"],"mappings":";;;;;;AAEA,IAAIA,GAAgC,GAAAC,OAAA,CAAAD,GAAA;AAEpC,IAAI;EACFC,OAAA,CAAAD,GAAA,GAAAA,GAAG,GAAGE,OAAO,CAAC,kCAAkC,CAAC;AACnD,CAAC,CAAC,MAAM,CAAC;;AAIT;AACA;AACA;AACA","ignoreList":[]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.setupAndroidPushEvents = setupAndroidPushEvents;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _videoClient = require("@stream-io/video-client");
|
|
9
|
+
var _libs = require("./libs");
|
|
10
|
+
var _android = require("./internal/android");
|
|
11
|
+
function setupAndroidPushEvents(pushConfig) {
|
|
12
|
+
const logger = _videoClient.videoLoggerSystem.getLogger('setupAndroidPushEvents');
|
|
13
|
+
if (_reactNative.Platform.OS !== 'android' || !pushConfig.android?.pushProviderName) {
|
|
14
|
+
logger.debug(`setupAndroidPushEvents skipped: platform=${_reactNative.Platform.OS} pushProviderName=${pushConfig.android?.pushProviderName}`);
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const callingx = (0, _libs.getCallingxLib)();
|
|
18
|
+
callingx.addEventListener('ringCallPushReceived', params => {
|
|
19
|
+
logger.debug(`ringCallPushReceived event call_cid: ${params?.call_cid}`);
|
|
20
|
+
(0, _android.onRingNotificationReceived)(params).catch(error => {
|
|
21
|
+
logger.error(`Error in onRingNotificationReceived: ${error}`);
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=setupAndroidPushEvents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_videoClient","_libs","_android","setupAndroidPushEvents","pushConfig","logger","videoLoggerSystem","getLogger","Platform","OS","android","pushProviderName","debug","callingx","getCallingxLib","addEventListener","params","call_cid","onRingNotificationReceived","catch","error"],"sourceRoot":"../../../../src","sources":["utils/push/setupAndroidPushEvents.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAEO,SAASI,sBAAsBA,CACpCC,UAAkD,EAClD;EACA,MAAMC,MAAM,GAAGC,8BAAiB,CAACC,SAAS,CAAC,wBAAwB,CAAC;EACpE,IAAIC,qBAAQ,CAACC,EAAE,KAAK,SAAS,IAAI,CAACL,UAAU,CAACM,OAAO,EAAEC,gBAAgB,EAAE;IACtEN,MAAM,CAACO,KAAK,CACV,4CAA4CJ,qBAAQ,CAACC,EAAE,qBAAqBL,UAAU,CAACM,OAAO,EAAEC,gBAAgB,EAClH,CAAC;IACD;EACF;EAEA,MAAME,QAAQ,GAAG,IAAAC,oBAAc,EAAC,CAAC;EACjCD,QAAQ,CAACE,gBAAgB,CAAC,sBAAsB,EAAGC,MAAM,IAAK;IAC5DX,MAAM,CAACO,KAAK,CAAC,wCAAwCI,MAAM,EAAEC,QAAQ,EAAE,CAAC;IACxE,IAAAC,mCAA0B,EAACF,MAAM,CAAC,CAACG,KAAK,CAAEC,KAAK,IAAK;MAClDf,MAAM,CAACe,KAAK,CAAC,wCAAwCA,KAAK,EAAE,CAAC;IAC/D,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ","ignoreList":[]}
|
|
@@ -8,6 +8,7 @@ var _videoClient = require("@stream-io/video-client");
|
|
|
8
8
|
var _utils = require("./internal/utils");
|
|
9
9
|
var _callingx = require("./libs/callingx");
|
|
10
10
|
var _reactNative = require("react-native");
|
|
11
|
+
var _android = require("./internal/android");
|
|
11
12
|
const logger = _videoClient.videoLoggerSystem.getLogger('callingx');
|
|
12
13
|
|
|
13
14
|
/**
|
|
@@ -40,11 +41,10 @@ function setupCallingExpEvents(pushConfig) {
|
|
|
40
41
|
eventName,
|
|
41
42
|
params
|
|
42
43
|
} = event;
|
|
44
|
+
logger.debug(`${eventName} delayed event`);
|
|
43
45
|
if (eventName === 'answerCall') {
|
|
44
|
-
logger.debug(`answerCall delayed event callId: ${params?.callId}`);
|
|
45
46
|
onAcceptCall(pushConfig)(params);
|
|
46
47
|
} else if (eventName === 'endCall') {
|
|
47
|
-
logger.debug(`endCall delayed event callId: ${params?.callId}`);
|
|
48
48
|
onEndCall(pushConfig)(params);
|
|
49
49
|
} else if (eventName === 'didActivateAudioSession') {
|
|
50
50
|
onDidActivateAudioSession();
|
|
@@ -52,6 +52,10 @@ function setupCallingExpEvents(pushConfig) {
|
|
|
52
52
|
onDidDeactivateAudioSession();
|
|
53
53
|
} else if (eventName === 'providerReset') {
|
|
54
54
|
onProviderReset(pushConfig)(params);
|
|
55
|
+
} else if (eventName === 'ringCallPushReceived') {
|
|
56
|
+
(0, _android.onRingNotificationReceived)(params).catch(error => {
|
|
57
|
+
logger.error(`Error in onRingNotificationReceived: ${error}`);
|
|
58
|
+
});
|
|
55
59
|
}
|
|
56
60
|
});
|
|
57
61
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_videoClient","require","_utils","_callingx","_reactNative","logger","videoLoggerSystem","getLogger","setupCallingExpEvents","pushConfig","hasPushProvider","Platform","OS","android","pushProviderName","ios","hasOngoingCalls","enableOngoingCalls","callingx","getCallingxLib","addEventListener","params","onAcceptCall","onEndCall","onDidActivateAudioSession","onDidDeactivateAudioSession","onProviderReset","events","getInitialEvents","forEach","event","eventName","debug","
|
|
1
|
+
{"version":3,"names":["_videoClient","require","_utils","_callingx","_reactNative","_android","logger","videoLoggerSystem","getLogger","setupCallingExpEvents","pushConfig","hasPushProvider","Platform","OS","android","pushProviderName","ios","hasOngoingCalls","enableOngoingCalls","callingx","getCallingxLib","addEventListener","params","onAcceptCall","onEndCall","onDidActivateAudioSession","onDidDeactivateAudioSession","onProviderReset","events","getInitialEvents","forEach","event","eventName","debug","onRingNotificationReceived","catch","error","callCids","join","length","videoClient","createStreamVideoClient","e","cid","call","state","calls","find","c","callingState","CallingState","LEFT","leave","callId","call_cid","source","clearPushWSEventSubscriptions","processCallFromPushInBackground","didFail","fulfillAnswerCallA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AAC,CAAC;EACjC,IAAAoC,oCAA6B,EAACF,QAAQ,CAAC;EACvC,IAAAG,sCAA+B,EAC7B/C,UAAU,EACV4C,QAAQ,EACR,QAAQ,EACPI,OAAO,IAAK;IACXvC,QAAQ,CAACwC,uBAAuB,CAACL,QAAQ,EAAEI,OAAO,CAAC;EACrD,CACF,CAAC;AACH,CAAC;AAEH,MAAMlC,SAAS,GACZd,UAAsB,IACvB,CAAC;EAAE2C,MAAM,EAAEC,QAAQ;EAAEC;AAA+B,CAAC,KAAK;EACxDjD,MAAM,CAAC2B,KAAK,CAAC,6BAA6BqB,QAAQ,YAAYC,MAAM,EAAE,CAAC;EAEvE,IAAIA,MAAM,KAAK,KAAK,IAAI,CAACD,QAAQ,EAAE;IACjC;IACA;EACF;EAEA,MAAMnC,QAAQ,GAAG,IAAAC,wBAAc,EAAC,CAAC;EACjC,IAAAoC,oCAA6B,EAACF,QAAQ,CAAC;EACvC,IAAAG,sCAA+B,EAC7B/C,UAAU,EACV4C,QAAQ,EACR,SAAS,EACRI,OAAO,IAAK;IACXvC,QAAQ,CAACyC,oBAAoB,CAACN,QAAQ,EAAEI,OAAO,CAAC;EAClD,CACF,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -11,18 +11,17 @@ var _libs = require("./libs");
|
|
|
11
11
|
// import { getVoipPushNotificationLib } from './libs';
|
|
12
12
|
|
|
13
13
|
function setupIosVoipPushEvents(pushConfig) {
|
|
14
|
-
if (_reactNative.Platform.OS !== 'ios' || !pushConfig.ios?.pushProviderName) {
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
14
|
const logger = _videoClient.videoLoggerSystem.getLogger('setupIosVoipPushEvents');
|
|
18
|
-
if (!pushConfig.ios
|
|
19
|
-
|
|
20
|
-
logger.debug('ios pushProviderName is not defined, so skipping the setupIosVoipPushEvents');
|
|
15
|
+
if (_reactNative.Platform.OS !== 'ios' || !pushConfig.ios?.pushProviderName) {
|
|
16
|
+
logger.debug(`setupIosVoipPushEvents skipped: platform=${_reactNative.Platform.OS} pushProviderName=${pushConfig.ios?.pushProviderName}`);
|
|
21
17
|
return;
|
|
22
18
|
}
|
|
23
19
|
const callingx = (0, _libs.getCallingxLib)();
|
|
24
20
|
callingx.addEventListener('voipNotificationReceived', params => {
|
|
25
|
-
(
|
|
21
|
+
logger.debug(`voipNotificationReceived event call_cid: ${params?.stream?.call_cid}`);
|
|
22
|
+
(0, _ios.onVoipNotificationReceived)(params, pushConfig).catch(error => {
|
|
23
|
+
logger.error(`Error in onVoipNotificationReceived: ${error}`);
|
|
24
|
+
});
|
|
26
25
|
});
|
|
27
26
|
}
|
|
28
27
|
//# sourceMappingURL=setupIosVoipPushEvents.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_ios","_videoClient","_libs","setupIosVoipPushEvents","pushConfig","
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_ios","_videoClient","_libs","setupIosVoipPushEvents","pushConfig","logger","videoLoggerSystem","getLogger","Platform","OS","ios","pushProviderName","debug","callingx","getCallingxLib","addEventListener","params","stream","call_cid","onVoipNotificationReceived","catch","error"],"sourceRoot":"../../../../src","sources":["utils/push/setupIosVoipPushEvents.ts"],"mappings":";;;;;;AAEA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AAEA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AANA;;AAQO,SAASI,sBAAsBA,CACpCC,UAAkD,EAClD;EACA,MAAMC,MAAM,GAAGC,8BAAiB,CAACC,SAAS,CAAC,wBAAwB,CAAC;EACpE,IAAIC,qBAAQ,CAACC,EAAE,KAAK,KAAK,IAAI,CAACL,UAAU,CAACM,GAAG,EAAEC,gBAAgB,EAAE;IAC9DN,MAAM,CAACO,KAAK,CACV,4CAA4CJ,qBAAQ,CAACC,EAAE,qBAAqBL,UAAU,CAACM,GAAG,EAAEC,gBAAgB,EAC9G,CAAC;IACD;EACF;EAEA,MAAME,QAAQ,GAAG,IAAAC,oBAAc,EAAC,CAAC;EACjCD,QAAQ,CAACE,gBAAgB,CAAC,0BAA0B,EAAGC,MAAM,IAAK;IAChEX,MAAM,CAACO,KAAK,CACV,4CAA4CI,MAAM,EAAEC,MAAM,EAAEC,QAAQ,EACtE,CAAC;IACD,IAAAC,+BAA0B,EAACH,MAAM,EAAEZ,UAAU,CAAC,CAACgB,KAAK,CAAEC,KAAK,IAAK;MAC9DhB,MAAM,CAACgB,KAAK,CAAC,wCAAwCA,KAAK,EAAE,CAAC;IAC/D,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isFirebaseStreamVideoMessage","message","data","sender"],"sourceRoot":"../../../../src","sources":["utils/push/utils.ts"],"mappings":";;;;;;AAWO,SAASA,4BAA4BA,
|
|
1
|
+
{"version":3,"names":["isFirebaseStreamVideoMessage","message","data","sender"],"sourceRoot":"../../../../src","sources":["utils/push/utils.ts"],"mappings":";;;;;;AAWO,SAASA,4BAA4BA,CAACC,OAA8B,EAAE;EAC3E,OAAOA,OAAO,CAACC,IAAI,EAAEC,MAAM,KAAK,cAAc;AAChD","ignoreList":[]}
|
package/dist/commonjs/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useEffect","useMemo","useRef","Animated","Easing","Pressable","StyleSheet","useCall","videoLoggerSystem","ComponentTestIds","useTheme","defaultEmojiReactions","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","ReactionsPicker","supportedReactions","reactionsButtonLayoutRectangle","onRequestedClose","theme","colors","reactionsPicker","variants","styles","useStyles","call","size","width","reactionItemSize","popupHeight","spacingSizes","xs","length","reactionsPopupStyle","top","y","left","x","height","borderTopStartRadius","borderTopEndRadius","elasticAnimRef","Value","timing","current","toValue","duration","useNativeDriver","easing","elastic","start","reactionItemStyle","borderRadius","reactionsButtonDimmerStyle","reactionsButtonDimmer","onClose","reaction","sendReaction","catch","e","logger","getLogger","error","linear","children","testID","REACTIONS_PICKER","style","reactionsPopup","backgroundColor","sheetSecondary","onPress","map","supportedReaction","reactionItem","buttonSecondary","type","custom","emoji_code","Text","reactionText","transform","scaleY","scaleX","icon","create","position","alignItems","paddingTop","opacity","justifyContent","marginBottom","fontSize"],"sourceRoot":"../../../../../../src","sources":["components/Call/CallControls/internal/ReactionsPicker.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,OAAO,EAAEC,MAAM,QAAQ,OAAO;AACzD,SACEC,QAAQ,EACRC,MAAM,EAENC,SAAS,EACTC,UAAU,QACL,cAAc;AACrB,SAASC,OAAO,QAAQ,iCAAiC;AACzD,SAEEC,iBAAiB,QACZ,yBAAyB;AAChC,SAASC,gBAAgB,QAAQ,+BAA+B;AAChE,SAASC,QAAQ,QAAQ,mCAAmC;AAE5D,SAASC,qBAAqB,QAAQ,uBAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAO9D,OAAO,MAAMC,eAAe,GAAGA,CAAC;EAC9BC,kBAAkB,GAAGR,qBAAqB;EAC1CS,8BAA8B;EAC9BC;AACmB,CAAC,KAAK;EACzB,MAAM;IACJC,KAAK,EAAE;MAAEC,MAAM;MAAEC,eAAe;MAAEC;IAAS;EAC7C,CAAC,GAAGf,QAAQ,CAAC,CAAC;EACd,MAAMgB,MAAM,GAAGC,SAAS,CAAC,CAAC;EAC1B,MAAMC,IAAI,GAAGrB,OAAO,CAAC,CAAC;EACtB,MAAMsB,IAAI,GAAGT,8BAA8B,EAAEU,KAAK,IAAI,CAAC;EACvD,MAAMC,gBAAgB,GAAGF,IAAI,GAAG,GAAG;EAEnC,MAAMG,WAAW;EACf;EACAP,QAAQ,CAACQ,YAAY,CAACC,EAAE;EACxB;EACAT,QAAQ,CAACQ,YAAY,CAACC,EAAE,GAAGf,kBAAkB,CAACg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Easing","Pressable","StyleSheet","useCall","videoLoggerSystem","ComponentTestIds","useTheme","defaultEmojiReactions","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","ReactionsPicker","supportedReactions","reactionsButtonLayoutRectangle","onRequestedClose","theme","colors","reactionsPicker","variants","styles","useStyles","call","size","width","reactionItemSize","popupHeight","spacingSizes","xs","length","reactionsPopupStyle","top","y","left","x","height","borderTopStartRadius","borderTopEndRadius","elasticAnimRef","Value","timing","current","toValue","duration","useNativeDriver","easing","elastic","start","reactionItemStyle","borderRadius","reactionsButtonDimmerStyle","reactionsButtonDimmer","onClose","reaction","sendReaction","catch","e","logger","getLogger","error","linear","children","testID","REACTIONS_PICKER","style","reactionsPopup","backgroundColor","sheetSecondary","onPress","map","supportedReaction","reactionItem","buttonSecondary","type","custom","emoji_code","Text","reactionText","transform","scaleY","scaleX","icon","create","position","alignItems","paddingTop","opacity","justifyContent","marginBottom","fontSize"],"sourceRoot":"../../../../../../src","sources":["components/Call/CallControls/internal/ReactionsPicker.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,OAAO,EAAEC,MAAM,QAAQ,OAAO;AACzD,SACEC,QAAQ,EACRC,MAAM,EAENC,SAAS,EACTC,UAAU,QACL,cAAc;AACrB,SAASC,OAAO,QAAQ,iCAAiC;AACzD,SAEEC,iBAAiB,QACZ,yBAAyB;AAChC,SAASC,gBAAgB,QAAQ,+BAA+B;AAChE,SAASC,QAAQ,QAAQ,mCAAmC;AAE5D,SAASC,qBAAqB,QAAQ,uBAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAO9D,OAAO,MAAMC,eAAe,GAAGA,CAAC;EAC9BC,kBAAkB,GAAGR,qBAAqB;EAC1CS,8BAA8B;EAC9BC;AACmB,CAAC,KAAK;EACzB,MAAM;IACJC,KAAK,EAAE;MAAEC,MAAM;MAAEC,eAAe;MAAEC;IAAS;E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AE,QAAQ;MACpBC,UAAU,EAAErE,KAAK,CAACG,QAAQ,CAACQ,YAAY,CAACC;IAC1C,CAAC;IACDuB,qBAAqB,EAAE;MACrBgC,QAAQ,EAAE,UAAU;MACpBG,OAAO,EAAE;IACX,CAAC;IACDf,YAAY,EAAE;MACZa,UAAU,EAAE,QAAQ;MACpBG,cAAc,EAAE,QAAQ;MACxBC,YAAY,EAAExE,KAAK,CAACG,QAAQ,CAACQ,YAAY,CAACC;IAC5C,CAAC;IACDiD,YAAY,EAAE;MACZY,QAAQ,EAAE;IACZ;EACF,CAAC,CAAC,EACJ,CAACzE,KAAK,CACR,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -4,8 +4,8 @@ import React, { useMemo } from 'react';
|
|
|
4
4
|
import { StyleSheet, Text, View } from 'react-native';
|
|
5
5
|
import { useCallStateHooks, useConnectedUser, useI18n } from '@stream-io/video-react-bindings';
|
|
6
6
|
import { Avatar } from '../../utility/Avatar';
|
|
7
|
-
import { RTCView } from '@stream-io/react-native-webrtc';
|
|
8
7
|
import { LobbyControls as DefaultLobbyControls } from '../CallControls/LobbyControls';
|
|
8
|
+
import { LobbyCameraPreview } from './LobbyCameraPreview';
|
|
9
9
|
import { JoinCallButton as DefaultJoinCallButton } from './JoinCallButton';
|
|
10
10
|
import { useTheme } from '../../../contexts/ThemeContext';
|
|
11
11
|
import { LobbyFooter as DefaultLobbyFooter } from './LobbyFooter';
|
|
@@ -40,13 +40,11 @@ export const Lobby = ({
|
|
|
40
40
|
const callSettings = useCallSettings();
|
|
41
41
|
const isVideoEnabledInCall = callSettings?.video.enabled;
|
|
42
42
|
const {
|
|
43
|
-
|
|
44
|
-
mediaStream
|
|
43
|
+
optimisticIsMute: cameraIsMuted
|
|
45
44
|
} = useCameraState();
|
|
46
45
|
const {
|
|
47
46
|
t
|
|
48
47
|
} = useI18n();
|
|
49
|
-
const localVideoStream = mediaStream;
|
|
50
48
|
const connectedUserAsParticipant = useMemo(() => ({
|
|
51
49
|
userId: connectedUser?.id,
|
|
52
50
|
image: connectedUser?.image,
|
|
@@ -67,11 +65,8 @@ export const Lobby = ({
|
|
|
67
65
|
}, lobby.videoContainer],
|
|
68
66
|
children: [/*#__PURE__*/_jsx(View, {
|
|
69
67
|
style: styles.topView
|
|
70
|
-
}), !cameraIsMuted
|
|
71
|
-
|
|
72
|
-
streamURL: localVideoStream.toURL(),
|
|
73
|
-
objectFit: "cover",
|
|
74
|
-
style: StyleSheet.absoluteFill
|
|
68
|
+
}), !cameraIsMuted ? /*#__PURE__*/_jsx(LobbyCameraPreview, {
|
|
69
|
+
objectFit: "cover"
|
|
75
70
|
}) : /*#__PURE__*/_jsx(View, {
|
|
76
71
|
style: [styles.avatarContainer, lobby.avatarContainer],
|
|
77
72
|
children: /*#__PURE__*/_jsx(Avatar, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useMemo","StyleSheet","Text","View","useCallStateHooks","useConnectedUser","useI18n","Avatar","
|
|
1
|
+
{"version":3,"names":["React","useMemo","StyleSheet","Text","View","useCallStateHooks","useConnectedUser","useI18n","Avatar","LobbyControls","DefaultLobbyControls","LobbyCameraPreview","JoinCallButton","DefaultJoinCallButton","useTheme","LobbyFooter","DefaultLobbyFooter","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","Lobby","onJoinCallHandler","landscape","theme","colors","lobby","typefaces","styles","useStyles","connectedUser","useCameraState","useCallSettings","callSettings","isVideoEnabledInCall","video","enabled","optimisticIsMute","cameraIsMuted","t","connectedUserAsParticipant","userId","id","image","name","style","container","children","heading","heading5","subHeading","videoContainer","backgroundColor","sheetTertiary","topView","objectFit","avatarContainer","participant","ParticipantStatus","participantLabel","participantStatusContainer","sheetOverlay","userNameLabel","color","textPrimary","caption","numberOfLines","create","textAlign","paddingBottom","variants","spacingSizes","xs","md","textSecondary","flex","justifyContent","sheetPrimary","paddingRight","insets","right","sm","paddingLeft","left","paddingTop","top","bottom","height","borderRadius","borderRadiusSizes","alignItems","overflow","alignSelf","flexDirection","padding","borderTopRightRadius","flexShrink"],"sourceRoot":"../../../../../src","sources":["components/Call/Lobby/Lobby.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAwBC,OAAO,QAAQ,OAAO;AAC1D,SAASC,UAAU,EAAEC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AACrD,SACEC,iBAAiB,EACjBC,gBAAgB,EAChBC,OAAO,QACF,iCAAiC;AACxC,SAASC,MAAM,QAAQ,sBAAsB;AAE7C,SAASC,aAAa,IAAIC,oBAAoB,QAAQ,+BAA+B;AACrF,SAASC,kBAAkB,QAAQ,sBAAsB;AACzD,SACEC,cAAc,IAAIC,qBAAqB,QAElC,kBAAkB;AACzB,SAASC,QAAQ,QAAQ,gCAAgC;AACzD,SACEC,WAAW,IAAIC,kBAAkB,QAE5B,eAAe;;AAEtB;AACA;AACA;AAFA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AA2BA;AACA;AACA;AACA,OAAO,MAAMC,KAAK,GAAGA,CAAC;EACpBC,iBAAiB;EACjBf,aAAa,GAAGC,oBAAoB;EACpCE,cAAc,GAAGC,qBAAqB;EACtCY,SAAS,GAAG,KAAK;EACjBV,WAAW,GAAGC;AACJ,CAAC,KAAK;EAChB,MAAM;IACJU,KAAK,EAAE;MAAEC,MAAM;MAAEC,KAAK;MAAEC;IAAU;EACpC,CAAC,GAAGf,QAAQ,CAAC,CAAC;EACd,MAAMgB,MAAM,GAAGC,SAAS,CAACN,SAAS,CAAC;EACnC,MAAMO,aAAa,GAAG1B,gBAAgB,CAAC,CAAC;EACxC,MAAM;IAAE2B,cAAc;IAAEC;EAAgB,CAAC,GAAG7B,iBAAiB,CAAC,CAAC;EAC/D,MAAM8B,YAAY,GAAGD,eAAe,CAAC,CAAC;EACtC,MAAME,oBAAoB,GAAGD,YAAY,EAAEE,KAAK,CAACC,OAAO;EACxD,MAAM;IAAEC,gBAAgB,EA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,CAAChB,EAAE;MACjDG,cAAc,EAAE,eAAe;MAC/Bc,UAAU,EAAE,QAAQ;MACpBC,QAAQ,EAAE;IACZ,CAAC;IACDrC,OAAO,EAAE,CAAC,CAAC;IACXM,0BAA0B,EAAE;MAC1BgC,SAAS,EAAE,YAAY;MACvBC,aAAa,EAAE,KAAK;MACpBH,UAAU,EAAE,QAAQ;MACpBI,OAAO,EAAEtE,KAAK,CAAC8C,QAAQ,CAACC,YAAY,CAACU,EAAE;MACvCc,oBAAoB,EAAEvE,KAAK,CAAC8C,QAAQ,CAACmB,iBAAiB,CAACR;IACzD,CAAC;IACDzB,eAAe,EAAE;MACfmB,IAAI,EAAE,CAAC;MACPC,cAAc,EAAE;IAClB,CAAC;IACDd,aAAa,EAAE;MACbkC,UAAU,EAAE;IACd;EACF,CAAC,CAAC,EACJ,CAACxE,KAAK,EAAED,SAAS,CACnB,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { useEffect, useState } from 'react';
|
|
4
|
+
import { Platform, StyleSheet } from 'react-native';
|
|
5
|
+
import { permissions, RTCCameraPreviewView } from '@stream-io/react-native-webrtc';
|
|
6
|
+
import { useCallStateHooks } from '@stream-io/video-react-bindings';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Props for the {@link LobbyCameraPreview} component.
|
|
10
|
+
*/
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
/**
|
|
13
|
+
* The lobby runs before the call is joined. This component drives the native
|
|
14
|
+
* camera capturer directly via {@link RTCCameraPreviewView} which requires
|
|
15
|
+
* no track/peer connection factory to be created.
|
|
16
|
+
*
|
|
17
|
+
* It is driven by the *intended* camera state (optimistic): the lobby camera
|
|
18
|
+
* toggle only updates `optimisticStatus`; the real WebRTC track is acquired and
|
|
19
|
+
* published at join.
|
|
20
|
+
*/
|
|
21
|
+
export const LobbyCameraPreview = ({
|
|
22
|
+
style,
|
|
23
|
+
objectFit = 'cover'
|
|
24
|
+
}) => {
|
|
25
|
+
const {
|
|
26
|
+
useCameraState,
|
|
27
|
+
useCallSettings
|
|
28
|
+
} = useCallStateHooks();
|
|
29
|
+
const {
|
|
30
|
+
optimisticIsMute,
|
|
31
|
+
direction,
|
|
32
|
+
selectedDevice
|
|
33
|
+
} = useCameraState();
|
|
34
|
+
const settings = useCallSettings();
|
|
35
|
+
const wantsCamera = !optimisticIsMute;
|
|
36
|
+
const hasCameraPermission = useEnsureCameraPermission(wantsCamera);
|
|
37
|
+
const facing = direction === 'back' ? 'back' : 'front';
|
|
38
|
+
|
|
39
|
+
// Capture at the call's target resolution so the running preview capturer matches
|
|
40
|
+
// what the track publishes and can be adopted at join without reconfiguring.
|
|
41
|
+
// Normalize to landscape, matching CameraManager.selectTargetResolution.
|
|
42
|
+
const targetResolution = settings?.video.target_resolution;
|
|
43
|
+
let captureWidth = targetResolution?.width ?? 1280;
|
|
44
|
+
let captureHeight = targetResolution?.height ?? 720;
|
|
45
|
+
if (captureWidth < captureHeight) {
|
|
46
|
+
[captureWidth, captureHeight] = [captureHeight, captureWidth];
|
|
47
|
+
}
|
|
48
|
+
return /*#__PURE__*/_jsx(RTCCameraPreviewView, {
|
|
49
|
+
style: [StyleSheet.absoluteFill, style],
|
|
50
|
+
isActive: wantsCamera && hasCameraPermission,
|
|
51
|
+
facing: facing,
|
|
52
|
+
deviceId: selectedDevice,
|
|
53
|
+
mirror: Platform.OS === 'ios' ? true : facing === 'front',
|
|
54
|
+
objectFit: objectFit,
|
|
55
|
+
captureWidth: captureWidth,
|
|
56
|
+
captureHeight: captureHeight
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
const useEnsureCameraPermission = enabled => {
|
|
60
|
+
const [granted, setGranted] = useState(false);
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
if (!enabled || granted) return;
|
|
63
|
+
let cancelled = false;
|
|
64
|
+
(async () => {
|
|
65
|
+
try {
|
|
66
|
+
const status = await permissions.query({
|
|
67
|
+
name: 'camera'
|
|
68
|
+
});
|
|
69
|
+
if (status === 'granted') {
|
|
70
|
+
if (!cancelled) setGranted(true);
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
const result = await permissions.request({
|
|
74
|
+
name: 'camera'
|
|
75
|
+
});
|
|
76
|
+
if (!cancelled) setGranted(!!result);
|
|
77
|
+
} catch {
|
|
78
|
+
if (!cancelled) setGranted(false);
|
|
79
|
+
}
|
|
80
|
+
})();
|
|
81
|
+
return () => {
|
|
82
|
+
cancelled = true;
|
|
83
|
+
};
|
|
84
|
+
}, [enabled, granted]);
|
|
85
|
+
return granted;
|
|
86
|
+
};
|
|
87
|
+
//# sourceMappingURL=LobbyCameraPreview.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useEffect","useState","Platform","StyleSheet","permissions","RTCCameraPreviewView","useCallStateHooks","jsx","_jsx","LobbyCameraPreview","style","objectFit","useCameraState","useCallSettings","optimisticIsMute","direction","selectedDevice","settings","wantsCamera","hasCameraPermission","useEnsureCameraPermission","facing","targetResolution","video","target_resolution","captureWidth","width","captureHeight","height","absoluteFill","isActive","deviceId","mirror","OS","enabled","granted","setGranted","cancelled","status","query","name","result","request"],"sourceRoot":"../../../../../src","sources":["components/Call/Lobby/LobbyCameraPreview.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAClD,SAASC,QAAQ,EAAEC,UAAU,QAAmB,cAAc;AAC9D,SACEC,WAAW,EACXC,oBAAoB,QACf,gCAAgC;AACvC,SAASC,iBAAiB,QAAQ,iCAAiC;;AAEnE;AACA;AACA;AAFA,SAAAC,GAAA,IAAAC,IAAA;AAgBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,kBAAkB,GAAGA,CAAC;EACjCC,KAAK;EACLC,SAAS,GAAG;AACW,CAAC,KAAK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SAAS,CAAC,MAAM;IACd,IAAI,CAACkC,OAAO,IAAIC,OAAO,EAAE;IAEzB,IAAIE,SAAS,GAAG,KAAK;IACrB,CAAC,YAAY;MACX,IAAI;QACF,MAAMC,MAAM,GAAG,MAAMlC,WAAW,CAACmC,KAAK,CAAC;UAAEC,IAAI,EAAE;QAAS,CAAC,CAAC;QAC1D,IAAIF,MAAM,KAAK,SAAS,EAAE;UACxB,IAAI,CAACD,SAAS,EAAED,UAAU,CAAC,IAAI,CAAC;UAChC;QACF;QACA,MAAMK,MAAM,GAAG,MAAMrC,WAAW,CAACsC,OAAO,CAAC;UAAEF,IAAI,EAAE;QAAS,CAAC,CAAC;QAC5D,IAAI,CAACH,SAAS,EAAED,UAAU,CAAC,CAAC,CAACK,MAAM,CAAC;MACtC,CAAC,CAAC,MAAM;QACN,IAAI,CAACJ,SAAS,EAAED,UAAU,CAAC,KAAK,CAAC;MACnC;IACF,CAAC,EAAE,CAAC;IAEJ,OAAO,MAAM;MACXC,SAAS,GAAG,IAAI;IAClB,CAAC;EACH,CAAC,EAAE,CAACH,OAAO,EAAEC,OAAO,CAAC,CAAC;EAEtB,OAAOA,OAAO;AAChB,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["components/Call/Lobby/index.ts"],"mappings":";;AAAA,cAAc,SAAS;AACvB,cAAc,kBAAkB;AAChC,cAAc,eAAe","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["components/Call/Lobby/index.ts"],"mappings":";;AAAA,cAAc,SAAS;AACvB,cAAc,sBAAsB;AACpC,cAAc,kBAAkB;AAChC,cAAc,eAAe","ignoreList":[]}
|