@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.js
CHANGED
|
@@ -10,6 +10,8 @@ var capacitorStreamCall = (function (exports, core, videoClient) {
|
|
|
10
10
|
super(...arguments);
|
|
11
11
|
this.videoBindings = new Map();
|
|
12
12
|
this.audioBindings = new Map();
|
|
13
|
+
this.participantResponses = new Map();
|
|
14
|
+
this.callMembersExpected = new Map();
|
|
13
15
|
this.ringCallback = (event) => {
|
|
14
16
|
var _a, _b;
|
|
15
17
|
console.log('Call ringing', event, this.currentCall);
|
|
@@ -17,7 +19,10 @@ var capacitorStreamCall = (function (exports, core, videoClient) {
|
|
|
17
19
|
if (!this.currentCall) {
|
|
18
20
|
console.log('Creating new call', event.call.id);
|
|
19
21
|
this.currentCall = (_a = this.client) === null || _a === void 0 ? void 0 : _a.call(event.call.type, event.call.id);
|
|
22
|
+
// this.currentActiveCallId = this.currentCall?.cid;
|
|
20
23
|
this.notifyListeners('callEvent', { callId: event.call.id, state: videoClient.CallingState.RINGING });
|
|
24
|
+
// Clear previous responses when a new call starts
|
|
25
|
+
this.participantResponses.clear();
|
|
21
26
|
}
|
|
22
27
|
if (this.currentCall) {
|
|
23
28
|
console.log('Call found', this.currentCall.id);
|
|
@@ -26,6 +31,7 @@ var capacitorStreamCall = (function (exports, core, videoClient) {
|
|
|
26
31
|
console.log('Call state', s);
|
|
27
32
|
if (s === videoClient.CallingState.JOINED) {
|
|
28
33
|
this.setupParticipantListener();
|
|
34
|
+
this.setupCallEventListeners();
|
|
29
35
|
}
|
|
30
36
|
else if (s === videoClient.CallingState.LEFT || s === videoClient.CallingState.RECONNECTING_FAILED) {
|
|
31
37
|
this.cleanupCall();
|
|
@@ -39,11 +45,110 @@ var capacitorStreamCall = (function (exports, core, videoClient) {
|
|
|
39
45
|
});
|
|
40
46
|
}
|
|
41
47
|
};
|
|
48
|
+
this.callSessionStartedCallback = (event) => {
|
|
49
|
+
console.log('Call created (session started)', event);
|
|
50
|
+
if (event.call && event.call.session && event.call.session.participants) {
|
|
51
|
+
// Store the number of expected participants for this call
|
|
52
|
+
const callCid = event.call.cid;
|
|
53
|
+
const memberCount = event.call.session.participants.length;
|
|
54
|
+
console.log(`Call ${callCid} created with ${memberCount} members`);
|
|
55
|
+
this.callMembersExpected.set(callCid, memberCount);
|
|
56
|
+
// Store call members in callStates
|
|
57
|
+
this.callStates.set(callCid, {
|
|
58
|
+
members: event.call.session.participants.map(p => { var _a; return ({ user_id: ((_a = p.user) === null || _a === void 0 ? void 0 : _a.id) || '' }); }),
|
|
59
|
+
participantResponses: new Map(),
|
|
60
|
+
expectedMemberCount: memberCount,
|
|
61
|
+
createdAt: new Date(),
|
|
62
|
+
});
|
|
63
|
+
// Start a timeout task that runs every second
|
|
64
|
+
const timeoutTask = setInterval(() => this.checkCallTimeout(callCid), 1000);
|
|
65
|
+
// Update the callState with the timeout task
|
|
66
|
+
const callState = this.callStates.get(callCid);
|
|
67
|
+
if (callState) {
|
|
68
|
+
callState.timer = timeoutTask;
|
|
69
|
+
this.callStates.set(callCid, callState);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
this.callRejectedCallback = (event) => {
|
|
74
|
+
console.log('Call rejected', event);
|
|
75
|
+
if (event.user && event.user.id) {
|
|
76
|
+
this.participantResponses.set(event.user.id, 'rejected');
|
|
77
|
+
// Update the combined callStates map
|
|
78
|
+
const callState = this.callStates.get(event.call_cid);
|
|
79
|
+
if (callState) {
|
|
80
|
+
callState.participantResponses.set(event.user.id, 'rejected');
|
|
81
|
+
this.callStates.set(event.call_cid, callState);
|
|
82
|
+
}
|
|
83
|
+
this.notifyListeners('callEvent', {
|
|
84
|
+
callId: event.call_cid,
|
|
85
|
+
state: 'rejected',
|
|
86
|
+
userId: event.user.id
|
|
87
|
+
});
|
|
88
|
+
this.checkAllParticipantsResponded();
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
this.callAcceptedCallback = (event) => {
|
|
92
|
+
console.log('Call accepted', event);
|
|
93
|
+
if (event.user && event.user.id) {
|
|
94
|
+
this.participantResponses.set(event.user.id, 'accepted');
|
|
95
|
+
// Update the combined callStates map
|
|
96
|
+
const callState = this.callStates.get(event.call_cid);
|
|
97
|
+
if (callState) {
|
|
98
|
+
callState.participantResponses.set(event.user.id, 'accepted');
|
|
99
|
+
// If someone accepted, clear the timer as we don't need to check anymore
|
|
100
|
+
if (callState.timer) {
|
|
101
|
+
clearInterval(callState.timer);
|
|
102
|
+
callState.timer = undefined;
|
|
103
|
+
}
|
|
104
|
+
this.callStates.set(event.call_cid, callState);
|
|
105
|
+
}
|
|
106
|
+
this.notifyListeners('callEvent', {
|
|
107
|
+
callId: event.call_cid,
|
|
108
|
+
state: 'accepted',
|
|
109
|
+
userId: event.user.id
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
this.callMissedCallback = (event) => {
|
|
114
|
+
console.log('Call missed', event);
|
|
115
|
+
if (event.user && event.user.id) {
|
|
116
|
+
this.participantResponses.set(event.user.id, 'missed');
|
|
117
|
+
// Update the combined callStates map
|
|
118
|
+
const callState = this.callStates.get(event.call_cid);
|
|
119
|
+
if (callState) {
|
|
120
|
+
callState.participantResponses.set(event.user.id, 'missed');
|
|
121
|
+
this.callStates.set(event.call_cid, callState);
|
|
122
|
+
}
|
|
123
|
+
this.notifyListeners('callEvent', {
|
|
124
|
+
callId: event.call_cid,
|
|
125
|
+
state: 'missed',
|
|
126
|
+
userId: event.user.id
|
|
127
|
+
});
|
|
128
|
+
this.checkAllParticipantsResponded();
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
// Add a combined map for call states, mirroring the iOS implementation
|
|
132
|
+
this.callStates = new Map();
|
|
42
133
|
}
|
|
134
|
+
// private currentActiveCallId?: string;
|
|
43
135
|
setupCallRingListener() {
|
|
44
|
-
var _a, _b;
|
|
136
|
+
var _a, _b, _c, _d;
|
|
45
137
|
(_a = this.client) === null || _a === void 0 ? void 0 : _a.off('call.ring', this.ringCallback);
|
|
46
|
-
(_b = this.client) === null || _b === void 0 ? void 0 : _b.
|
|
138
|
+
(_b = this.client) === null || _b === void 0 ? void 0 : _b.off('call.session_started', this.callSessionStartedCallback);
|
|
139
|
+
(_c = this.client) === null || _c === void 0 ? void 0 : _c.on('call.ring', this.ringCallback);
|
|
140
|
+
(_d = this.client) === null || _d === void 0 ? void 0 : _d.on('call.session_started', this.callSessionStartedCallback);
|
|
141
|
+
}
|
|
142
|
+
setupCallEventListeners() {
|
|
143
|
+
var _a, _b, _c, _d, _e, _f;
|
|
144
|
+
// Clear previous listeners if any
|
|
145
|
+
(_a = this.client) === null || _a === void 0 ? void 0 : _a.off('call.rejected', this.callRejectedCallback);
|
|
146
|
+
(_b = this.client) === null || _b === void 0 ? void 0 : _b.off('call.accepted', this.callAcceptedCallback);
|
|
147
|
+
(_c = this.client) === null || _c === void 0 ? void 0 : _c.off('call.missed', this.callMissedCallback);
|
|
148
|
+
// Register event listeners
|
|
149
|
+
(_d = this.client) === null || _d === void 0 ? void 0 : _d.on('call.rejected', this.callRejectedCallback);
|
|
150
|
+
(_e = this.client) === null || _e === void 0 ? void 0 : _e.on('call.accepted', this.callAcceptedCallback);
|
|
151
|
+
(_f = this.client) === null || _f === void 0 ? void 0 : _f.on('call.missed', this.callMissedCallback);
|
|
47
152
|
}
|
|
48
153
|
setupParticipantListener() {
|
|
49
154
|
// Subscribe to participant changes
|
|
@@ -60,6 +165,7 @@ var capacitorStreamCall = (function (exports, core, videoClient) {
|
|
|
60
165
|
}
|
|
61
166
|
};
|
|
62
167
|
this.participantLeftListener = (event) => {
|
|
168
|
+
var _a, _b;
|
|
63
169
|
if (this.magicDivId && event.participant) {
|
|
64
170
|
const videoId = `video-${event.participant.sessionId}`;
|
|
65
171
|
const audioId = `audio-${event.participant.sessionId}`;
|
|
@@ -75,10 +181,9 @@ var capacitorStreamCall = (function (exports, core, videoClient) {
|
|
|
75
181
|
if (tracks) {
|
|
76
182
|
tracks.getTracks().forEach((track) => {
|
|
77
183
|
track.stop();
|
|
78
|
-
track.enabled = false;
|
|
79
184
|
});
|
|
80
|
-
videoEl.srcObject = null;
|
|
81
185
|
}
|
|
186
|
+
videoEl.srcObject = null;
|
|
82
187
|
videoEl.remove();
|
|
83
188
|
}
|
|
84
189
|
// Remove audio element
|
|
@@ -93,13 +198,44 @@ var capacitorStreamCall = (function (exports, core, videoClient) {
|
|
|
93
198
|
if (tracks) {
|
|
94
199
|
tracks.getTracks().forEach((track) => {
|
|
95
200
|
track.stop();
|
|
96
|
-
track.enabled = false;
|
|
97
201
|
});
|
|
98
|
-
audioEl.srcObject = null;
|
|
99
202
|
}
|
|
203
|
+
audioEl.srcObject = null;
|
|
100
204
|
audioEl.remove();
|
|
101
205
|
}
|
|
102
206
|
}
|
|
207
|
+
// Check if we're the only participant left in the call
|
|
208
|
+
if (this.currentCall && this.currentCall.state.session) {
|
|
209
|
+
// Get the remaining participants count (we need to subtract 1 as we haven't been removed from the list yet)
|
|
210
|
+
const remainingParticipants = this.currentCall.state.session.participants.length - 1;
|
|
211
|
+
// If we're the only one left, end the call
|
|
212
|
+
if (remainingParticipants <= 1) {
|
|
213
|
+
console.log(`We are left solo in a call. Ending. cID: ${this.currentCall.cid}`);
|
|
214
|
+
// End the call
|
|
215
|
+
this.currentCall.leave();
|
|
216
|
+
// Clean up resources
|
|
217
|
+
const callCid = this.currentCall.cid;
|
|
218
|
+
// Invalidate and remove timer
|
|
219
|
+
const callState = (_a = this.callStates) === null || _a === void 0 ? void 0 : _a.get(callCid);
|
|
220
|
+
if (callState === null || callState === void 0 ? void 0 : callState.timer) {
|
|
221
|
+
clearInterval(callState.timer);
|
|
222
|
+
}
|
|
223
|
+
// Remove from callStates
|
|
224
|
+
(_b = this.callStates) === null || _b === void 0 ? void 0 : _b.delete(callCid);
|
|
225
|
+
// Reset the current call
|
|
226
|
+
this.currentCall = undefined;
|
|
227
|
+
// this.currentActiveCallId = undefined;
|
|
228
|
+
// Clean up
|
|
229
|
+
this.cleanupCall();
|
|
230
|
+
console.log(`Cleaned up resources for ended call: ${callCid}`);
|
|
231
|
+
// Notify that the call has ended
|
|
232
|
+
this.notifyListeners('callEvent', {
|
|
233
|
+
callId: callCid,
|
|
234
|
+
state: 'left',
|
|
235
|
+
reason: 'participant_left'
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
}
|
|
103
239
|
};
|
|
104
240
|
this.currentCall.on('participantJoined', this.participantJoinedListener);
|
|
105
241
|
this.currentCall.on('participantLeft', this.participantLeftListener);
|
|
@@ -144,6 +280,101 @@ var capacitorStreamCall = (function (exports, core, videoClient) {
|
|
|
144
280
|
this.audioBindings.set(id, unbind);
|
|
145
281
|
}
|
|
146
282
|
}
|
|
283
|
+
checkCallTimeout(callCid) {
|
|
284
|
+
const callState = this.callStates.get(callCid);
|
|
285
|
+
if (!callState)
|
|
286
|
+
return;
|
|
287
|
+
// Calculate time elapsed since call creation
|
|
288
|
+
const now = new Date();
|
|
289
|
+
const elapsedSeconds = (now.getTime() - callState.createdAt.getTime()) / 1000;
|
|
290
|
+
// Check if 30 seconds have passed
|
|
291
|
+
if (elapsedSeconds >= 30) {
|
|
292
|
+
console.log(`Call ${callCid} has timed out after ${elapsedSeconds} seconds`);
|
|
293
|
+
// Check if anyone has accepted
|
|
294
|
+
const hasAccepted = Array.from(callState.participantResponses.values())
|
|
295
|
+
.some(response => response === 'accepted');
|
|
296
|
+
if (!hasAccepted) {
|
|
297
|
+
console.log(`No one accepted call ${callCid}, marking all non-responders as missed`);
|
|
298
|
+
// Mark all members who haven't responded as "missed"
|
|
299
|
+
callState.members.forEach(member => {
|
|
300
|
+
if (!callState.participantResponses.has(member.user_id)) {
|
|
301
|
+
callState.participantResponses.set(member.user_id, 'missed');
|
|
302
|
+
this.participantResponses.set(member.user_id, 'missed');
|
|
303
|
+
this.notifyListeners('callEvent', {
|
|
304
|
+
callId: callCid,
|
|
305
|
+
state: 'missed',
|
|
306
|
+
userId: member.user_id
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
// End the call
|
|
311
|
+
if (this.currentCall && this.currentCall.cid === callCid) {
|
|
312
|
+
this.currentCall.leave();
|
|
313
|
+
}
|
|
314
|
+
// Clear the timeout task
|
|
315
|
+
if (callState.timer) {
|
|
316
|
+
clearInterval(callState.timer);
|
|
317
|
+
callState.timer = undefined;
|
|
318
|
+
}
|
|
319
|
+
// Remove from callStates
|
|
320
|
+
this.callStates.delete(callCid);
|
|
321
|
+
// Clean up
|
|
322
|
+
this.cleanupCall();
|
|
323
|
+
// Notify that the call has ended
|
|
324
|
+
this.notifyListeners('callEvent', {
|
|
325
|
+
callId: callCid,
|
|
326
|
+
state: 'ended',
|
|
327
|
+
reason: 'timeout'
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
checkAllParticipantsResponded() {
|
|
333
|
+
if (!this.currentCall)
|
|
334
|
+
return;
|
|
335
|
+
const callCid = this.currentCall.cid;
|
|
336
|
+
const totalParticipants = this.callMembersExpected.get(callCid);
|
|
337
|
+
if (!totalParticipants) {
|
|
338
|
+
console.log(`No expected participant count found for call: ${callCid}`);
|
|
339
|
+
return;
|
|
340
|
+
}
|
|
341
|
+
console.log(`Total expected participants: ${totalParticipants}`);
|
|
342
|
+
// Count rejections and misses
|
|
343
|
+
let rejectedOrMissedCount = 0;
|
|
344
|
+
this.participantResponses.forEach(response => {
|
|
345
|
+
if (response === 'rejected' || response === 'missed') {
|
|
346
|
+
rejectedOrMissedCount++;
|
|
347
|
+
}
|
|
348
|
+
});
|
|
349
|
+
console.log(`Participants responded: ${this.participantResponses.size}/${totalParticipants}`);
|
|
350
|
+
console.log(`Rejected or missed: ${rejectedOrMissedCount}`);
|
|
351
|
+
const allResponded = this.participantResponses.size >= totalParticipants;
|
|
352
|
+
const allRejectedOrMissed = allResponded &&
|
|
353
|
+
Array.from(this.participantResponses.values()).every(response => response === 'rejected' || response === 'missed');
|
|
354
|
+
// If all participants have rejected or missed the call
|
|
355
|
+
if (allResponded && allRejectedOrMissed) {
|
|
356
|
+
console.log('All participants have rejected or missed the call');
|
|
357
|
+
// End the call
|
|
358
|
+
this.currentCall.leave();
|
|
359
|
+
// Clean up the timer if exists in callStates
|
|
360
|
+
const callState = this.callStates.get(callCid);
|
|
361
|
+
if (callState === null || callState === void 0 ? void 0 : callState.timer) {
|
|
362
|
+
clearInterval(callState.timer);
|
|
363
|
+
}
|
|
364
|
+
// Remove from callStates
|
|
365
|
+
this.callStates.delete(callCid);
|
|
366
|
+
// Clear the responses
|
|
367
|
+
this.participantResponses.clear();
|
|
368
|
+
// Clean up
|
|
369
|
+
this.cleanupCall();
|
|
370
|
+
// Notify that the call has ended
|
|
371
|
+
this.notifyListeners('callEvent', {
|
|
372
|
+
callId: callCid,
|
|
373
|
+
state: 'ended',
|
|
374
|
+
reason: 'all_rejected_or_missed'
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
}
|
|
147
378
|
cleanupCall() {
|
|
148
379
|
var _a;
|
|
149
380
|
// First cleanup the call listeners
|
|
@@ -245,10 +476,14 @@ var capacitorStreamCall = (function (exports, core, videoClient) {
|
|
|
245
476
|
}
|
|
246
477
|
const call = this.client.call(options.type || 'default', crypto.randomUUID());
|
|
247
478
|
const members = options.userIds.map((userId) => ({ user_id: userId }));
|
|
248
|
-
if (this.client.streamClient.userID && options.userIds.includes(this.client.streamClient.userID)) {
|
|
479
|
+
if (this.client.streamClient.userID && !options.userIds.includes(this.client.streamClient.userID)) {
|
|
249
480
|
members.push({ user_id: this.client.streamClient.userID });
|
|
250
481
|
}
|
|
251
482
|
await call.getOrCreate({ data: { members } });
|
|
483
|
+
// Store the expected member count for this call
|
|
484
|
+
// -1, because we don't count the caller themselves
|
|
485
|
+
this.callMembersExpected.set(call.cid, members.length);
|
|
486
|
+
console.log(`Setting expected members for call ${call.cid}: ${members.length}`);
|
|
252
487
|
this.currentCall = call;
|
|
253
488
|
if (options.ring) {
|
|
254
489
|
this.outgoingCall = call.cid;
|
|
@@ -317,7 +552,7 @@ var capacitorStreamCall = (function (exports, core, videoClient) {
|
|
|
317
552
|
console.log('Rejecting call', this.incomingCall);
|
|
318
553
|
const call = this.client.call(this.incomingCall.type, this.incomingCall.id);
|
|
319
554
|
console.log('Leaving call', call);
|
|
320
|
-
await call.
|
|
555
|
+
await call.reject();
|
|
321
556
|
this.incomingCall = undefined;
|
|
322
557
|
console.log('Rejected call', call);
|
|
323
558
|
this.notifyListeners('callEvent', { callId: call.id, state: videoClient.CallingState.LEFT });
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.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,UAAC,UAAU,GAAGA,mBAAc,CAAC,YAAY,EAAE;IAChD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,aAAa,EAAE,CAAC;IACjE,CAAC;;ICDM,MAAM,aAAa,SAASC,cAAS,CAAC;IAC7C,IAAI,WAAW,GAAG;IAClB,QAAQ,KAAK,CAAC,GAAG,SAAS,CAAC;IAC3B,QAAQ,IAAI,CAAC,aAAa,GAAG,IAAI,GAAG,EAAE;IACtC,QAAQ,IAAI,CAAC,aAAa,GAAG,IAAI,GAAG,EAAE;IACtC,QAAQ,IAAI,CAAC,YAAY,GAAG,CAAC,KAAK,KAAK;IACvC,YAAY,IAAI,EAAE,EAAE,EAAE;IACtB,YAAY,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC;IAChE,YAAY,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,IAAI;IAC1C,YAAY,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;IACnC,gBAAgB,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;IAC/D,gBAAgB,IAAI,CAAC,WAAW,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC,MAAM,MAAM,IAAI,IAAI,EAAE,KAAK,MAAM,GAAG,MAAM,GAAG,EAAE,CAA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;IACrF,YAAY,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC;IACzD;IACA,QAAQ,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,IAAI,CAAC,YAAY,CAAC;IACxD,QAAQ,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC;IACnF,QAAQ,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,IAAI,CAAC;IACzC,QAAQ,MAAM,IAAI,CAAC,KAAK,EAAE;IAC1B,QAAQ,IAAI,CAAC,YAAY,GAAG,SAAS;IACrC,QAAQ,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,IAAI,CAAC;IAC1C,QAAQ,IAAI,CAAC,eAAe,CAAC,WAAW,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,EAAE,KAAK,EAAEA,wBAAY,CAAC,IAAI,EAAE,CAAC;IACxF,QAAQ,IAAI,CAAC,WAAW,EAAE;IAC1B,QAAQ,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;IAChC;IACA,IAAI,MAAM,eAAe,GAAG;IAC5B,QAAQ,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;IAC/B,YAAY,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,IAAI,CAAC,WAAW,CAAC;IAC3D,YAAY,MAAM,IAAI,KAAK,CAAC,gBAAgB,CAAC;IAC7C;IACA,QAAQ,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO;IAC7D,QAAQ,OAAO,EAAE,OAAO,EAAE;IAC1B;IACA;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin.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,UAAC,UAAU,GAAGA,mBAAc,CAAC,YAAY,EAAE;I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