@capgo/capacitor-stream-call 0.0.3 → 0.0.4
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/README.md +1 -0
- package/android/src/main/java/ee/forgr/capacitor/streamcall/CustomNotificationHandler.kt +1 -1
- package/android/src/main/java/ee/forgr/capacitor/streamcall/IncomingCallView.kt +7 -2
- package/android/src/main/java/ee/forgr/capacitor/streamcall/StreamCallPlugin.kt +2 -2
- package/dist/docs.json +7 -0
- package/dist/esm/definitions.d.ts +2 -0
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/web.d.ts +10 -0
- package/dist/esm/web.js +243 -8
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +243 -8
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +243 -8
- package/dist/plugin.js.map +1 -1
- package/ios/Sources/StreamCallPlugin/StreamCallPlugin.swift +256 -24
- package/ios/Sources/StreamCallPlugin/TouchInterceptView.swift +3 -3
- package/package.json +2 -2
package/dist/plugin.cjs.js
CHANGED
|
@@ -12,6 +12,8 @@ class StreamCallWeb extends core.WebPlugin {
|
|
|
12
12
|
super(...arguments);
|
|
13
13
|
this.videoBindings = new Map();
|
|
14
14
|
this.audioBindings = new Map();
|
|
15
|
+
this.participantResponses = new Map();
|
|
16
|
+
this.callMembersExpected = new Map();
|
|
15
17
|
this.ringCallback = (event) => {
|
|
16
18
|
var _a, _b;
|
|
17
19
|
console.log('Call ringing', event, this.currentCall);
|
|
@@ -19,7 +21,10 @@ class StreamCallWeb extends core.WebPlugin {
|
|
|
19
21
|
if (!this.currentCall) {
|
|
20
22
|
console.log('Creating new call', event.call.id);
|
|
21
23
|
this.currentCall = (_a = this.client) === null || _a === void 0 ? void 0 : _a.call(event.call.type, event.call.id);
|
|
24
|
+
// this.currentActiveCallId = this.currentCall?.cid;
|
|
22
25
|
this.notifyListeners('callEvent', { callId: event.call.id, state: videoClient.CallingState.RINGING });
|
|
26
|
+
// Clear previous responses when a new call starts
|
|
27
|
+
this.participantResponses.clear();
|
|
23
28
|
}
|
|
24
29
|
if (this.currentCall) {
|
|
25
30
|
console.log('Call found', this.currentCall.id);
|
|
@@ -28,6 +33,7 @@ class StreamCallWeb extends core.WebPlugin {
|
|
|
28
33
|
console.log('Call state', s);
|
|
29
34
|
if (s === videoClient.CallingState.JOINED) {
|
|
30
35
|
this.setupParticipantListener();
|
|
36
|
+
this.setupCallEventListeners();
|
|
31
37
|
}
|
|
32
38
|
else if (s === videoClient.CallingState.LEFT || s === videoClient.CallingState.RECONNECTING_FAILED) {
|
|
33
39
|
this.cleanupCall();
|
|
@@ -41,11 +47,110 @@ class StreamCallWeb extends core.WebPlugin {
|
|
|
41
47
|
});
|
|
42
48
|
}
|
|
43
49
|
};
|
|
50
|
+
this.callSessionStartedCallback = (event) => {
|
|
51
|
+
console.log('Call created (session started)', event);
|
|
52
|
+
if (event.call && event.call.session && event.call.session.participants) {
|
|
53
|
+
// Store the number of expected participants for this call
|
|
54
|
+
const callCid = event.call.cid;
|
|
55
|
+
const memberCount = event.call.session.participants.length;
|
|
56
|
+
console.log(`Call ${callCid} created with ${memberCount} members`);
|
|
57
|
+
this.callMembersExpected.set(callCid, memberCount);
|
|
58
|
+
// Store call members in callStates
|
|
59
|
+
this.callStates.set(callCid, {
|
|
60
|
+
members: event.call.session.participants.map(p => { var _a; return ({ user_id: ((_a = p.user) === null || _a === void 0 ? void 0 : _a.id) || '' }); }),
|
|
61
|
+
participantResponses: new Map(),
|
|
62
|
+
expectedMemberCount: memberCount,
|
|
63
|
+
createdAt: new Date(),
|
|
64
|
+
});
|
|
65
|
+
// Start a timeout task that runs every second
|
|
66
|
+
const timeoutTask = setInterval(() => this.checkCallTimeout(callCid), 1000);
|
|
67
|
+
// Update the callState with the timeout task
|
|
68
|
+
const callState = this.callStates.get(callCid);
|
|
69
|
+
if (callState) {
|
|
70
|
+
callState.timer = timeoutTask;
|
|
71
|
+
this.callStates.set(callCid, callState);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
this.callRejectedCallback = (event) => {
|
|
76
|
+
console.log('Call rejected', event);
|
|
77
|
+
if (event.user && event.user.id) {
|
|
78
|
+
this.participantResponses.set(event.user.id, 'rejected');
|
|
79
|
+
// Update the combined callStates map
|
|
80
|
+
const callState = this.callStates.get(event.call_cid);
|
|
81
|
+
if (callState) {
|
|
82
|
+
callState.participantResponses.set(event.user.id, 'rejected');
|
|
83
|
+
this.callStates.set(event.call_cid, callState);
|
|
84
|
+
}
|
|
85
|
+
this.notifyListeners('callEvent', {
|
|
86
|
+
callId: event.call_cid,
|
|
87
|
+
state: 'rejected',
|
|
88
|
+
userId: event.user.id
|
|
89
|
+
});
|
|
90
|
+
this.checkAllParticipantsResponded();
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
this.callAcceptedCallback = (event) => {
|
|
94
|
+
console.log('Call accepted', event);
|
|
95
|
+
if (event.user && event.user.id) {
|
|
96
|
+
this.participantResponses.set(event.user.id, 'accepted');
|
|
97
|
+
// Update the combined callStates map
|
|
98
|
+
const callState = this.callStates.get(event.call_cid);
|
|
99
|
+
if (callState) {
|
|
100
|
+
callState.participantResponses.set(event.user.id, 'accepted');
|
|
101
|
+
// If someone accepted, clear the timer as we don't need to check anymore
|
|
102
|
+
if (callState.timer) {
|
|
103
|
+
clearInterval(callState.timer);
|
|
104
|
+
callState.timer = undefined;
|
|
105
|
+
}
|
|
106
|
+
this.callStates.set(event.call_cid, callState);
|
|
107
|
+
}
|
|
108
|
+
this.notifyListeners('callEvent', {
|
|
109
|
+
callId: event.call_cid,
|
|
110
|
+
state: 'accepted',
|
|
111
|
+
userId: event.user.id
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
this.callMissedCallback = (event) => {
|
|
116
|
+
console.log('Call missed', event);
|
|
117
|
+
if (event.user && event.user.id) {
|
|
118
|
+
this.participantResponses.set(event.user.id, 'missed');
|
|
119
|
+
// Update the combined callStates map
|
|
120
|
+
const callState = this.callStates.get(event.call_cid);
|
|
121
|
+
if (callState) {
|
|
122
|
+
callState.participantResponses.set(event.user.id, 'missed');
|
|
123
|
+
this.callStates.set(event.call_cid, callState);
|
|
124
|
+
}
|
|
125
|
+
this.notifyListeners('callEvent', {
|
|
126
|
+
callId: event.call_cid,
|
|
127
|
+
state: 'missed',
|
|
128
|
+
userId: event.user.id
|
|
129
|
+
});
|
|
130
|
+
this.checkAllParticipantsResponded();
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
// Add a combined map for call states, mirroring the iOS implementation
|
|
134
|
+
this.callStates = new Map();
|
|
44
135
|
}
|
|
136
|
+
// private currentActiveCallId?: string;
|
|
45
137
|
setupCallRingListener() {
|
|
46
|
-
var _a, _b;
|
|
138
|
+
var _a, _b, _c, _d;
|
|
47
139
|
(_a = this.client) === null || _a === void 0 ? void 0 : _a.off('call.ring', this.ringCallback);
|
|
48
|
-
(_b = this.client) === null || _b === void 0 ? void 0 : _b.
|
|
140
|
+
(_b = this.client) === null || _b === void 0 ? void 0 : _b.off('call.session_started', this.callSessionStartedCallback);
|
|
141
|
+
(_c = this.client) === null || _c === void 0 ? void 0 : _c.on('call.ring', this.ringCallback);
|
|
142
|
+
(_d = this.client) === null || _d === void 0 ? void 0 : _d.on('call.session_started', this.callSessionStartedCallback);
|
|
143
|
+
}
|
|
144
|
+
setupCallEventListeners() {
|
|
145
|
+
var _a, _b, _c, _d, _e, _f;
|
|
146
|
+
// Clear previous listeners if any
|
|
147
|
+
(_a = this.client) === null || _a === void 0 ? void 0 : _a.off('call.rejected', this.callRejectedCallback);
|
|
148
|
+
(_b = this.client) === null || _b === void 0 ? void 0 : _b.off('call.accepted', this.callAcceptedCallback);
|
|
149
|
+
(_c = this.client) === null || _c === void 0 ? void 0 : _c.off('call.missed', this.callMissedCallback);
|
|
150
|
+
// Register event listeners
|
|
151
|
+
(_d = this.client) === null || _d === void 0 ? void 0 : _d.on('call.rejected', this.callRejectedCallback);
|
|
152
|
+
(_e = this.client) === null || _e === void 0 ? void 0 : _e.on('call.accepted', this.callAcceptedCallback);
|
|
153
|
+
(_f = this.client) === null || _f === void 0 ? void 0 : _f.on('call.missed', this.callMissedCallback);
|
|
49
154
|
}
|
|
50
155
|
setupParticipantListener() {
|
|
51
156
|
// Subscribe to participant changes
|
|
@@ -62,6 +167,7 @@ class StreamCallWeb extends core.WebPlugin {
|
|
|
62
167
|
}
|
|
63
168
|
};
|
|
64
169
|
this.participantLeftListener = (event) => {
|
|
170
|
+
var _a, _b;
|
|
65
171
|
if (this.magicDivId && event.participant) {
|
|
66
172
|
const videoId = `video-${event.participant.sessionId}`;
|
|
67
173
|
const audioId = `audio-${event.participant.sessionId}`;
|
|
@@ -77,10 +183,9 @@ class StreamCallWeb extends core.WebPlugin {
|
|
|
77
183
|
if (tracks) {
|
|
78
184
|
tracks.getTracks().forEach((track) => {
|
|
79
185
|
track.stop();
|
|
80
|
-
track.enabled = false;
|
|
81
186
|
});
|
|
82
|
-
videoEl.srcObject = null;
|
|
83
187
|
}
|
|
188
|
+
videoEl.srcObject = null;
|
|
84
189
|
videoEl.remove();
|
|
85
190
|
}
|
|
86
191
|
// Remove audio element
|
|
@@ -95,13 +200,44 @@ class StreamCallWeb extends core.WebPlugin {
|
|
|
95
200
|
if (tracks) {
|
|
96
201
|
tracks.getTracks().forEach((track) => {
|
|
97
202
|
track.stop();
|
|
98
|
-
track.enabled = false;
|
|
99
203
|
});
|
|
100
|
-
audioEl.srcObject = null;
|
|
101
204
|
}
|
|
205
|
+
audioEl.srcObject = null;
|
|
102
206
|
audioEl.remove();
|
|
103
207
|
}
|
|
104
208
|
}
|
|
209
|
+
// Check if we're the only participant left in the call
|
|
210
|
+
if (this.currentCall && this.currentCall.state.session) {
|
|
211
|
+
// Get the remaining participants count (we need to subtract 1 as we haven't been removed from the list yet)
|
|
212
|
+
const remainingParticipants = this.currentCall.state.session.participants.length - 1;
|
|
213
|
+
// If we're the only one left, end the call
|
|
214
|
+
if (remainingParticipants <= 1) {
|
|
215
|
+
console.log(`We are left solo in a call. Ending. cID: ${this.currentCall.cid}`);
|
|
216
|
+
// End the call
|
|
217
|
+
this.currentCall.leave();
|
|
218
|
+
// Clean up resources
|
|
219
|
+
const callCid = this.currentCall.cid;
|
|
220
|
+
// Invalidate and remove timer
|
|
221
|
+
const callState = (_a = this.callStates) === null || _a === void 0 ? void 0 : _a.get(callCid);
|
|
222
|
+
if (callState === null || callState === void 0 ? void 0 : callState.timer) {
|
|
223
|
+
clearInterval(callState.timer);
|
|
224
|
+
}
|
|
225
|
+
// Remove from callStates
|
|
226
|
+
(_b = this.callStates) === null || _b === void 0 ? void 0 : _b.delete(callCid);
|
|
227
|
+
// Reset the current call
|
|
228
|
+
this.currentCall = undefined;
|
|
229
|
+
// this.currentActiveCallId = undefined;
|
|
230
|
+
// Clean up
|
|
231
|
+
this.cleanupCall();
|
|
232
|
+
console.log(`Cleaned up resources for ended call: ${callCid}`);
|
|
233
|
+
// Notify that the call has ended
|
|
234
|
+
this.notifyListeners('callEvent', {
|
|
235
|
+
callId: callCid,
|
|
236
|
+
state: 'left',
|
|
237
|
+
reason: 'participant_left'
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
}
|
|
105
241
|
};
|
|
106
242
|
this.currentCall.on('participantJoined', this.participantJoinedListener);
|
|
107
243
|
this.currentCall.on('participantLeft', this.participantLeftListener);
|
|
@@ -146,6 +282,101 @@ class StreamCallWeb extends core.WebPlugin {
|
|
|
146
282
|
this.audioBindings.set(id, unbind);
|
|
147
283
|
}
|
|
148
284
|
}
|
|
285
|
+
checkCallTimeout(callCid) {
|
|
286
|
+
const callState = this.callStates.get(callCid);
|
|
287
|
+
if (!callState)
|
|
288
|
+
return;
|
|
289
|
+
// Calculate time elapsed since call creation
|
|
290
|
+
const now = new Date();
|
|
291
|
+
const elapsedSeconds = (now.getTime() - callState.createdAt.getTime()) / 1000;
|
|
292
|
+
// Check if 30 seconds have passed
|
|
293
|
+
if (elapsedSeconds >= 30) {
|
|
294
|
+
console.log(`Call ${callCid} has timed out after ${elapsedSeconds} seconds`);
|
|
295
|
+
// Check if anyone has accepted
|
|
296
|
+
const hasAccepted = Array.from(callState.participantResponses.values())
|
|
297
|
+
.some(response => response === 'accepted');
|
|
298
|
+
if (!hasAccepted) {
|
|
299
|
+
console.log(`No one accepted call ${callCid}, marking all non-responders as missed`);
|
|
300
|
+
// Mark all members who haven't responded as "missed"
|
|
301
|
+
callState.members.forEach(member => {
|
|
302
|
+
if (!callState.participantResponses.has(member.user_id)) {
|
|
303
|
+
callState.participantResponses.set(member.user_id, 'missed');
|
|
304
|
+
this.participantResponses.set(member.user_id, 'missed');
|
|
305
|
+
this.notifyListeners('callEvent', {
|
|
306
|
+
callId: callCid,
|
|
307
|
+
state: 'missed',
|
|
308
|
+
userId: member.user_id
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
});
|
|
312
|
+
// End the call
|
|
313
|
+
if (this.currentCall && this.currentCall.cid === callCid) {
|
|
314
|
+
this.currentCall.leave();
|
|
315
|
+
}
|
|
316
|
+
// Clear the timeout task
|
|
317
|
+
if (callState.timer) {
|
|
318
|
+
clearInterval(callState.timer);
|
|
319
|
+
callState.timer = undefined;
|
|
320
|
+
}
|
|
321
|
+
// Remove from callStates
|
|
322
|
+
this.callStates.delete(callCid);
|
|
323
|
+
// Clean up
|
|
324
|
+
this.cleanupCall();
|
|
325
|
+
// Notify that the call has ended
|
|
326
|
+
this.notifyListeners('callEvent', {
|
|
327
|
+
callId: callCid,
|
|
328
|
+
state: 'ended',
|
|
329
|
+
reason: 'timeout'
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
checkAllParticipantsResponded() {
|
|
335
|
+
if (!this.currentCall)
|
|
336
|
+
return;
|
|
337
|
+
const callCid = this.currentCall.cid;
|
|
338
|
+
const totalParticipants = this.callMembersExpected.get(callCid);
|
|
339
|
+
if (!totalParticipants) {
|
|
340
|
+
console.log(`No expected participant count found for call: ${callCid}`);
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
console.log(`Total expected participants: ${totalParticipants}`);
|
|
344
|
+
// Count rejections and misses
|
|
345
|
+
let rejectedOrMissedCount = 0;
|
|
346
|
+
this.participantResponses.forEach(response => {
|
|
347
|
+
if (response === 'rejected' || response === 'missed') {
|
|
348
|
+
rejectedOrMissedCount++;
|
|
349
|
+
}
|
|
350
|
+
});
|
|
351
|
+
console.log(`Participants responded: ${this.participantResponses.size}/${totalParticipants}`);
|
|
352
|
+
console.log(`Rejected or missed: ${rejectedOrMissedCount}`);
|
|
353
|
+
const allResponded = this.participantResponses.size >= totalParticipants;
|
|
354
|
+
const allRejectedOrMissed = allResponded &&
|
|
355
|
+
Array.from(this.participantResponses.values()).every(response => response === 'rejected' || response === 'missed');
|
|
356
|
+
// If all participants have rejected or missed the call
|
|
357
|
+
if (allResponded && allRejectedOrMissed) {
|
|
358
|
+
console.log('All participants have rejected or missed the call');
|
|
359
|
+
// End the call
|
|
360
|
+
this.currentCall.leave();
|
|
361
|
+
// Clean up the timer if exists in callStates
|
|
362
|
+
const callState = this.callStates.get(callCid);
|
|
363
|
+
if (callState === null || callState === void 0 ? void 0 : callState.timer) {
|
|
364
|
+
clearInterval(callState.timer);
|
|
365
|
+
}
|
|
366
|
+
// Remove from callStates
|
|
367
|
+
this.callStates.delete(callCid);
|
|
368
|
+
// Clear the responses
|
|
369
|
+
this.participantResponses.clear();
|
|
370
|
+
// Clean up
|
|
371
|
+
this.cleanupCall();
|
|
372
|
+
// Notify that the call has ended
|
|
373
|
+
this.notifyListeners('callEvent', {
|
|
374
|
+
callId: callCid,
|
|
375
|
+
state: 'ended',
|
|
376
|
+
reason: 'all_rejected_or_missed'
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
}
|
|
149
380
|
cleanupCall() {
|
|
150
381
|
var _a;
|
|
151
382
|
// First cleanup the call listeners
|
|
@@ -247,10 +478,14 @@ class StreamCallWeb extends core.WebPlugin {
|
|
|
247
478
|
}
|
|
248
479
|
const call = this.client.call(options.type || 'default', crypto.randomUUID());
|
|
249
480
|
const members = options.userIds.map((userId) => ({ user_id: userId }));
|
|
250
|
-
if (this.client.streamClient.userID && options.userIds.includes(this.client.streamClient.userID)) {
|
|
481
|
+
if (this.client.streamClient.userID && !options.userIds.includes(this.client.streamClient.userID)) {
|
|
251
482
|
members.push({ user_id: this.client.streamClient.userID });
|
|
252
483
|
}
|
|
253
484
|
await call.getOrCreate({ data: { members } });
|
|
485
|
+
// Store the expected member count for this call
|
|
486
|
+
// -1, because we don't count the caller themselves
|
|
487
|
+
this.callMembersExpected.set(call.cid, members.length);
|
|
488
|
+
console.log(`Setting expected members for call ${call.cid}: ${members.length}`);
|
|
254
489
|
this.currentCall = call;
|
|
255
490
|
if (options.ring) {
|
|
256
491
|
this.outgoingCall = call.cid;
|
|
@@ -319,7 +554,7 @@ class StreamCallWeb extends core.WebPlugin {
|
|
|
319
554
|
console.log('Rejecting call', this.incomingCall);
|
|
320
555
|
const call = this.client.call(this.incomingCall.type, this.incomingCall.id);
|
|
321
556
|
console.log('Leaving call', call);
|
|
322
|
-
await call.
|
|
557
|
+
await call.reject();
|
|
323
558
|
this.incomingCall = undefined;
|
|
324
559
|
console.log('Rejected call', call);
|
|
325
560
|
this.notifyListeners('callEvent', { callId: call.id, state: videoClient.CallingState.LEFT });
|
package/dist/plugin.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst StreamCall = registerPlugin('StreamCall', {\n web: () => import('./web').then((m) => new m.StreamCallWeb()),\n});\nexport * from './definitions';\nexport { StreamCall };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nimport { CallingState, StreamVideoClient } from '@stream-io/video-client';\nexport class StreamCallWeb extends WebPlugin {\n constructor() {\n super(...arguments);\n this.videoBindings = new Map();\n this.audioBindings = new Map();\n this.ringCallback = (event) => {\n var _a, _b;\n console.log('Call ringing', event, this.currentCall);\n this.incomingCall = event.call;\n if (!this.currentCall) {\n console.log('Creating new call', event.call.id);\n this.currentCall = (_a = this.client) === null || _a === void 0 ? void 0 : _a.call(event.call.type, event.call.id);\n this.notifyListeners('callEvent', { callId: event.call.id, state: CallingState.RINGING });\n }\n if (this.currentCall) {\n console.log('Call found', this.currentCall.id);\n this.callStateSubscription = (_b = this.currentCall) === null || _b === void 0 ? void 0 : _b.state.callingState$.subscribe((s) => {\n var _a;\n console.log('Call state', s);\n if (s === CallingState.JOINED) {\n this.setupParticipantListener();\n }\n else if (s === CallingState.LEFT || s === CallingState.RECONNECTING_FAILED) {\n this.cleanupCall();\n }\n if (this.outgoingCall && s === CallingState.RINGING) {\n this.outgoingCall = undefined;\n }\n else {\n this.notifyListeners('callEvent', { callId: (_a = this.currentCall) === null || _a === void 0 ? void 0 : _a.id, state: s });\n }\n });\n }\n };\n }\n setupCallRingListener() {\n var _a, _b;\n (_a = this.client) === null || _a === void 0 ? void 0 : _a.off('call.ring', this.ringCallback);\n (_b = this.client) === null || _b === void 0 ? void 0 : _b.on('call.ring', this.ringCallback);\n }\n setupParticipantListener() {\n // Subscribe to participant changes\n this.incomingCall = undefined;\n if (!this.currentCall)\n return;\n this.participantJoinedListener = (event) => {\n if (this.magicDivId && event.participant) {\n const magicDiv = document.getElementById(this.magicDivId);\n if (magicDiv && this.currentCall) {\n this.setupParticipantVideo(this.currentCall, event.participant, magicDiv);\n this.setupParticipantAudio(this.currentCall, event.participant, magicDiv);\n }\n }\n };\n this.participantLeftListener = (event) => {\n if (this.magicDivId && event.participant) {\n const videoId = `video-${event.participant.sessionId}`;\n const audioId = `audio-${event.participant.sessionId}`;\n // Remove video element\n const videoEl = document.getElementById(videoId);\n if (videoEl) {\n const unbindVideo = this.videoBindings.get(videoId);\n if (unbindVideo) {\n unbindVideo();\n this.videoBindings.delete(videoId);\n }\n const tracks = videoEl.srcObject;\n if (tracks) {\n tracks.getTracks().forEach((track) => {\n track.stop();\n track.enabled = false;\n });\n videoEl.srcObject = null;\n }\n videoEl.remove();\n }\n // Remove audio element\n const audioEl = document.getElementById(audioId);\n if (audioEl) {\n const unbindAudio = this.audioBindings.get(audioId);\n if (unbindAudio) {\n unbindAudio();\n this.audioBindings.delete(audioId);\n }\n const tracks = audioEl.srcObject;\n if (tracks) {\n tracks.getTracks().forEach((track) => {\n track.stop();\n track.enabled = false;\n });\n audioEl.srcObject = null;\n }\n audioEl.remove();\n }\n }\n };\n this.currentCall.on('participantJoined', this.participantJoinedListener);\n this.currentCall.on('participantLeft', this.participantLeftListener);\n // Setup initial participants\n const participants = this.currentCall.state.participants;\n if (this.magicDivId) {\n const magicDiv = document.getElementById(this.magicDivId);\n if (magicDiv) {\n participants.forEach((participant) => {\n if (this.currentCall) {\n this.setupParticipantVideo(this.currentCall, participant, magicDiv);\n this.setupParticipantAudio(this.currentCall, participant, magicDiv);\n }\n });\n }\n }\n }\n setupParticipantVideo(call, participant, container) {\n const id = `video-${participant.sessionId}`;\n if (!document.getElementById(id)) {\n const videoEl = document.createElement('video');\n videoEl.id = id;\n videoEl.style.width = '100%';\n videoEl.style.maxWidth = '300px';\n videoEl.style.aspectRatio = '16/9';\n container.appendChild(videoEl);\n const unbind = call.bindVideoElement(videoEl, participant.sessionId, 'videoTrack');\n if (unbind)\n this.videoBindings.set(id, unbind);\n }\n }\n setupParticipantAudio(call, participant, container) {\n if (participant.isLocalParticipant)\n return;\n const id = `audio-${participant.sessionId}`;\n if (!document.getElementById(id)) {\n const audioEl = document.createElement('audio');\n audioEl.id = id;\n container.appendChild(audioEl);\n const unbind = call.bindAudioElement(audioEl, participant.sessionId);\n if (unbind)\n this.audioBindings.set(id, unbind);\n }\n }\n cleanupCall() {\n var _a;\n // First cleanup the call listeners\n if (this.currentCall) {\n if (this.participantJoinedListener) {\n this.currentCall.off('participantJoined', this.participantJoinedListener);\n this.participantJoinedListener = undefined;\n }\n if (this.participantLeftListener) {\n this.currentCall.off('participantLeft', this.participantLeftListener);\n this.participantLeftListener = undefined;\n }\n (_a = this.callStateSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();\n }\n if (this.magicDivId) {\n const magicDiv = document.getElementById(this.magicDivId);\n if (magicDiv) {\n // Remove all video elements\n const videoElements = magicDiv.querySelectorAll('video');\n videoElements.forEach((video) => {\n const id = video.id;\n const unbind = this.videoBindings.get(id);\n if (unbind) {\n unbind();\n this.videoBindings.delete(id);\n }\n // Stop all tracks\n const tracks = video.srcObject;\n if (tracks) {\n tracks.getTracks().forEach((track) => {\n track.stop();\n track.enabled = false;\n });\n video.srcObject = null;\n }\n video.remove();\n });\n // Remove all audio elements\n const audioElements = magicDiv.querySelectorAll('audio');\n audioElements.forEach((audio) => {\n const id = audio.id;\n const unbind = this.audioBindings.get(id);\n if (unbind) {\n unbind();\n this.audioBindings.delete(id);\n }\n // Stop all tracks\n const tracks = audio.srcObject;\n if (tracks) {\n tracks.getTracks().forEach((track) => {\n track.stop();\n track.enabled = false;\n });\n audio.srcObject = null;\n }\n audio.remove();\n });\n // Clear the container\n while (magicDiv.firstChild) {\n magicDiv.removeChild(magicDiv.firstChild);\n }\n }\n }\n // Clear all bindings\n this.videoBindings.clear();\n this.audioBindings.clear();\n // Clear call references\n this.currentCall = undefined;\n this.incomingCall = undefined;\n }\n async login(options) {\n this.client = StreamVideoClient.getOrCreateInstance({\n apiKey: options.apiKey,\n user: { id: options.userId, name: options.name, image: options.imageURL },\n token: options.token,\n });\n this.magicDivId = options.magicDivId;\n this.setupCallRingListener();\n return { success: true };\n }\n async logout() {\n var _a;\n if (!this.client) {\n console.log('No client', this.client);\n throw new Error('Client not initialized');\n }\n // Cleanup subscription\n (_a = this.callStateSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();\n this.callStateSubscription = undefined;\n await this.client.disconnectUser();\n this.client = undefined;\n this.currentCall = undefined;\n return { success: true };\n }\n async call(options) {\n if (!this.client) {\n console.log('No client', this.client);\n throw new Error('Client not initialized - Please login first');\n }\n const call = this.client.call(options.type || 'default', crypto.randomUUID());\n const members = options.userIds.map((userId) => ({ user_id: userId }));\n if (this.client.streamClient.userID && options.userIds.includes(this.client.streamClient.userID)) {\n members.push({ user_id: this.client.streamClient.userID });\n }\n await call.getOrCreate({ data: { members } });\n this.currentCall = call;\n if (options.ring) {\n this.outgoingCall = call.cid;\n await call.ring();\n }\n await call.join();\n return { success: true };\n }\n async endCall() {\n if (!this.currentCall) {\n console.log('No active call', this.currentCall);\n throw new Error('No active call');\n }\n await this.currentCall.leave();\n this.currentCall = undefined;\n this.cleanupCall();\n return { success: true };\n }\n async setMicrophoneEnabled(options) {\n if (!this.currentCall) {\n console.log('No active call', this.currentCall);\n throw new Error('No active call');\n }\n if (options.enabled) {\n await this.currentCall.microphone.enable();\n }\n else {\n await this.currentCall.microphone.disable();\n }\n return { success: true };\n }\n async setCameraEnabled(options) {\n if (!this.currentCall) {\n console.log('No active call', this.currentCall);\n throw new Error('No active call');\n }\n if (options.enabled) {\n await this.currentCall.camera.enable();\n }\n else {\n await this.currentCall.camera.disable();\n }\n return { success: true };\n }\n async acceptCall() {\n if (!this.incomingCall || !this.client) {\n console.log('No incoming call to accept', this.incomingCall, this.client);\n throw new Error('No incoming call to accept');\n }\n console.log('Accepting call', this.incomingCall);\n const call = this.client.call(this.incomingCall.type, this.incomingCall.id);\n this.currentCall = call;\n console.log('Joining call', call);\n await call.accept();\n await call.join();\n console.log('Joined call', call);\n this.notifyListeners('callEvent', { callId: call.id, state: CallingState.JOINED });\n this.setupParticipantListener();\n return { success: true };\n }\n async rejectCall() {\n if (!this.incomingCall || !this.client) {\n console.log('No incoming call to reject', this.incomingCall, this.client);\n throw new Error('No incoming call to reject');\n }\n console.log('Rejecting call', this.incomingCall);\n const call = this.client.call(this.incomingCall.type, this.incomingCall.id);\n console.log('Leaving call', call);\n await call.leave();\n this.incomingCall = undefined;\n console.log('Rejected call', call);\n this.notifyListeners('callEvent', { callId: call.id, state: CallingState.LEFT });\n this.cleanupCall();\n return { success: true };\n }\n async isCameraEnabled() {\n if (!this.currentCall) {\n console.log('No active call', this.currentCall);\n throw new Error('No active call');\n }\n const enabled = await this.currentCall.camera.enabled;\n return { enabled };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin","CallingState","StreamVideoClient"],"mappings":";;;;;AACK,MAAC,UAAU,GAAGA,mBAAc,CAAC,YAAY,EAAE;AAChD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,aAAa,EAAE,CAAC;AACjE,CAAC;;ACDM,MAAM,aAAa,SAASC,cAAS,CAAC;AAC7C,IAAI,WAAW,GAAG;AAClB,QAAQ,KAAK,CAAC,GAAG,SAAS,CAAC;AAC3B,QAAQ,IAAI,CAAC,aAAa,GAAG,IAAI,GAAG,EAAE;AACtC,QAAQ,IAAI,CAAC,aAAa,GAAG,IAAI,GAAG,EAAE;AACtC,QAAQ,IAAI,CAAC,YAAY,GAAG,CAAC,KAAK,KAAK;AACvC,YAAY,IAAI,EAAE,EAAE,EAAE;AACtB,YAAY,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC;AAChE,YAAY,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,IAAI;AAC1C,YAAY,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;AACnC,gBAAgB,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;AAC/D,gBAAgB,IAAI,CAAC,WAAW,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC,MAAM,MAAM,IAAI,IAAI,EAAE,KAAK,MAAM,GAAG,MAAM,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI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B,CAAC;AACzD;AACA,QAAQ,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,IAAI,CAAC,YAAY,CAAC;AACxD,QAAQ,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC;AACnF,QAAQ,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,IAAI,CAAC;AACzC,QAAQ,MAAM,IAAI,CAAC,KAAK,EAAE;AAC1B,QAAQ,IAAI,CAAC,YAAY,GAAG,SAAS;AACrC,QAAQ,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,IAAI,CAAC;AAC1C,QAAQ,IAAI,CAAC,eAAe,CAAC,WAAW,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,EAAE,KAAK,EAAEA,wBAAY,CAAC,IAAI,EAAE,CAAC;AACxF,QAAQ,IAAI,CAAC,WAAW,EAAE;AAC1B,QAAQ,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;AAChC;AACA,IAAI,MAAM,eAAe,GAAG;AAC5B,QAAQ,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;AAC/B,YAAY,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,IAAI,CAAC,WAAW,CAAC;AAC3D,YAAY,MAAM,IAAI,KAAK,CAAC,gBAAgB,CAAC;AAC7C;AACA,QAAQ,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO;AAC7D,QAAQ,OAAO,EAAE,OAAO,EAAE;AAC1B;AACA;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst StreamCall = registerPlugin('StreamCall', {\n web: () => import('./web').then((m) => new m.StreamCallWeb()),\n});\nexport * from './definitions';\nexport { StreamCall };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nimport { CallingState, StreamVideoClient } from '@stream-io/video-client';\nexport class StreamCallWeb extends WebPlugin {\n constructor() {\n super(...arguments);\n this.videoBindings = new Map();\n this.audioBindings = new Map();\n this.participantResponses = new Map();\n this.callMembersExpected = new Map();\n this.ringCallback = (event) => {\n var _a, _b;\n console.log('Call ringing', event, this.currentCall);\n this.incomingCall = event.call;\n if (!this.currentCall) {\n console.log('Creating new call', event.call.id);\n this.currentCall = (_a = this.client) === null || _a === void 0 ? void 0 : _a.call(event.call.type, event.call.id);\n // this.currentActiveCallId = this.currentCall?.cid;\n this.notifyListeners('callEvent', { callId: event.call.id, state: CallingState.RINGING });\n // Clear previous responses when a new call starts\n this.participantResponses.clear();\n }\n if (this.currentCall) {\n console.log('Call found', this.currentCall.id);\n this.callStateSubscription = (_b = this.currentCall) === null || _b === void 0 ? void 0 : _b.state.callingState$.subscribe((s) => {\n var _a;\n console.log('Call state', s);\n if (s === CallingState.JOINED) {\n this.setupParticipantListener();\n this.setupCallEventListeners();\n }\n else if (s === CallingState.LEFT || s === CallingState.RECONNECTING_FAILED) {\n this.cleanupCall();\n }\n if (this.outgoingCall && s === CallingState.RINGING) {\n this.outgoingCall = undefined;\n }\n else {\n this.notifyListeners('callEvent', { callId: (_a = this.currentCall) === null || _a === void 0 ? void 0 : _a.id, state: s });\n }\n });\n }\n };\n this.callSessionStartedCallback = (event) => {\n console.log('Call created (session started)', event);\n if (event.call && event.call.session && event.call.session.participants) {\n // Store the number of expected participants for this call\n const callCid = event.call.cid;\n const memberCount = event.call.session.participants.length;\n console.log(`Call ${callCid} created with ${memberCount} members`);\n this.callMembersExpected.set(callCid, memberCount);\n // Store call members in callStates\n this.callStates.set(callCid, {\n members: event.call.session.participants.map(p => { var _a; return ({ user_id: ((_a = p.user) === null || _a === void 0 ? void 0 : _a.id) || '' }); }),\n participantResponses: new Map(),\n expectedMemberCount: memberCount,\n createdAt: new Date(),\n });\n // Start a timeout task that runs every second\n const timeoutTask = setInterval(() => this.checkCallTimeout(callCid), 1000);\n // Update the callState with the timeout task\n const callState = this.callStates.get(callCid);\n if (callState) {\n callState.timer = timeoutTask;\n this.callStates.set(callCid, callState);\n }\n }\n };\n this.callRejectedCallback = (event) => {\n console.log('Call rejected', event);\n if (event.user && event.user.id) {\n this.participantResponses.set(event.user.id, 'rejected');\n // Update the combined callStates map\n const callState = this.callStates.get(event.call_cid);\n if (callState) {\n callState.participantResponses.set(event.user.id, 'rejected');\n this.callStates.set(event.call_cid, callState);\n }\n this.notifyListeners('callEvent', {\n callId: event.call_cid,\n state: 'rejected',\n userId: event.user.id\n });\n this.checkAllParticipantsResponded();\n }\n };\n this.callAcceptedCallback = (event) => {\n console.log('Call accepted', event);\n if (event.user && event.user.id) {\n this.participantResponses.set(event.user.id, 'accepted');\n // Update the combined callStates map\n const callState = this.callStates.get(event.call_cid);\n if (callState) {\n callState.participantResponses.set(event.user.id, 'accepted');\n // If someone accepted, clear the timer as we don't need to check anymore\n if (callState.timer) {\n clearInterval(callState.timer);\n callState.timer = undefined;\n }\n this.callStates.set(event.call_cid, callState);\n }\n this.notifyListeners('callEvent', {\n callId: event.call_cid,\n state: 'accepted',\n userId: event.user.id\n });\n }\n };\n this.callMissedCallback = (event) => {\n console.log('Call missed', event);\n if (event.user && event.user.id) {\n this.participantResponses.set(event.user.id, 'missed');\n // Update the combined callStates map\n const callState = this.callStates.get(event.call_cid);\n if (callState) {\n callState.participantResponses.set(event.user.id, 'missed');\n this.callStates.set(event.call_cid, callState);\n }\n this.notifyListeners('callEvent', {\n callId: event.call_cid,\n state: 'missed',\n userId: event.user.id\n });\n this.checkAllParticipantsResponded();\n }\n };\n // Add a combined map for call states, mirroring the iOS implementation\n this.callStates = new Map();\n }\n // private currentActiveCallId?: string;\n setupCallRingListener() {\n var _a, _b, _c, _d;\n (_a = this.client) === null || _a === void 0 ? void 0 : _a.off('call.ring', this.ringCallback);\n (_b = this.client) === null || _b === void 0 ? void 0 : _b.off('call.session_started', this.callSessionStartedCallback);\n (_c = this.client) === null || _c === void 0 ? void 0 : _c.on('call.ring', this.ringCallback);\n (_d = this.client) === null || _d === void 0 ? void 0 : _d.on('call.session_started', this.callSessionStartedCallback);\n }\n setupCallEventListeners() {\n var _a, _b, _c, _d, _e, _f;\n // Clear previous listeners if any\n (_a = this.client) === null || _a === void 0 ? void 0 : _a.off('call.rejected', this.callRejectedCallback);\n (_b = this.client) === null || _b === void 0 ? void 0 : _b.off('call.accepted', this.callAcceptedCallback);\n (_c = this.client) === null || _c === void 0 ? void 0 : _c.off('call.missed', this.callMissedCallback);\n // Register event listeners\n (_d = this.client) === null || _d === void 0 ? void 0 : _d.on('call.rejected', this.callRejectedCallback);\n (_e = this.client) === null || _e === void 0 ? void 0 : _e.on('call.accepted', this.callAcceptedCallback);\n (_f = this.client) === null || _f === void 0 ? void 0 : _f.on('call.missed', this.callMissedCallback);\n }\n setupParticipantListener() {\n // Subscribe to participant changes\n this.incomingCall = undefined;\n if (!this.currentCall)\n return;\n this.participantJoinedListener = (event) => {\n if (this.magicDivId && event.participant) {\n const magicDiv = document.getElementById(this.magicDivId);\n if (magicDiv && this.currentCall) {\n this.setupParticipantVideo(this.currentCall, event.participant, magicDiv);\n this.setupParticipantAudio(this.currentCall, event.participant, magicDiv);\n }\n }\n };\n this.participantLeftListener = (event) => {\n var _a, _b;\n if (this.magicDivId && event.participant) {\n const videoId = `video-${event.participant.sessionId}`;\n const audioId = `audio-${event.participant.sessionId}`;\n // Remove video element\n const videoEl = document.getElementById(videoId);\n if (videoEl) {\n const unbindVideo = this.videoBindings.get(videoId);\n if (unbindVideo) {\n unbindVideo();\n this.videoBindings.delete(videoId);\n }\n const tracks = videoEl.srcObject;\n if (tracks) {\n tracks.getTracks().forEach((track) => {\n track.stop();\n });\n }\n videoEl.srcObject = null;\n videoEl.remove();\n }\n // Remove audio element\n const audioEl = document.getElementById(audioId);\n if (audioEl) {\n const unbindAudio = this.audioBindings.get(audioId);\n if (unbindAudio) {\n unbindAudio();\n this.audioBindings.delete(audioId);\n }\n const tracks = audioEl.srcObject;\n if (tracks) {\n tracks.getTracks().forEach((track) => {\n track.stop();\n });\n }\n audioEl.srcObject = null;\n audioEl.remove();\n }\n }\n // Check if we're the only participant left in the call\n if (this.currentCall && this.currentCall.state.session) {\n // Get the remaining participants count (we need to subtract 1 as we haven't been removed from the list yet)\n const remainingParticipants = this.currentCall.state.session.participants.length - 1;\n // If we're the only one left, end the call\n if (remainingParticipants <= 1) {\n console.log(`We are left solo in a call. Ending. cID: ${this.currentCall.cid}`);\n // End the call\n this.currentCall.leave();\n // Clean up resources\n const callCid = this.currentCall.cid;\n // Invalidate and remove timer\n const callState = (_a = this.callStates) === null || _a === void 0 ? void 0 : _a.get(callCid);\n if (callState === null || callState === void 0 ? void 0 : callState.timer) {\n clearInterval(callState.timer);\n }\n // Remove from callStates\n (_b = this.callStates) === null || _b === void 0 ? void 0 : _b.delete(callCid);\n // Reset the current call\n this.currentCall = undefined;\n // this.currentActiveCallId = undefined;\n // Clean up\n this.cleanupCall();\n console.log(`Cleaned up resources for ended call: ${callCid}`);\n // Notify that the call has ended\n this.notifyListeners('callEvent', {\n callId: callCid,\n state: 'left',\n reason: 'participant_left'\n });\n }\n }\n };\n this.currentCall.on('participantJoined', this.participantJoinedListener);\n this.currentCall.on('participantLeft', this.participantLeftListener);\n // Setup initial participants\n const participants = this.currentCall.state.participants;\n if (this.magicDivId) {\n const magicDiv = document.getElementById(this.magicDivId);\n if (magicDiv) {\n participants.forEach((participant) => {\n if (this.currentCall) {\n this.setupParticipantVideo(this.currentCall, participant, magicDiv);\n this.setupParticipantAudio(this.currentCall, participant, magicDiv);\n }\n });\n }\n }\n }\n setupParticipantVideo(call, participant, container) {\n const id = `video-${participant.sessionId}`;\n if (!document.getElementById(id)) {\n const videoEl = document.createElement('video');\n videoEl.id = id;\n videoEl.style.width = '100%';\n videoEl.style.maxWidth = '300px';\n videoEl.style.aspectRatio = '16/9';\n container.appendChild(videoEl);\n const unbind = call.bindVideoElement(videoEl, participant.sessionId, 'videoTrack');\n if (unbind)\n this.videoBindings.set(id, unbind);\n }\n }\n setupParticipantAudio(call, participant, container) {\n if (participant.isLocalParticipant)\n return;\n const id = `audio-${participant.sessionId}`;\n if (!document.getElementById(id)) {\n const audioEl = document.createElement('audio');\n audioEl.id = id;\n container.appendChild(audioEl);\n const unbind = call.bindAudioElement(audioEl, participant.sessionId);\n if (unbind)\n this.audioBindings.set(id, unbind);\n }\n }\n checkCallTimeout(callCid) {\n const callState = this.callStates.get(callCid);\n if (!callState)\n return;\n // Calculate time elapsed since call creation\n const now = new Date();\n const elapsedSeconds = (now.getTime() - callState.createdAt.getTime()) / 1000;\n // Check if 30 seconds have passed\n if (elapsedSeconds >= 30) {\n console.log(`Call ${callCid} has timed out after ${elapsedSeconds} seconds`);\n // Check if anyone has accepted\n const hasAccepted = Array.from(callState.participantResponses.values())\n .some(response => response === 'accepted');\n if (!hasAccepted) {\n console.log(`No one accepted call ${callCid}, marking all non-responders as missed`);\n // Mark all members who haven't responded as \"missed\"\n callState.members.forEach(member => {\n if (!callState.participantResponses.has(member.user_id)) {\n callState.participantResponses.set(member.user_id, 'missed');\n this.participantResponses.set(member.user_id, 'missed');\n this.notifyListeners('callEvent', {\n callId: callCid,\n state: 'missed',\n userId: member.user_id\n });\n }\n });\n // End the call\n if (this.currentCall && this.currentCall.cid === callCid) {\n this.currentCall.leave();\n }\n // Clear the timeout task\n if (callState.timer) {\n clearInterval(callState.timer);\n callState.timer = undefined;\n }\n // Remove from callStates\n this.callStates.delete(callCid);\n // Clean up\n this.cleanupCall();\n // Notify that the call has ended\n this.notifyListeners('callEvent', {\n callId: callCid,\n state: 'ended',\n reason: 'timeout'\n });\n }\n }\n }\n checkAllParticipantsResponded() {\n if (!this.currentCall)\n return;\n const callCid = this.currentCall.cid;\n const totalParticipants = this.callMembersExpected.get(callCid);\n if (!totalParticipants) {\n console.log(`No expected participant count found for call: ${callCid}`);\n return;\n }\n console.log(`Total expected participants: ${totalParticipants}`);\n // Count rejections and misses\n let rejectedOrMissedCount = 0;\n this.participantResponses.forEach(response => {\n if (response === 'rejected' || response === 'missed') {\n rejectedOrMissedCount++;\n }\n });\n console.log(`Participants responded: ${this.participantResponses.size}/${totalParticipants}`);\n console.log(`Rejected or missed: ${rejectedOrMissedCount}`);\n const allResponded = this.participantResponses.size >= totalParticipants;\n const allRejectedOrMissed = allResponded &&\n Array.from(this.participantResponses.values()).every(response => response === 'rejected' || response === 'missed');\n // If all participants have rejected or missed the call\n if (allResponded && allRejectedOrMissed) {\n console.log('All participants have rejected or missed the call');\n // End the call\n this.currentCall.leave();\n // Clean up the timer if exists in callStates\n const callState = this.callStates.get(callCid);\n if (callState === null || callState === void 0 ? void 0 : callState.timer) {\n clearInterval(callState.timer);\n }\n // Remove from callStates\n this.callStates.delete(callCid);\n // Clear the responses\n this.participantResponses.clear();\n // Clean up\n this.cleanupCall();\n // Notify that the call has ended\n this.notifyListeners('callEvent', {\n callId: callCid,\n state: 'ended',\n reason: 'all_rejected_or_missed'\n });\n }\n }\n cleanupCall() {\n var _a;\n // First cleanup the call listeners\n if (this.currentCall) {\n if (this.participantJoinedListener) {\n this.currentCall.off('participantJoined', this.participantJoinedListener);\n this.participantJoinedListener = undefined;\n }\n if (this.participantLeftListener) {\n this.currentCall.off('participantLeft', this.participantLeftListener);\n this.participantLeftListener = undefined;\n }\n (_a = this.callStateSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();\n }\n if (this.magicDivId) {\n const magicDiv = document.getElementById(this.magicDivId);\n if (magicDiv) {\n // Remove all video elements\n const videoElements = magicDiv.querySelectorAll('video');\n videoElements.forEach((video) => {\n const id = video.id;\n const unbind = this.videoBindings.get(id);\n if (unbind) {\n unbind();\n this.videoBindings.delete(id);\n }\n // Stop all tracks\n const tracks = video.srcObject;\n if (tracks) {\n tracks.getTracks().forEach((track) => {\n track.stop();\n track.enabled = false;\n });\n video.srcObject = null;\n }\n video.remove();\n });\n // Remove all audio elements\n const audioElements = magicDiv.querySelectorAll('audio');\n audioElements.forEach((audio) => {\n const id = audio.id;\n const unbind = this.audioBindings.get(id);\n if (unbind) {\n unbind();\n this.audioBindings.delete(id);\n }\n // Stop all tracks\n const tracks = audio.srcObject;\n if (tracks) {\n tracks.getTracks().forEach((track) => {\n track.stop();\n track.enabled = false;\n });\n audio.srcObject = null;\n }\n audio.remove();\n });\n // Clear the container\n while (magicDiv.firstChild) {\n magicDiv.removeChild(magicDiv.firstChild);\n }\n }\n }\n // Clear all bindings\n this.videoBindings.clear();\n this.audioBindings.clear();\n // Clear call references\n this.currentCall = undefined;\n this.incomingCall = undefined;\n }\n async login(options) {\n this.client = StreamVideoClient.getOrCreateInstance({\n apiKey: options.apiKey,\n user: { id: options.userId, name: options.name, image: options.imageURL },\n token: options.token,\n });\n this.magicDivId = options.magicDivId;\n this.setupCallRingListener();\n return { success: true };\n }\n async logout() {\n var _a;\n if (!this.client) {\n console.log('No client', this.client);\n throw new Error('Client not initialized');\n }\n // Cleanup subscription\n (_a = this.callStateSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();\n this.callStateSubscription = undefined;\n await this.client.disconnectUser();\n this.client = undefined;\n this.currentCall = undefined;\n return { success: true };\n }\n async call(options) {\n if (!this.client) {\n console.log('No client', this.client);\n throw new Error('Client not initialized - Please login first');\n }\n const call = this.client.call(options.type || 'default', crypto.randomUUID());\n const members = options.userIds.map((userId) => ({ user_id: userId }));\n if (this.client.streamClient.userID && !options.userIds.includes(this.client.streamClient.userID)) {\n members.push({ user_id: this.client.streamClient.userID });\n }\n await call.getOrCreate({ data: { members } });\n // Store the expected member count for this call\n // -1, because we don't count the caller themselves\n this.callMembersExpected.set(call.cid, members.length);\n console.log(`Setting expected members for call ${call.cid}: ${members.length}`);\n this.currentCall = call;\n if (options.ring) {\n this.outgoingCall = call.cid;\n await call.ring();\n }\n await call.join();\n return { success: true };\n }\n async endCall() {\n if (!this.currentCall) {\n console.log('No active call', this.currentCall);\n throw new Error('No active call');\n }\n await this.currentCall.leave();\n this.currentCall = undefined;\n this.cleanupCall();\n return { success: true };\n }\n async setMicrophoneEnabled(options) {\n if (!this.currentCall) {\n console.log('No active call', this.currentCall);\n throw new Error('No active call');\n }\n if (options.enabled) {\n await this.currentCall.microphone.enable();\n }\n else {\n await this.currentCall.microphone.disable();\n }\n return { success: true };\n }\n async setCameraEnabled(options) {\n if (!this.currentCall) {\n console.log('No active call', this.currentCall);\n throw new Error('No active call');\n }\n if (options.enabled) {\n await this.currentCall.camera.enable();\n }\n else {\n await this.currentCall.camera.disable();\n }\n return { success: true };\n }\n async acceptCall() {\n if (!this.incomingCall || !this.client) {\n console.log('No incoming call to accept', this.incomingCall, this.client);\n throw new Error('No incoming call to accept');\n }\n console.log('Accepting call', this.incomingCall);\n const call = this.client.call(this.incomingCall.type, this.incomingCall.id);\n this.currentCall = call;\n console.log('Joining call', call);\n await call.accept();\n await call.join();\n console.log('Joined call', call);\n this.notifyListeners('callEvent', { callId: call.id, state: CallingState.JOINED });\n this.setupParticipantListener();\n return { success: true };\n }\n async rejectCall() {\n if (!this.incomingCall || !this.client) {\n console.log('No incoming call to reject', this.incomingCall, this.client);\n throw new Error('No incoming call to reject');\n }\n console.log('Rejecting call', this.incomingCall);\n const call = this.client.call(this.incomingCall.type, this.incomingCall.id);\n console.log('Leaving call', call);\n await call.reject();\n this.incomingCall = undefined;\n console.log('Rejected call', call);\n this.notifyListeners('callEvent', { callId: call.id, state: CallingState.LEFT });\n this.cleanupCall();\n return { success: true };\n }\n async isCameraEnabled() {\n if (!this.currentCall) {\n console.log('No active call', this.currentCall);\n throw new Error('No active call');\n }\n const enabled = await this.currentCall.camera.enabled;\n return { enabled };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin","CallingState","StreamVideoClient"],"mappings":";;;;;AACK,MAAC,UAAU,GAAGA,mBAAc,CAAC,YAAY,EAAE;AAChD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,I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