@sawport/peers-caller 0.0.1 → 1.0.0-alpha.2
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 +47 -44
- package/dist/core/CallRecorder.d.ts +2 -2
- package/dist/core/CallRecorder.d.ts.map +1 -1
- package/dist/core/CallSocket.d.ts +26 -20
- package/dist/core/CallSocket.d.ts.map +1 -1
- package/dist/core/PeersCaller.d.ts +5 -0
- package/dist/core/PeersCaller.d.ts.map +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/peers-caller.es.js +691 -708
- package/dist/peers-caller.es.js.map +1 -1
- package/dist/peers-caller.umd.js +6 -6
- package/dist/peers-caller.umd.js.map +1 -1
- package/dist/store/index.d.ts +1 -1
- package/dist/store/index.d.ts.map +1 -1
- package/dist/tester/components/ConfigPanel.d.ts +1 -1
- package/dist/tester/components/ConfigPanel.d.ts.map +1 -1
- package/dist/tester/hooks/useTester.d.ts +1 -1
- package/dist/tester/hooks/useTester.d.ts.map +1 -1
- package/dist/types/index.d.ts +37 -44
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +23 -5
- package/dist/events/CallEventEmitter.d.ts +0 -2
- package/dist/events/CallEventEmitter.d.ts.map +0 -1
- package/dist/events/index.d.ts +0 -2
- package/dist/events/index.d.ts.map +0 -1
- package/dist/events/types.d.ts +0 -2
- package/dist/events/types.d.ts.map +0 -1
- package/dist/test-polyfills.d.ts +0 -2
- package/dist/test-polyfills.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -2,8 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
<div align="center">
|
|
4
4
|
|
|
5
|
+
[](https://github.com/sawport/peers-caller/actions/workflows/ci.yml)
|
|
5
6
|
[](https://badge.fury.io/js/@sawport%2Fpeers-caller)
|
|
7
|
+
[](https://codecov.io/gh/sawport/peers-caller)
|
|
6
8
|
[](https://www.typescriptlang.org/)
|
|
9
|
+
[](https://github.com/semantic-release/semantic-release)
|
|
7
10
|
[](https://opensource.org/licenses/MIT)
|
|
8
11
|
|
|
9
12
|
A modern, TypeScript-first WebRTC library for multi-peer mesh video calls supporting up to 4 participants. Built with developer experience in mind.
|
|
@@ -44,7 +47,7 @@ import { PeersCaller } from '@sawport/peers-caller';
|
|
|
44
47
|
|
|
45
48
|
// Initialize the caller
|
|
46
49
|
const peersCaller = new PeersCaller({
|
|
47
|
-
|
|
50
|
+
roomId: 'unique-conversation-id',
|
|
48
51
|
userId: 'current-user-id',
|
|
49
52
|
token: 'jwt-auth-token',
|
|
50
53
|
socketUrl: 'https://your-signaling-server.com',
|
|
@@ -105,7 +108,7 @@ function VideoCallComponent() {
|
|
|
105
108
|
isConnected,
|
|
106
109
|
error
|
|
107
110
|
} = useVideoCall({
|
|
108
|
-
|
|
111
|
+
roomId: 'conversation-123',
|
|
109
112
|
userId: 'user-456',
|
|
110
113
|
token: 'your-jwt-token',
|
|
111
114
|
socketUrl: 'https://your-server.com',
|
|
@@ -163,41 +166,41 @@ PeersCaller requires a WebSocket signaling server to coordinate calls between pe
|
|
|
163
166
|
|
|
164
167
|
```typescript
|
|
165
168
|
// Call Management
|
|
166
|
-
socket.emit('call.start', {
|
|
167
|
-
socket.emit('call.join', {
|
|
168
|
-
socket.emit('call.leave', {
|
|
169
|
-
socket.emit('call.end', {
|
|
170
|
-
socket.emit('call.status', {
|
|
169
|
+
socket.emit('call.start', { roomId: string });
|
|
170
|
+
socket.emit('call.join', { roomId: string });
|
|
171
|
+
socket.emit('call.leave', { roomId: string });
|
|
172
|
+
socket.emit('call.end', { roomId: string, targetUserId?: string });
|
|
173
|
+
socket.emit('call.status', { roomId: string });
|
|
171
174
|
|
|
172
175
|
// WebRTC Signaling
|
|
173
176
|
socket.emit('call.offer', {
|
|
174
177
|
to: string,
|
|
175
178
|
offer: RTCSessionDescriptionInit,
|
|
176
|
-
|
|
179
|
+
roomId: string
|
|
177
180
|
});
|
|
178
181
|
socket.emit('call.answer', {
|
|
179
182
|
to: string,
|
|
180
183
|
answer: RTCSessionDescriptionInit,
|
|
181
|
-
|
|
184
|
+
roomId: string
|
|
182
185
|
});
|
|
183
186
|
socket.emit('call.candidate', {
|
|
184
187
|
to: string,
|
|
185
188
|
candidate: RTCIceCandidateInit,
|
|
186
|
-
|
|
189
|
+
roomId: string
|
|
187
190
|
});
|
|
188
191
|
|
|
189
192
|
// State Updates
|
|
190
193
|
socket.emit('call.state', {
|
|
191
194
|
to?: string,
|
|
192
195
|
state: Partial<CallParticipant>,
|
|
193
|
-
|
|
196
|
+
roomId: string
|
|
194
197
|
});
|
|
195
198
|
|
|
196
199
|
// Recording & Transcription
|
|
197
|
-
socket.emit('call.recording.start', {
|
|
198
|
-
socket.emit('call.recording.chunk', {
|
|
199
|
-
socket.emit('call.recording.end', {
|
|
200
|
-
socket.emit('call.transcript', {
|
|
200
|
+
socket.emit('call.recording.start', { roomId: string, recordingId: string });
|
|
201
|
+
socket.emit('call.recording.chunk', { roomId: string, recordingId: string, chunk: Blob });
|
|
202
|
+
socket.emit('call.recording.end', { roomId: string, recordingId: string });
|
|
203
|
+
socket.emit('call.transcript', { roomId: string, transcript: string, timestamp: number });
|
|
201
204
|
```
|
|
202
205
|
|
|
203
206
|
### 📨 Server-to-Client Events (Incoming)
|
|
@@ -205,7 +208,7 @@ socket.emit('call.transcript', { conversationId: string, transcript: string, tim
|
|
|
205
208
|
```typescript
|
|
206
209
|
// Call Management Responses
|
|
207
210
|
socket.on('call.started', (data: {
|
|
208
|
-
|
|
211
|
+
roomId: string,
|
|
209
212
|
userId: string,
|
|
210
213
|
success: boolean,
|
|
211
214
|
participants: string[]
|
|
@@ -214,27 +217,27 @@ socket.on('call.started', (data: {
|
|
|
214
217
|
socket.on('call.participant.joined', (data: {
|
|
215
218
|
userId: string,
|
|
216
219
|
participants: string[],
|
|
217
|
-
|
|
220
|
+
roomId: string
|
|
218
221
|
}) => {});
|
|
219
222
|
|
|
220
223
|
socket.on('call.participant.left', (data: {
|
|
221
224
|
userId: string,
|
|
222
225
|
participants: string[],
|
|
223
|
-
|
|
226
|
+
roomId: string
|
|
224
227
|
}) => {});
|
|
225
228
|
|
|
226
229
|
socket.on('call.participants', (data: {
|
|
227
230
|
participants: string[],
|
|
228
|
-
|
|
231
|
+
roomId: string
|
|
229
232
|
}) => {});
|
|
230
233
|
|
|
231
234
|
socket.on('call.left', (data: {
|
|
232
|
-
|
|
235
|
+
roomId: string,
|
|
233
236
|
success: boolean
|
|
234
237
|
}) => {});
|
|
235
238
|
|
|
236
239
|
socket.on('call.ended', (data: {
|
|
237
|
-
|
|
240
|
+
roomId: string,
|
|
238
241
|
endedBy: string,
|
|
239
242
|
reason: string
|
|
240
243
|
}) => {});
|
|
@@ -248,30 +251,30 @@ socket.on('call.error', (data: {
|
|
|
248
251
|
socket.on('call.offer', (data: {
|
|
249
252
|
from: string,
|
|
250
253
|
offer: RTCSessionDescriptionInit,
|
|
251
|
-
|
|
254
|
+
roomId: string
|
|
252
255
|
}) => {});
|
|
253
256
|
|
|
254
257
|
socket.on('call.answer', (data: {
|
|
255
258
|
from: string,
|
|
256
259
|
answer: RTCSessionDescriptionInit,
|
|
257
|
-
|
|
260
|
+
roomId: string
|
|
258
261
|
}) => {});
|
|
259
262
|
|
|
260
263
|
socket.on('call.candidate', (data: {
|
|
261
264
|
from: string,
|
|
262
265
|
candidate: RTCIceCandidateInit,
|
|
263
|
-
|
|
266
|
+
roomId: string
|
|
264
267
|
}) => {});
|
|
265
268
|
|
|
266
269
|
socket.on('call.state', (data: {
|
|
267
270
|
from: string,
|
|
268
271
|
state: Partial<CallParticipant>,
|
|
269
|
-
|
|
272
|
+
roomId: string
|
|
270
273
|
}) => {});
|
|
271
274
|
|
|
272
275
|
// Call Status Updates
|
|
273
276
|
socket.on('call.status.changed', (data: {
|
|
274
|
-
|
|
277
|
+
roomId: string,
|
|
275
278
|
hasActiveCall: boolean,
|
|
276
279
|
participantCount: number,
|
|
277
280
|
maxParticipants: number,
|
|
@@ -282,12 +285,12 @@ socket.on('call.status.changed', (data: {
|
|
|
282
285
|
}) => {});
|
|
283
286
|
|
|
284
287
|
// Recording Events
|
|
285
|
-
socket.on('call.recording.start', (data: { recordingId: string,
|
|
286
|
-
socket.on('call.recording.chunk.received', (data: { recordingId: string,
|
|
287
|
-
socket.on('call.recording.end', (data: { recordingId: string,
|
|
288
|
+
socket.on('call.recording.start', (data: { recordingId: string, roomId: string }) => {});
|
|
289
|
+
socket.on('call.recording.chunk.received', (data: { recordingId: string, roomId: string, chunkSize: number, timestamp: number }) => {});
|
|
290
|
+
socket.on('call.recording.end', (data: { recordingId: string, roomId: string }) => {});
|
|
288
291
|
|
|
289
292
|
// Transcription Events
|
|
290
|
-
socket.on('call.transcript', (data: { userId: string, transcript: string, timestamp: number,
|
|
293
|
+
socket.on('call.transcript', (data: { userId: string, transcript: string, timestamp: number, roomId: string }) => {});
|
|
291
294
|
```
|
|
292
295
|
|
|
293
296
|
### 🔐 Authentication
|
|
@@ -340,28 +343,28 @@ io.on('connection', (socket) => {
|
|
|
340
343
|
console.log(`User ${socket.userId} connected`);
|
|
341
344
|
|
|
342
345
|
// Handle call start
|
|
343
|
-
socket.on('call.start', async ({
|
|
346
|
+
socket.on('call.start', async ({ roomId }) => {
|
|
344
347
|
try {
|
|
345
348
|
// Join room
|
|
346
|
-
await socket.join(
|
|
349
|
+
await socket.join(roomId);
|
|
347
350
|
|
|
348
351
|
// Get existing participants
|
|
349
|
-
const room = io.sockets.adapter.rooms.get(
|
|
352
|
+
const room = io.sockets.adapter.rooms.get(roomId);
|
|
350
353
|
const participants = Array.from(room || []);
|
|
351
354
|
|
|
352
355
|
// Emit success response
|
|
353
356
|
socket.emit('call.started', {
|
|
354
|
-
|
|
357
|
+
roomId,
|
|
355
358
|
userId: socket.userId,
|
|
356
359
|
success: true,
|
|
357
360
|
participants: participants.map(id => io.sockets.sockets.get(id)?.userId).filter(Boolean)
|
|
358
361
|
});
|
|
359
362
|
|
|
360
363
|
// Notify other participants
|
|
361
|
-
socket.to(
|
|
364
|
+
socket.to(roomId).emit('call.participant.joined', {
|
|
362
365
|
userId: socket.userId,
|
|
363
366
|
participants: participants.map(id => io.sockets.sockets.get(id)?.userId).filter(Boolean),
|
|
364
|
-
|
|
367
|
+
roomId
|
|
365
368
|
});
|
|
366
369
|
} catch (error) {
|
|
367
370
|
socket.emit('call.error', { error: 'CALL_START_FAILED', message: error.message });
|
|
@@ -369,7 +372,7 @@ io.on('connection', (socket) => {
|
|
|
369
372
|
});
|
|
370
373
|
|
|
371
374
|
// Handle WebRTC signaling
|
|
372
|
-
socket.on('call.offer', ({ to, offer,
|
|
375
|
+
socket.on('call.offer', ({ to, offer, roomId }) => {
|
|
373
376
|
const targetSocket = Array.from(io.sockets.sockets.values())
|
|
374
377
|
.find(s => s.userId === to);
|
|
375
378
|
|
|
@@ -377,7 +380,7 @@ io.on('connection', (socket) => {
|
|
|
377
380
|
targetSocket.emit('call.offer', {
|
|
378
381
|
from: socket.userId,
|
|
379
382
|
offer,
|
|
380
|
-
|
|
383
|
+
roomId
|
|
381
384
|
});
|
|
382
385
|
}
|
|
383
386
|
});
|
|
@@ -389,7 +392,7 @@ io.on('connection', (socket) => {
|
|
|
389
392
|
if (room !== socket.id) {
|
|
390
393
|
socket.to(room).emit('call.participant.left', {
|
|
391
394
|
userId: socket.userId,
|
|
392
|
-
|
|
395
|
+
roomId: room
|
|
393
396
|
});
|
|
394
397
|
}
|
|
395
398
|
});
|
|
@@ -460,7 +463,7 @@ Clean up all resources and disconnect.
|
|
|
460
463
|
|
|
461
464
|
```typescript
|
|
462
465
|
interface PeersCallerConfig {
|
|
463
|
-
|
|
466
|
+
roomId: string; // Unique conversation identifier
|
|
464
467
|
userId: string; // Current user's unique identifier
|
|
465
468
|
token: string; // JWT authentication token
|
|
466
469
|
socketUrl: string; // WebSocket server URL
|
|
@@ -485,8 +488,8 @@ interface MediaStreamConfig {
|
|
|
485
488
|
|
|
486
489
|
```typescript
|
|
487
490
|
interface PeersCallerCallbacks {
|
|
488
|
-
onCallStarted?: (data: {
|
|
489
|
-
onCallEnded?: (data: {
|
|
491
|
+
onCallStarted?: (data: { roomId: string; success: boolean; participants: string[] }) => void;
|
|
492
|
+
onCallEnded?: (data: { roomId: string; endedBy: string; reason: string }) => void;
|
|
490
493
|
onParticipantJoined?: (participant: CallParticipant) => void;
|
|
491
494
|
onParticipantLeft?: (userId: string) => void;
|
|
492
495
|
onParticipantStateChanged?: (userId: string, state: Partial<CallParticipant>) => void;
|
|
@@ -596,7 +599,7 @@ await peersCaller.startRecording(
|
|
|
596
599
|
{
|
|
597
600
|
id: 'recording-123',
|
|
598
601
|
filename: 'meeting-recording.webm',
|
|
599
|
-
|
|
602
|
+
roomId: 'conversation-456',
|
|
600
603
|
startTime: Date.now()
|
|
601
604
|
},
|
|
602
605
|
{
|
|
@@ -723,7 +726,7 @@ describe('PeersCaller', () => {
|
|
|
723
726
|
|
|
724
727
|
it('should initialize successfully', async () => {
|
|
725
728
|
const peersCaller = new PeersCaller({
|
|
726
|
-
|
|
729
|
+
roomId: 'test-123',
|
|
727
730
|
userId: 'user-456',
|
|
728
731
|
token: 'fake-token',
|
|
729
732
|
socketUrl: 'http://localhost:3000'
|
|
@@ -17,7 +17,7 @@ export declare class CallRecorder {
|
|
|
17
17
|
private isRecording;
|
|
18
18
|
private config;
|
|
19
19
|
private callbacks;
|
|
20
|
-
constructor(
|
|
20
|
+
constructor(config?: RecordingConfig, callbacks?: RecorderCallbacks);
|
|
21
21
|
/**
|
|
22
22
|
* Start recording with mixed streams and recording data
|
|
23
23
|
*/
|
|
@@ -61,7 +61,7 @@ export declare class CallRecorder {
|
|
|
61
61
|
/**
|
|
62
62
|
* Cleanup recorder resources
|
|
63
63
|
*/
|
|
64
|
-
cleanup(): void
|
|
64
|
+
cleanup(): Promise<void>;
|
|
65
65
|
}
|
|
66
66
|
declare global {
|
|
67
67
|
interface Window {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CallRecorder.d.ts","sourceRoot":"","sources":["../../src/core/CallRecorder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/E,MAAM,WAAW,iBAAiB;IAChC,kBAAkB,CAAC,EAAE,CAAC,aAAa,EAAE,aAAa,KAAK,IAAI,CAAC;IAC5D,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,aAAa,KAAK,IAAI,CAAC;IACvE,kBAAkB,CAAC,EAAE,CAAC,aAAa,EAAE,aAAa,KAAK,IAAI,CAAC;IAC5D,oBAAoB,CAAC,EAAE,CAAC,UAAU,EAAE,cAAc,KAAK,IAAI,CAAC;IAC5D,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAClC;AAED,qBAAa,YAAY;IACvB,OAAO,CAAC,KAAK,CAAkC;IAC/C,OAAO,CAAC,QAAQ,CAA8B;IAC9C,OAAO,CAAC,gBAAgB,CAA4B;IACpD,OAAO,CAAC,WAAW,CAAS;IAE5B,OAAO,CAAC,MAAM,CAAkB;IAChC,OAAO,CAAC,SAAS,CAAoB;
|
|
1
|
+
{"version":3,"file":"CallRecorder.d.ts","sourceRoot":"","sources":["../../src/core/CallRecorder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/E,MAAM,WAAW,iBAAiB;IAChC,kBAAkB,CAAC,EAAE,CAAC,aAAa,EAAE,aAAa,KAAK,IAAI,CAAC;IAC5D,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,aAAa,KAAK,IAAI,CAAC;IACvE,kBAAkB,CAAC,EAAE,CAAC,aAAa,EAAE,aAAa,KAAK,IAAI,CAAC;IAC5D,oBAAoB,CAAC,EAAE,CAAC,UAAU,E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
|
44
44
|
* Start a new call
|
|
45
45
|
*/
|
|
46
|
-
startCall(
|
|
46
|
+
startCall(roomId: string): Promise<{
|
|
47
47
|
success: boolean;
|
|
48
48
|
participants: string[];
|
|
49
|
-
|
|
50
|
-
userId: string;
|
|
49
|
+
roomId: string;
|
|
51
50
|
}>;
|
|
52
51
|
/**
|
|
53
52
|
* Join a call room for signaling
|
|
54
53
|
*/
|
|
55
|
-
joinRoom(
|
|
54
|
+
joinRoom(roomId: string): Promise<{
|
|
56
55
|
participants: string[];
|
|
57
|
-
|
|
56
|
+
roomId: string;
|
|
58
57
|
}>;
|
|
59
58
|
/**
|
|
60
59
|
* Leave a call
|
|
61
60
|
*/
|
|
62
|
-
leaveCall(
|
|
63
|
-
|
|
61
|
+
leaveCall(roomId: string): Promise<{
|
|
62
|
+
roomId: string;
|
|
64
63
|
success: boolean;
|
|
65
64
|
}>;
|
|
66
65
|
/**
|
|
67
66
|
* Send WebRTC offer
|
|
68
67
|
*/
|
|
69
|
-
sendOffer(to: string,
|
|
68
|
+
sendOffer(to: string, offer: RTCSessionDescriptionInit, roomId: string): void;
|
|
70
69
|
/**
|
|
71
70
|
* Send WebRTC answer
|
|
72
71
|
*/
|
|
73
|
-
sendAnswer(to: string,
|
|
72
|
+
sendAnswer(to: string, answer: RTCSessionDescriptionInit, roomId: string): void;
|
|
74
73
|
/**
|
|
75
74
|
* Send ICE candidate
|
|
76
75
|
*/
|
|
77
|
-
sendCandidate(to: string,
|
|
76
|
+
sendCandidate(to: string, candidate: RTCIceCandidateInit, roomId: string): void;
|
|
78
77
|
/**
|
|
79
78
|
* Send participant state update
|
|
80
79
|
*/
|
|
81
|
-
sendStateUpdate(to: string,
|
|
80
|
+
sendStateUpdate(to: string, state: any, roomId: string): void;
|
|
82
81
|
/**
|
|
83
82
|
* End call for specific participant (legacy method)
|
|
84
83
|
*/
|
|
85
|
-
endCall(to: string, _from: string,
|
|
84
|
+
endCall(to: string, _from: string, roomId: string): void;
|
|
86
85
|
/**
|
|
87
86
|
* End call for all participants
|
|
88
87
|
*/
|
|
89
|
-
endCallForAll(
|
|
88
|
+
endCallForAll(roomId: string): Promise<void>;
|
|
90
89
|
/**
|
|
91
90
|
* Start recording
|
|
92
91
|
*/
|
|
93
|
-
startRecording(
|
|
92
|
+
startRecording(roomId: string, recordingId: string): Promise<{
|
|
94
93
|
recordingId: string;
|
|
95
|
-
|
|
94
|
+
roomId: string;
|
|
96
95
|
}>;
|
|
97
96
|
/**
|
|
98
97
|
* Send recording chunk
|
|
99
98
|
*/
|
|
100
|
-
sendRecordingChunk(
|
|
99
|
+
sendRecordingChunk(roomId: string, recordingId: string, chunk: Blob): void;
|
|
101
100
|
/**
|
|
102
101
|
* End recording
|
|
103
102
|
*/
|
|
104
|
-
endRecording(
|
|
103
|
+
endRecording(roomId: string, recordingId: string): Promise<{
|
|
105
104
|
recordingId: string;
|
|
106
|
-
|
|
105
|
+
roomId: string;
|
|
107
106
|
success: boolean;
|
|
108
107
|
}>;
|
|
109
108
|
/**
|
|
110
109
|
* Send transcript
|
|
111
110
|
*/
|
|
112
|
-
sendTranscript(
|
|
111
|
+
sendTranscript(roomId: string, transcript: string): void;
|
|
113
112
|
/**
|
|
114
113
|
* Check call status
|
|
115
114
|
*/
|
|
116
|
-
checkCallStatus(
|
|
115
|
+
checkCallStatus(roomId: string): Promise<any>;
|
|
116
|
+
/**
|
|
117
|
+
* Get ICE servers from backend
|
|
118
|
+
*/
|
|
119
|
+
getIceServers(roomId: string): Promise<{
|
|
120
|
+
iceServers?: RTCIceServer[];
|
|
121
|
+
error?: string;
|
|
122
|
+
}>;
|
|
117
123
|
/**
|
|
118
124
|
* Handle disconnection scenarios
|
|
119
125
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CallSocket.d.ts","sourceRoot":"","sources":["../../src/core/CallSocket.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,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,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,GAAG,IAAI;IAI1E;;OAEG;IACG,YAAY,CAChB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC;QACT,WAAW,EAAE,MAAM,CAAC;QACpB,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,EAAE,OAAO,CAAC;KAClB,CAAC;IAOF;;OAEG;IACH,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI;IAQxD;;OAEG;IACG,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAInD;;OAEG;IACG,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;QAC3C,UAAU,CAAC,EAAE,YAAY,EAAE,CAAC;QAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IAIF;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAsB3B;;OAEG;IACH,iBAAiB;;;;;;CAQlB"}
|
|
@@ -16,6 +16,7 @@ export declare class PeersCaller extends BaseStore<CallStore> {
|
|
|
16
16
|
private iceServers;
|
|
17
17
|
private isInitialized;
|
|
18
18
|
private listenersSetup;
|
|
19
|
+
private roomId;
|
|
19
20
|
private eventListeners;
|
|
20
21
|
constructor(config: PeersCallerConfig, callbacks?: PeersCallerCallbacks);
|
|
21
22
|
/**
|
|
@@ -147,6 +148,10 @@ export declare class PeersCaller extends BaseStore<CallStore> {
|
|
|
147
148
|
* Handle errors with proper categorization
|
|
148
149
|
*/
|
|
149
150
|
private handleError;
|
|
151
|
+
/**
|
|
152
|
+
* Fetch ICE servers from the backend
|
|
153
|
+
*/
|
|
154
|
+
private fetchIceServers;
|
|
150
155
|
/**
|
|
151
156
|
* Forward WebRTC signaling data to the server
|
|
152
157
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PeersCaller.d.ts","sourceRoot":"","sources":["../../src/core/PeersCaller.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAgB,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,EACV,iBAAiB,EACjB,oBAAoB,EAGpB,eAAe,EACf,aAAa,EACb,kBAAkB,EAGnB,MAAM,UAAU,CAAC;AAElB,qBAAa,WAAY,SAAQ,SAAS,CAAC,SAAS,CAAC;IACnD,OAAO,CAAC,MAAM,CAAoB;IAClC,OAAO,CAAC,SAAS,CAAuB;IACxC,OAAO,CAAC,MAAM,CAAa;IAC3B,OAAO,CAAC,gBAAgB,CAAgC;IACxD,OAAO,CAAC,YAAY,CAAsC;IAC1D,OAAO,CAAC,QAAQ,CAA6B;IAC7C,OAAO,CAAC,UAAU,CAAsB;IACxC,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,cAAc,CAAS;
|
|
1
|
+
{"version":3,"file":"PeersCaller.d.ts","sourceRoot":"","sources":["../../src/core/PeersCaller.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAgB,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,EACV,iBAAiB,EACjB,oBAAoB,EAGpB,eAAe,EACf,aAAa,EACb,kBAAkB,EAGnB,MAAM,UAAU,CAAC;AAElB,qBAAa,WAAY,SAAQ,SAAS,CAAC,SAAS,CAAC;IACnD,OAAO,CAAC,MAAM,CAAoB;IAClC,OAAO,CAAC,SAAS,CAAuB;IACxC,OAAO,CAAC,MAAM,CAAa;IAC3B,OAAO,CAAC,gBAAgB,CAAgC;IACxD,OAAO,CAAC,YAAY,CAAsC;IAC1D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,GAAG;IA6BnB;;OAEG;IACH,OAAO,IAAI,IAAI;IAyBf;;OAEG;YACW,0BAA0B;IAyBxC;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAgI5B;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAmB9B;;OAEG;YACW,uBAAuB;IA6ErC;;OAEG;IACG,eAAe,IAAI,OAAO,CAAC,kBAAkB,CAAC;IAiCpD;;OAEG;YACW,WAAW;IAgCzB;;OAEG;YACW,YAAY;IAgC1B;;OAEG;YACW,eAAe;IAmC7B;;OAEG;IACH,OAAO,CAAC,4BAA4B;IAQpC;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAa7B;;OAEG;YACW,eAAe;IAgC7B;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAM5B;;OAEG;IACH,OAAO,CAAC,uBAAuB;IAU/B;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAY9B;;OAEG;IACH,OAAO,CAAC,WAAW;IAMnB;;OAEG;YACW,eAAe;IAiC7B;;OAEG;IACH,OAAO,CAAC,qBAAqB;CAqC9B"}
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -45,7 +45,7 @@ export declare function useParticipantVideo(userId: string): {
|
|
|
45
45
|
* Hook for call state management
|
|
46
46
|
*/
|
|
47
47
|
export declare function useCallState(): {
|
|
48
|
-
|
|
48
|
+
roomId: string;
|
|
49
49
|
participants: Record<string, CallParticipant>;
|
|
50
50
|
localParticipant: CallParticipant | null;
|
|
51
51
|
isCalling: boolean;
|