@defcomm/meetingsdk 0.2.6 → 0.2.8

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/dist/index.d.mts CHANGED
@@ -22,6 +22,7 @@ type Events = {
22
22
  onUserLeft?: (id: string) => void;
23
23
  onMeetingLeft?: () => void;
24
24
  onChatMessage?: (msg: ChatMessage) => void;
25
+ onReaction?: (reaction: Reaction) => void;
25
26
  onScreenShareStarted?: (peerId: string, stream: MediaStream) => void;
26
27
  onScreenShareStopped?: (peerId: string) => void;
27
28
  onMuteStateChanged?: (peerId: string, kind: "audio" | "video", muted: boolean) => void;
@@ -39,6 +40,13 @@ type Events = {
39
40
  stopped_at: string;
40
41
  }) => void;
41
42
  };
43
+ type Reaction = {
44
+ id: string;
45
+ participant_id: string;
46
+ sender_name?: string | null;
47
+ emoji: string;
48
+ timestamp: string | number;
49
+ };
42
50
  type ChatMessage = {
43
51
  id: string;
44
52
  text: string;
@@ -130,6 +138,9 @@ interface VideoSDKCoreOptions {
130
138
  onTrackStateChanged?: (track: any) => void;
131
139
  onRecordingStarted?: (recording: any) => void;
132
140
  onRecordingStopped?: (recording: any) => void;
141
+ onRoomUpdate?: (data: any) => void;
142
+ onChatMessage?: (message: ChatMessage) => void;
143
+ onMuteStateChanged?: (peerId: string, kind: "audio" | "video", muted: boolean) => void;
133
144
  }
134
145
 
135
146
  declare const useLocalParticipant: () => {
@@ -216,6 +227,7 @@ declare class VideoSDKCore {
216
227
  recording: RecordingInfo | null;
217
228
  }>;
218
229
  sendChatMessage(payload: ChatInput): void;
230
+ sendReaction(reaction: string): void;
219
231
  private cleanupRemoteParticipant;
220
232
  disconnect(): Promise<void>;
221
233
  private performDisconnect;
@@ -281,6 +293,10 @@ interface SFUClientOptions {
281
293
  stopped_at: string;
282
294
  }) => void;
283
295
  onError?: (error: any) => void;
296
+ onChatMessage?: (message: any) => void;
297
+ onReaction?: (reaction: any) => void;
298
+ onRoomUpdate?: (data: any) => void;
299
+ onParticipantMediaState?: (participantId: string, audioMuted: boolean, videoMuted: boolean) => void;
284
300
  autoSubscribe?: boolean;
285
301
  }
286
302
  declare class SFUClient {
@@ -301,6 +317,7 @@ declare class SFUClient {
301
317
  private iceServers;
302
318
  private requestId;
303
319
  private publisherRevision;
320
+ private screenShareGeneration;
304
321
  private currentParticipantId;
305
322
  private token;
306
323
  private room;
@@ -311,6 +328,8 @@ declare class SFUClient {
311
328
  private intentionalClose;
312
329
  private leaveAcknowledged;
313
330
  private joiningWithResume;
331
+ private desiredAudioMuted;
332
+ private desiredVideoMuted;
314
333
  private reconnectTimer;
315
334
  private reconnectAttempt;
316
335
  private maxReconnectAttempts;
@@ -353,6 +372,10 @@ declare class SFUClient {
353
372
  private onRecordingStarted;
354
373
  private onRecordingStopped;
355
374
  private onError;
375
+ private onChatMessage;
376
+ private onReaction;
377
+ private onRoomUpdate;
378
+ private onParticipantMediaState;
356
379
  private autoSubscribe;
357
380
  constructor(options?: SFUClientOptions);
358
381
  private heartbeatTimer;
@@ -384,6 +407,8 @@ declare class SFUClient {
384
407
  displayName?: string;
385
408
  avatarUrl?: string;
386
409
  participantId?: string;
410
+ audioMuted?: boolean;
411
+ videoMuted?: boolean;
387
412
  }): Promise<void>;
388
413
  private refreshAccessToken;
389
414
  private connect;
@@ -392,6 +417,7 @@ declare class SFUClient {
392
417
  private failJoin;
393
418
  private resolveJoin;
394
419
  private handleServerMessage;
420
+ private onRoomStateReconciled;
395
421
  private rememberTrack;
396
422
  private handleJoined;
397
423
  private initializePeerConnections;
@@ -414,6 +440,11 @@ declare class SFUClient {
414
440
  stopScreenShare(): Promise<void>;
415
441
  muteAudio(muted: boolean): void;
416
442
  muteVideo(muted: boolean): void;
443
+ sendChatMessage(input: {
444
+ message: string;
445
+ reply_to?: any;
446
+ target?: string | null;
447
+ }): boolean;
417
448
  startRecording(): Promise<void>;
418
449
  stopRecording(): Promise<void>;
419
450
  getRecordingStatus(): Promise<any>;
@@ -421,6 +452,7 @@ declare class SFUClient {
421
452
  rejectJoinRequest(requestId: string, reason?: string): Promise<void>;
422
453
  private isSocketOpen;
423
454
  private send;
455
+ sendReaction(reaction: string): void;
424
456
  private removeRemoteParticipant;
425
457
  leave(): Promise<void>;
426
458
  private closePeerConnectionsOnly;
@@ -450,6 +482,7 @@ type MeetingContextValue = {
450
482
  startScreenShare: () => Promise<MediaStream>;
451
483
  stopScreenShare: () => void;
452
484
  sendMessage: (input: ChatInput) => void;
485
+ sendReaction: (emoji: string) => void;
453
486
  room: {
454
487
  id: string | null;
455
488
  name: string | null;
@@ -472,6 +505,7 @@ type MeetingContextValue = {
472
505
  onTrackStateChanged: (cb: (track: any) => void) => () => void;
473
506
  onRecordingStarted: (cb: (recording: Recording) => void) => () => void;
474
507
  onRecordingStopped: (cb: (recording: any) => void) => () => void;
508
+ onReaction: (cb: (reaction: Reaction) => void) => () => void;
475
509
  onActiveSpeakersChanged: (cb: (participantIds: string[]) => void) => () => void;
476
510
  };
477
511
  declare const MeetingProvider: ({ config, children, }: {
@@ -488,6 +522,7 @@ declare const useMeeting: (handlers?: {
488
522
  onTrackStateChanged?: (track: any) => void;
489
523
  onRecordingStarted?: (recording: any) => void;
490
524
  onRecordingStopped?: (recording: any) => void;
525
+ onReaction?: (reaction: any) => void;
491
526
  onActiveSpeakersChanged?: (participantIds: string[]) => void;
492
527
  }) => {
493
528
  join: (config?: Omit<MeetingConfig, "participantId">) => Promise<void>;
@@ -505,6 +540,7 @@ declare const useMeeting: (handlers?: {
505
540
  startScreenShare: () => Promise<MediaStream>;
506
541
  stopScreenShare: () => void;
507
542
  sendMessage: (input: ChatInput) => void;
543
+ sendReaction: (emoji: string) => void;
508
544
  room: {
509
545
  id: string | null;
510
546
  name: string | null;
@@ -530,6 +566,7 @@ declare const useMeeting: (handlers?: {
530
566
  onTrackStateChanged: (cb: (track: any) => void) => () => void;
531
567
  onRecordingStarted: (cb: (recording: Recording) => void) => () => void;
532
568
  onRecordingStopped: (cb: (recording: any) => void) => () => void;
569
+ onReaction: (cb: (reaction: Reaction) => void) => () => void;
533
570
  onActiveSpeakersChanged: (cb: (participantIds: string[]) => void) => () => void;
534
571
  };
535
572
 
@@ -610,4 +647,4 @@ declare class ActiveSpeakerDetector {
610
647
  destroy(): Promise<void>;
611
648
  }
612
649
 
613
- export { ActiveSpeakerDetector, type ChatInput, type MeetingConfig, MeetingProvider, MeetingState, type Participant, type ParticipantInfo, type RecordingInfo, SFUClient, type SFUConnectionState, type TrackInfo, VideoSDKCore, useLocalParticipant, useMeeting, useMeetingContext, useMeetingPreview, useParticipants, useRemoteMedia };
650
+ export { ActiveSpeakerDetector, type ChatInput, type MeetingConfig, MeetingProvider, MeetingState, type Participant, type ParticipantInfo, type Reaction, type RecordingInfo, SFUClient, type SFUConnectionState, type TrackInfo, VideoSDKCore, useLocalParticipant, useMeeting, useMeetingContext, useMeetingPreview, useParticipants, useRemoteMedia };
package/dist/index.d.ts CHANGED
@@ -22,6 +22,7 @@ type Events = {
22
22
  onUserLeft?: (id: string) => void;
23
23
  onMeetingLeft?: () => void;
24
24
  onChatMessage?: (msg: ChatMessage) => void;
25
+ onReaction?: (reaction: Reaction) => void;
25
26
  onScreenShareStarted?: (peerId: string, stream: MediaStream) => void;
26
27
  onScreenShareStopped?: (peerId: string) => void;
27
28
  onMuteStateChanged?: (peerId: string, kind: "audio" | "video", muted: boolean) => void;
@@ -39,6 +40,13 @@ type Events = {
39
40
  stopped_at: string;
40
41
  }) => void;
41
42
  };
43
+ type Reaction = {
44
+ id: string;
45
+ participant_id: string;
46
+ sender_name?: string | null;
47
+ emoji: string;
48
+ timestamp: string | number;
49
+ };
42
50
  type ChatMessage = {
43
51
  id: string;
44
52
  text: string;
@@ -130,6 +138,9 @@ interface VideoSDKCoreOptions {
130
138
  onTrackStateChanged?: (track: any) => void;
131
139
  onRecordingStarted?: (recording: any) => void;
132
140
  onRecordingStopped?: (recording: any) => void;
141
+ onRoomUpdate?: (data: any) => void;
142
+ onChatMessage?: (message: ChatMessage) => void;
143
+ onMuteStateChanged?: (peerId: string, kind: "audio" | "video", muted: boolean) => void;
133
144
  }
134
145
 
135
146
  declare const useLocalParticipant: () => {
@@ -216,6 +227,7 @@ declare class VideoSDKCore {
216
227
  recording: RecordingInfo | null;
217
228
  }>;
218
229
  sendChatMessage(payload: ChatInput): void;
230
+ sendReaction(reaction: string): void;
219
231
  private cleanupRemoteParticipant;
220
232
  disconnect(): Promise<void>;
221
233
  private performDisconnect;
@@ -281,6 +293,10 @@ interface SFUClientOptions {
281
293
  stopped_at: string;
282
294
  }) => void;
283
295
  onError?: (error: any) => void;
296
+ onChatMessage?: (message: any) => void;
297
+ onReaction?: (reaction: any) => void;
298
+ onRoomUpdate?: (data: any) => void;
299
+ onParticipantMediaState?: (participantId: string, audioMuted: boolean, videoMuted: boolean) => void;
284
300
  autoSubscribe?: boolean;
285
301
  }
286
302
  declare class SFUClient {
@@ -301,6 +317,7 @@ declare class SFUClient {
301
317
  private iceServers;
302
318
  private requestId;
303
319
  private publisherRevision;
320
+ private screenShareGeneration;
304
321
  private currentParticipantId;
305
322
  private token;
306
323
  private room;
@@ -311,6 +328,8 @@ declare class SFUClient {
311
328
  private intentionalClose;
312
329
  private leaveAcknowledged;
313
330
  private joiningWithResume;
331
+ private desiredAudioMuted;
332
+ private desiredVideoMuted;
314
333
  private reconnectTimer;
315
334
  private reconnectAttempt;
316
335
  private maxReconnectAttempts;
@@ -353,6 +372,10 @@ declare class SFUClient {
353
372
  private onRecordingStarted;
354
373
  private onRecordingStopped;
355
374
  private onError;
375
+ private onChatMessage;
376
+ private onReaction;
377
+ private onRoomUpdate;
378
+ private onParticipantMediaState;
356
379
  private autoSubscribe;
357
380
  constructor(options?: SFUClientOptions);
358
381
  private heartbeatTimer;
@@ -384,6 +407,8 @@ declare class SFUClient {
384
407
  displayName?: string;
385
408
  avatarUrl?: string;
386
409
  participantId?: string;
410
+ audioMuted?: boolean;
411
+ videoMuted?: boolean;
387
412
  }): Promise<void>;
388
413
  private refreshAccessToken;
389
414
  private connect;
@@ -392,6 +417,7 @@ declare class SFUClient {
392
417
  private failJoin;
393
418
  private resolveJoin;
394
419
  private handleServerMessage;
420
+ private onRoomStateReconciled;
395
421
  private rememberTrack;
396
422
  private handleJoined;
397
423
  private initializePeerConnections;
@@ -414,6 +440,11 @@ declare class SFUClient {
414
440
  stopScreenShare(): Promise<void>;
415
441
  muteAudio(muted: boolean): void;
416
442
  muteVideo(muted: boolean): void;
443
+ sendChatMessage(input: {
444
+ message: string;
445
+ reply_to?: any;
446
+ target?: string | null;
447
+ }): boolean;
417
448
  startRecording(): Promise<void>;
418
449
  stopRecording(): Promise<void>;
419
450
  getRecordingStatus(): Promise<any>;
@@ -421,6 +452,7 @@ declare class SFUClient {
421
452
  rejectJoinRequest(requestId: string, reason?: string): Promise<void>;
422
453
  private isSocketOpen;
423
454
  private send;
455
+ sendReaction(reaction: string): void;
424
456
  private removeRemoteParticipant;
425
457
  leave(): Promise<void>;
426
458
  private closePeerConnectionsOnly;
@@ -450,6 +482,7 @@ type MeetingContextValue = {
450
482
  startScreenShare: () => Promise<MediaStream>;
451
483
  stopScreenShare: () => void;
452
484
  sendMessage: (input: ChatInput) => void;
485
+ sendReaction: (emoji: string) => void;
453
486
  room: {
454
487
  id: string | null;
455
488
  name: string | null;
@@ -472,6 +505,7 @@ type MeetingContextValue = {
472
505
  onTrackStateChanged: (cb: (track: any) => void) => () => void;
473
506
  onRecordingStarted: (cb: (recording: Recording) => void) => () => void;
474
507
  onRecordingStopped: (cb: (recording: any) => void) => () => void;
508
+ onReaction: (cb: (reaction: Reaction) => void) => () => void;
475
509
  onActiveSpeakersChanged: (cb: (participantIds: string[]) => void) => () => void;
476
510
  };
477
511
  declare const MeetingProvider: ({ config, children, }: {
@@ -488,6 +522,7 @@ declare const useMeeting: (handlers?: {
488
522
  onTrackStateChanged?: (track: any) => void;
489
523
  onRecordingStarted?: (recording: any) => void;
490
524
  onRecordingStopped?: (recording: any) => void;
525
+ onReaction?: (reaction: any) => void;
491
526
  onActiveSpeakersChanged?: (participantIds: string[]) => void;
492
527
  }) => {
493
528
  join: (config?: Omit<MeetingConfig, "participantId">) => Promise<void>;
@@ -505,6 +540,7 @@ declare const useMeeting: (handlers?: {
505
540
  startScreenShare: () => Promise<MediaStream>;
506
541
  stopScreenShare: () => void;
507
542
  sendMessage: (input: ChatInput) => void;
543
+ sendReaction: (emoji: string) => void;
508
544
  room: {
509
545
  id: string | null;
510
546
  name: string | null;
@@ -530,6 +566,7 @@ declare const useMeeting: (handlers?: {
530
566
  onTrackStateChanged: (cb: (track: any) => void) => () => void;
531
567
  onRecordingStarted: (cb: (recording: Recording) => void) => () => void;
532
568
  onRecordingStopped: (cb: (recording: any) => void) => () => void;
569
+ onReaction: (cb: (reaction: Reaction) => void) => () => void;
533
570
  onActiveSpeakersChanged: (cb: (participantIds: string[]) => void) => () => void;
534
571
  };
535
572
 
@@ -610,4 +647,4 @@ declare class ActiveSpeakerDetector {
610
647
  destroy(): Promise<void>;
611
648
  }
612
649
 
613
- export { ActiveSpeakerDetector, type ChatInput, type MeetingConfig, MeetingProvider, MeetingState, type Participant, type ParticipantInfo, type RecordingInfo, SFUClient, type SFUConnectionState, type TrackInfo, VideoSDKCore, useLocalParticipant, useMeeting, useMeetingContext, useMeetingPreview, useParticipants, useRemoteMedia };
650
+ export { ActiveSpeakerDetector, type ChatInput, type MeetingConfig, MeetingProvider, MeetingState, type Participant, type ParticipantInfo, type Reaction, type RecordingInfo, SFUClient, type SFUConnectionState, type TrackInfo, VideoSDKCore, useLocalParticipant, useMeeting, useMeetingContext, useMeetingPreview, useParticipants, useRemoteMedia };