@defcomm/meetingsdk 0.5.5 → 0.5.6

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
@@ -26,6 +26,8 @@ type Events = {
26
26
  onMeetingLeft?: () => void;
27
27
  onChatMessage?: (msg: ChatMessage) => void;
28
28
  onReaction?: (reaction: Reaction) => void;
29
+ onLiveTranscript?: (transcript: LiveTranscript) => void;
30
+ onNetworkQuality?: (quality: NetworkQuality) => void;
29
31
  onScreenShareStarted?: (peerId: string, stream: MediaStream) => void;
30
32
  onScreenShareStopped?: (peerId: string) => void;
31
33
  onMuteStateChanged?: (peerId: string, kind: "audio" | "video", muted: boolean) => void;
@@ -130,6 +132,30 @@ type MeetingConfig = {
130
132
  videoMuted?: boolean;
131
133
  token: string;
132
134
  };
135
+ type LiveTranscript = {
136
+ transcript_id: string;
137
+ participant_id: string;
138
+ speaker_name?: string | null;
139
+ sequence: number;
140
+ text: string;
141
+ offset_ms?: number | null;
142
+ start_ms?: number | null;
143
+ end_ms?: number | null;
144
+ timestamp: string;
145
+ };
146
+ type NetworkQuality = {
147
+ participant_id: string;
148
+ quality: "excellent" | "good" | "fair" | "poor" | string;
149
+ score: number;
150
+ recommended_action: "maintain" | "reduce_video" | "audio_priority" | string;
151
+ packet_loss_percent: number;
152
+ upload_kbps: number;
153
+ forwarded_drop_percent: number;
154
+ queued_packets: number;
155
+ packets_received: number;
156
+ packets_lost: number;
157
+ observed_at: string;
158
+ };
133
159
  type RecordingInfo = {
134
160
  recording_id: string;
135
161
  started_at?: string;
@@ -138,7 +164,7 @@ type RecordingInfo = {
138
164
  active?: boolean;
139
165
  late_join?: boolean;
140
166
  };
141
- type StateScope = "participants" | "localParticipant" | "chat" | "presenter" | "activeSpeakers" | "recording" | `participant:${string}`;
167
+ type StateScope = "participants" | "localParticipant" | "chat" | "presenter" | "activeSpeakers" | "recording" | "transcript" | "networkQuality" | `participant:${string}`;
142
168
  type SDKError = {
143
169
  code: string;
144
170
  message: string;
@@ -176,6 +202,8 @@ interface VideoSDKCoreOptions {
176
202
  onRoomUpdate?: (data: any) => void;
177
203
  onChatMessage?: (message: ChatMessage) => void;
178
204
  onReaction?: (reaction: Reaction) => void;
205
+ onLiveTranscript?: (transcript: LiveTranscript) => void;
206
+ onNetworkQuality?: (quality: NetworkQuality) => void;
179
207
  onMuteStateChanged?: (peerId: string, kind: "audio" | "video", muted: boolean) => void;
180
208
  }
181
209
  type SFUConnectionState = "idle" | "connecting" | "joining" | "waiting_approval" | "connected" | "reconnecting" | "leaving" | "disconnected";
@@ -207,6 +235,8 @@ declare class MeetingState {
207
235
  presenterId: string | null;
208
236
  activeSpeakerIds: Set<string>;
209
237
  recording: RecordingInfo | null;
238
+ liveTranscripts: LiveTranscript[];
239
+ networkQuality: NetworkQuality | null;
210
240
  private listeners;
211
241
  subscribe(scope: StateScope, fn: Listener): () => void;
212
242
  notify(scope: StateScope): void;
@@ -214,6 +244,10 @@ declare class MeetingState {
214
244
  setActiveSpeakers(ids: string[]): void;
215
245
  setRecording(recording: RecordingInfo | null): void;
216
246
  clearRecording(): void;
247
+ addLiveTranscript(transcript: LiveTranscript): void;
248
+ getLiveTranscripts(): LiveTranscript[];
249
+ clearLiveTranscripts(): void;
250
+ setNetworkQuality(quality: NetworkQuality | null): void;
217
251
  addParticipant(p: Participant): boolean;
218
252
  removeParticipant(id: string): void;
219
253
  updateParticipantMedia(id: string, patch: Partial<NonNullable<Participant["media"]>>): void;
@@ -295,6 +329,10 @@ declare class VideoSDKCore {
295
329
  * to know about those wire-level message types.
296
330
  */
297
331
  publishPubSub<T extends PubSubTopic>(topic: T, data: PubSubTopicConfig[T]["publish"]): void;
332
+ startLiveTranscription(): Promise<void>;
333
+ stopLiveTranscription(): void;
334
+ isLiveTranscriptionActive(): boolean;
335
+ getNetworkQuality(): NetworkQuality | null;
298
336
  private cleanupRemoteParticipant;
299
337
  disconnect(): Promise<void>;
300
338
  private performDisconnect;
@@ -345,6 +383,11 @@ type MeetingContextValue = {
345
383
  messages: ChatMessage[];
346
384
  presenterId: string | null;
347
385
  activeSpeakerIds: string[];
386
+ liveTranscripts: LiveTranscript[];
387
+ networkQuality: NetworkQuality | null;
388
+ startLiveTranscription: () => Promise<void>;
389
+ stopLiveTranscription: () => void;
390
+ isLiveTranscriptionActive: () => boolean;
348
391
  recording: RecordingInfo | null;
349
392
  usePubSub: <T extends PubSubTopic>(topic: T) => PubSubHandleForTopic<T>;
350
393
  onPubSubMessage: <T extends PubSubTopic>(topic: T, cb: (message: PubSubMessage<PubSubTopicConfig[T]["message"]>) => void) => () => void;
@@ -373,6 +416,8 @@ type MeetingContextValue = {
373
416
  onReaction: (cb: (reaction: Reaction) => void) => () => void;
374
417
  onConnectionStateChanged: (cb: (state: SFUConnectionState) => void) => () => void;
375
418
  onActiveSpeakersChanged: (cb: (participantIds: string[]) => void) => () => void;
419
+ onNetworkQuality: (cb: (quality: NetworkQuality) => void) => () => void;
420
+ onLiveTranscript: (cb: (transcript: LiveTranscript) => void) => () => void;
376
421
  };
377
422
  declare const MeetingProvider: ({ config, children, }: {
378
423
  config: MeetingConfig;
@@ -394,6 +439,8 @@ declare const useMeeting: (handlers?: {
394
439
  onReaction?: (reaction: any) => void;
395
440
  onActiveSpeakersChanged?: (participantIds: string[]) => void;
396
441
  onConnectionStateChanged?: (state: SFUConnectionState) => void;
442
+ onLiveTranscript?: (transcript: LiveTranscript) => void;
443
+ onNetworkQuality?: (quality: NetworkQuality) => void;
397
444
  }) => {
398
445
  join: (config?: Omit<MeetingConfig, "participantId" | "token">) => Promise<void>;
399
446
  getJoinState: (roomCode: string) => Promise<JoinState>;
@@ -421,6 +468,11 @@ declare const useMeeting: (handlers?: {
421
468
  messages: ChatMessage[];
422
469
  presenterId: string | null;
423
470
  activeSpeakerIds: string[];
471
+ liveTranscripts: LiveTranscript[];
472
+ networkQuality: NetworkQuality | null;
473
+ startLiveTranscription: () => Promise<void>;
474
+ stopLiveTranscription: () => void;
475
+ isLiveTranscriptionActive: () => boolean;
424
476
  recording: RecordingInfo | null;
425
477
  usePubSub: <T extends PubSubTopic>(topic: T) => PubSubHandleForTopic<T>;
426
478
  onPubSubMessage: <T extends PubSubTopic>(topic: T, cb: (message: PubSubMessage<PubSubTopicConfig[T]["message"]>) => void) => () => void;
@@ -449,6 +501,8 @@ declare const useMeeting: (handlers?: {
449
501
  onReaction: (cb: (reaction: Reaction) => void) => () => void;
450
502
  onConnectionStateChanged: (cb: (state: SFUConnectionState) => void) => () => void;
451
503
  onActiveSpeakersChanged: (cb: (participantIds: string[]) => void) => () => void;
504
+ onNetworkQuality: (cb: (quality: NetworkQuality) => void) => () => void;
505
+ onLiveTranscript: (cb: (transcript: LiveTranscript) => void) => () => void;
452
506
  };
453
507
 
454
508
  declare const useParticipants: () => Participant[];
@@ -496,6 +550,10 @@ declare function useMeetingPreview(roomId: string, participantId: string): {
496
550
  error: string | null;
497
551
  };
498
552
 
553
+ declare const useLiveTranscript: () => LiveTranscript[];
554
+
555
+ declare const useNetworkQuality: () => NetworkQuality | null;
556
+
499
557
  interface ActiveSpeakerDetectorOptions {
500
558
  intervalMs?: number;
501
559
  threshold?: number;
@@ -532,4 +590,4 @@ declare function usePubSub<T extends PubSubTopic>(topic: T, options?: {
532
590
  onMessageReceived?: (message: PubSubMessage<PubSubTopicConfig[T]["message"]>) => void;
533
591
  }): PubSubHandleForTopic<T>;
534
592
 
535
- export { ActiveSpeakerDetector, type ChatInput, type MeetingConfig, MeetingProvider, MeetingState, type Participant, type ParticipantInfo, type PubSubHandle, type PubSubHandleForTopic, type PubSubMessage, type PubSubTopic, type PubSubTopicConfig, type Reaction, type RecordingInfo, type SFUConnectionState, type TrackInfo, VideoSDKCore, useLocalParticipant, useMeeting, useMeetingContext, useMeetingPreview, useParticipants, usePubSub, useRemoteMedia };
593
+ export { ActiveSpeakerDetector, type ChatInput, type LiveTranscript, type MeetingConfig, MeetingProvider, MeetingState, type NetworkQuality, type Participant, type ParticipantInfo, type PubSubHandle, type PubSubHandleForTopic, type PubSubMessage, type PubSubTopic, type PubSubTopicConfig, type Reaction, type RecordingInfo, type SFUConnectionState, type TrackInfo, VideoSDKCore, useLiveTranscript, useLocalParticipant, useMeeting, useMeetingContext, useMeetingPreview, useNetworkQuality, useParticipants, usePubSub, useRemoteMedia };
package/dist/index.d.ts CHANGED
@@ -26,6 +26,8 @@ type Events = {
26
26
  onMeetingLeft?: () => void;
27
27
  onChatMessage?: (msg: ChatMessage) => void;
28
28
  onReaction?: (reaction: Reaction) => void;
29
+ onLiveTranscript?: (transcript: LiveTranscript) => void;
30
+ onNetworkQuality?: (quality: NetworkQuality) => void;
29
31
  onScreenShareStarted?: (peerId: string, stream: MediaStream) => void;
30
32
  onScreenShareStopped?: (peerId: string) => void;
31
33
  onMuteStateChanged?: (peerId: string, kind: "audio" | "video", muted: boolean) => void;
@@ -130,6 +132,30 @@ type MeetingConfig = {
130
132
  videoMuted?: boolean;
131
133
  token: string;
132
134
  };
135
+ type LiveTranscript = {
136
+ transcript_id: string;
137
+ participant_id: string;
138
+ speaker_name?: string | null;
139
+ sequence: number;
140
+ text: string;
141
+ offset_ms?: number | null;
142
+ start_ms?: number | null;
143
+ end_ms?: number | null;
144
+ timestamp: string;
145
+ };
146
+ type NetworkQuality = {
147
+ participant_id: string;
148
+ quality: "excellent" | "good" | "fair" | "poor" | string;
149
+ score: number;
150
+ recommended_action: "maintain" | "reduce_video" | "audio_priority" | string;
151
+ packet_loss_percent: number;
152
+ upload_kbps: number;
153
+ forwarded_drop_percent: number;
154
+ queued_packets: number;
155
+ packets_received: number;
156
+ packets_lost: number;
157
+ observed_at: string;
158
+ };
133
159
  type RecordingInfo = {
134
160
  recording_id: string;
135
161
  started_at?: string;
@@ -138,7 +164,7 @@ type RecordingInfo = {
138
164
  active?: boolean;
139
165
  late_join?: boolean;
140
166
  };
141
- type StateScope = "participants" | "localParticipant" | "chat" | "presenter" | "activeSpeakers" | "recording" | `participant:${string}`;
167
+ type StateScope = "participants" | "localParticipant" | "chat" | "presenter" | "activeSpeakers" | "recording" | "transcript" | "networkQuality" | `participant:${string}`;
142
168
  type SDKError = {
143
169
  code: string;
144
170
  message: string;
@@ -176,6 +202,8 @@ interface VideoSDKCoreOptions {
176
202
  onRoomUpdate?: (data: any) => void;
177
203
  onChatMessage?: (message: ChatMessage) => void;
178
204
  onReaction?: (reaction: Reaction) => void;
205
+ onLiveTranscript?: (transcript: LiveTranscript) => void;
206
+ onNetworkQuality?: (quality: NetworkQuality) => void;
179
207
  onMuteStateChanged?: (peerId: string, kind: "audio" | "video", muted: boolean) => void;
180
208
  }
181
209
  type SFUConnectionState = "idle" | "connecting" | "joining" | "waiting_approval" | "connected" | "reconnecting" | "leaving" | "disconnected";
@@ -207,6 +235,8 @@ declare class MeetingState {
207
235
  presenterId: string | null;
208
236
  activeSpeakerIds: Set<string>;
209
237
  recording: RecordingInfo | null;
238
+ liveTranscripts: LiveTranscript[];
239
+ networkQuality: NetworkQuality | null;
210
240
  private listeners;
211
241
  subscribe(scope: StateScope, fn: Listener): () => void;
212
242
  notify(scope: StateScope): void;
@@ -214,6 +244,10 @@ declare class MeetingState {
214
244
  setActiveSpeakers(ids: string[]): void;
215
245
  setRecording(recording: RecordingInfo | null): void;
216
246
  clearRecording(): void;
247
+ addLiveTranscript(transcript: LiveTranscript): void;
248
+ getLiveTranscripts(): LiveTranscript[];
249
+ clearLiveTranscripts(): void;
250
+ setNetworkQuality(quality: NetworkQuality | null): void;
217
251
  addParticipant(p: Participant): boolean;
218
252
  removeParticipant(id: string): void;
219
253
  updateParticipantMedia(id: string, patch: Partial<NonNullable<Participant["media"]>>): void;
@@ -295,6 +329,10 @@ declare class VideoSDKCore {
295
329
  * to know about those wire-level message types.
296
330
  */
297
331
  publishPubSub<T extends PubSubTopic>(topic: T, data: PubSubTopicConfig[T]["publish"]): void;
332
+ startLiveTranscription(): Promise<void>;
333
+ stopLiveTranscription(): void;
334
+ isLiveTranscriptionActive(): boolean;
335
+ getNetworkQuality(): NetworkQuality | null;
298
336
  private cleanupRemoteParticipant;
299
337
  disconnect(): Promise<void>;
300
338
  private performDisconnect;
@@ -345,6 +383,11 @@ type MeetingContextValue = {
345
383
  messages: ChatMessage[];
346
384
  presenterId: string | null;
347
385
  activeSpeakerIds: string[];
386
+ liveTranscripts: LiveTranscript[];
387
+ networkQuality: NetworkQuality | null;
388
+ startLiveTranscription: () => Promise<void>;
389
+ stopLiveTranscription: () => void;
390
+ isLiveTranscriptionActive: () => boolean;
348
391
  recording: RecordingInfo | null;
349
392
  usePubSub: <T extends PubSubTopic>(topic: T) => PubSubHandleForTopic<T>;
350
393
  onPubSubMessage: <T extends PubSubTopic>(topic: T, cb: (message: PubSubMessage<PubSubTopicConfig[T]["message"]>) => void) => () => void;
@@ -373,6 +416,8 @@ type MeetingContextValue = {
373
416
  onReaction: (cb: (reaction: Reaction) => void) => () => void;
374
417
  onConnectionStateChanged: (cb: (state: SFUConnectionState) => void) => () => void;
375
418
  onActiveSpeakersChanged: (cb: (participantIds: string[]) => void) => () => void;
419
+ onNetworkQuality: (cb: (quality: NetworkQuality) => void) => () => void;
420
+ onLiveTranscript: (cb: (transcript: LiveTranscript) => void) => () => void;
376
421
  };
377
422
  declare const MeetingProvider: ({ config, children, }: {
378
423
  config: MeetingConfig;
@@ -394,6 +439,8 @@ declare const useMeeting: (handlers?: {
394
439
  onReaction?: (reaction: any) => void;
395
440
  onActiveSpeakersChanged?: (participantIds: string[]) => void;
396
441
  onConnectionStateChanged?: (state: SFUConnectionState) => void;
442
+ onLiveTranscript?: (transcript: LiveTranscript) => void;
443
+ onNetworkQuality?: (quality: NetworkQuality) => void;
397
444
  }) => {
398
445
  join: (config?: Omit<MeetingConfig, "participantId" | "token">) => Promise<void>;
399
446
  getJoinState: (roomCode: string) => Promise<JoinState>;
@@ -421,6 +468,11 @@ declare const useMeeting: (handlers?: {
421
468
  messages: ChatMessage[];
422
469
  presenterId: string | null;
423
470
  activeSpeakerIds: string[];
471
+ liveTranscripts: LiveTranscript[];
472
+ networkQuality: NetworkQuality | null;
473
+ startLiveTranscription: () => Promise<void>;
474
+ stopLiveTranscription: () => void;
475
+ isLiveTranscriptionActive: () => boolean;
424
476
  recording: RecordingInfo | null;
425
477
  usePubSub: <T extends PubSubTopic>(topic: T) => PubSubHandleForTopic<T>;
426
478
  onPubSubMessage: <T extends PubSubTopic>(topic: T, cb: (message: PubSubMessage<PubSubTopicConfig[T]["message"]>) => void) => () => void;
@@ -449,6 +501,8 @@ declare const useMeeting: (handlers?: {
449
501
  onReaction: (cb: (reaction: Reaction) => void) => () => void;
450
502
  onConnectionStateChanged: (cb: (state: SFUConnectionState) => void) => () => void;
451
503
  onActiveSpeakersChanged: (cb: (participantIds: string[]) => void) => () => void;
504
+ onNetworkQuality: (cb: (quality: NetworkQuality) => void) => () => void;
505
+ onLiveTranscript: (cb: (transcript: LiveTranscript) => void) => () => void;
452
506
  };
453
507
 
454
508
  declare const useParticipants: () => Participant[];
@@ -496,6 +550,10 @@ declare function useMeetingPreview(roomId: string, participantId: string): {
496
550
  error: string | null;
497
551
  };
498
552
 
553
+ declare const useLiveTranscript: () => LiveTranscript[];
554
+
555
+ declare const useNetworkQuality: () => NetworkQuality | null;
556
+
499
557
  interface ActiveSpeakerDetectorOptions {
500
558
  intervalMs?: number;
501
559
  threshold?: number;
@@ -532,4 +590,4 @@ declare function usePubSub<T extends PubSubTopic>(topic: T, options?: {
532
590
  onMessageReceived?: (message: PubSubMessage<PubSubTopicConfig[T]["message"]>) => void;
533
591
  }): PubSubHandleForTopic<T>;
534
592
 
535
- export { ActiveSpeakerDetector, type ChatInput, type MeetingConfig, MeetingProvider, MeetingState, type Participant, type ParticipantInfo, type PubSubHandle, type PubSubHandleForTopic, type PubSubMessage, type PubSubTopic, type PubSubTopicConfig, type Reaction, type RecordingInfo, type SFUConnectionState, type TrackInfo, VideoSDKCore, useLocalParticipant, useMeeting, useMeetingContext, useMeetingPreview, useParticipants, usePubSub, useRemoteMedia };
593
+ export { ActiveSpeakerDetector, type ChatInput, type LiveTranscript, type MeetingConfig, MeetingProvider, MeetingState, type NetworkQuality, type Participant, type ParticipantInfo, type PubSubHandle, type PubSubHandleForTopic, type PubSubMessage, type PubSubTopic, type PubSubTopicConfig, type Reaction, type RecordingInfo, type SFUConnectionState, type TrackInfo, VideoSDKCore, useLiveTranscript, useLocalParticipant, useMeeting, useMeetingContext, useMeetingPreview, useNetworkQuality, useParticipants, usePubSub, useRemoteMedia };