@videosdk.live/react-sdk 0.1.104 → 0.2.0

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.
@@ -44,13 +44,15 @@ import { Character, CharacterMode, CharacterState } from './character';
44
44
  * ---
45
45
  * @param config.mode -
46
46
  *
47
- * - There are 2 types of modes:
47
+ * - There are 3 types of modes:
48
+ *
49
+ * - **SEND_AND_RECV**: Both audio and video streams will be produced and consumed in this mode.
50
+ *
51
+ * - **RECV_ONLY**: Both audio and video streams will be only consumed in this mode.
52
+ *
53
+ * - **SIGNALLING_ONLY**: Audio and video streams will not be produced or consumed in this mode.
48
54
  *
49
- * - **CONFERENCE**: Both audio and video streams will be produced and consumed in this mode.
50
- *
51
- * - **VIEWER**: Audio and video streams will not be produced or consumed in this mode.
52
- *
53
- * - defaultValue : **CONFERENCE**
55
+ * - defaultValue : **SEND_AND_RECV**
54
56
  *
55
57
  * ---
56
58
  *
@@ -95,7 +97,7 @@ export function MeetingProvider({
95
97
  customCameraVideoTrack?: MediaStream | undefined;
96
98
  customMicrophoneAudioTrack?: MediaStream | undefined;
97
99
  multiStream?: boolean;
98
- mode?: 'CONFERENCE' | 'VIEWER';
100
+ mode?: 'SEND_AND_RECV' | 'SIGNALLING_ONLY' | 'RECV_ONLY';
99
101
  metaData?: object;
100
102
  defaultCamera?: 'front' | 'back';
101
103
  debugMode: boolean;
@@ -164,8 +166,9 @@ export function MeetingProvider({
164
166
  * @param onParticipantModeChanged -
165
167
  * - This event will be triggered when mode gets chanded.
166
168
  * - It will pass mode, as an event callback parameter.
167
- * - **CONFERENCE** : Both audio and video streams will be produced and consumed in this mode.
168
- * - **VIEWER** : Audio and video streams will not be produced or consumed in this mode.
169
+ * - **SEND_AND_RECV**: Both audio and video streams will be produced and consumed in this mode.
170
+ * - **RECV_ONLY**: Both audio and video streams will be only consumed in this mode.
171
+ * - **SIGNALLING_ONLY**: Audio and video streams will not be produced or consumed in this mode.
169
172
  */
170
173
 
171
174
  export function MeetingConsumer({
@@ -280,11 +283,11 @@ export function MeetingConsumer({
280
283
  livestreamUrl
281
284
  }: {
282
285
  status:
283
- | 'HLS_STARTING'
284
- | 'HLS_STARTED'
285
- | 'HLS_PLAYABLE'
286
- | 'HLS_STOPPING'
287
- | 'HLS_STOPPED';
286
+ | 'HLS_STARTING'
287
+ | 'HLS_STARTED'
288
+ | 'HLS_PLAYABLE'
289
+ | 'HLS_STOPPING'
290
+ | 'HLS_STOPPED';
288
291
  downstreamUrl?: string;
289
292
  playbackHlsUrl?: string;
290
293
  livestreamUrl?: string;
@@ -293,37 +296,37 @@ export function MeetingConsumer({
293
296
  status
294
297
  }: {
295
298
  status:
296
- | 'RECORDING_STARTING'
297
- | 'RECORDING_STARTED'
298
- | 'RECORDING_STOPPING'
299
- | 'RECORDING_STOPPED';
299
+ | 'RECORDING_STARTING'
300
+ | 'RECORDING_STARTED'
301
+ | 'RECORDING_STOPPING'
302
+ | 'RECORDING_STOPPED';
300
303
  }) => void;
301
304
  onLivestreamStateChanged?: ({
302
305
  status
303
306
  }: {
304
307
  status:
305
- | 'LIVESTREAM_STARTING'
306
- | 'LIVESTREAM_STARTED'
307
- | 'LIVESTREAM_STOPPING'
308
- | 'LIVESTREAM_STOPPED';
308
+ | 'LIVESTREAM_STARTING'
309
+ | 'LIVESTREAM_STARTED'
310
+ | 'LIVESTREAM_STOPPING'
311
+ | 'LIVESTREAM_STOPPED';
309
312
  }) => void;
310
313
  onMeetingStateChanged?: ({
311
314
  state
312
315
  }: {
313
316
  state:
314
- | 'CONNECTING'
315
- | 'CONNECTED'
316
- | 'FAILED'
317
- | 'DISCONNECTED'
318
- | 'CLOSING'
319
- | 'CLOSED';
317
+ | 'CONNECTING'
318
+ | 'CONNECTED'
319
+ | 'FAILED'
320
+ | 'DISCONNECTED'
321
+ | 'CLOSING'
322
+ | 'CLOSED';
320
323
  }) => void;
321
324
  onParticipantModeChanged?: ({
322
325
  participantId,
323
326
  mode
324
327
  }: {
325
328
  participantId: string;
326
- mode: 'CONFERENCE' | 'VIEWER';
329
+ mode: 'SEND_AND_RECV' | 'SIGNALLING_ONLY' | 'RECV_ONLY'
327
330
  }) => void;
328
331
  }): any;
329
332
 
@@ -460,7 +463,7 @@ export function useParticipant(
460
463
  isActiveSpeaker: boolean;
461
464
  isMainParticipant: boolean;
462
465
  pinState: any;
463
- mode: 'CONFERENCE' | 'VIEWER';
466
+ mode: 'SEND_AND_RECV' | 'SIGNALLING_ONLY' | 'RECV_ONLY'
464
467
  consumeMicStreams: () => void;
465
468
  consumeWebcamStreams: () => void;
466
469
  stopConsumingMicStreams: () => void;
@@ -620,8 +623,9 @@ export function useParticipant(
620
623
  * @param onParticipantModeChanged -
621
624
  * - This event will be triggered when mode gets chanded.
622
625
  * - It will pass mode, as an event callback parameter.
623
- * - **CONFERENCE** : Both audio and video streams will be produced and consumed in this mode.
624
- * - **VIEWER** : Audio and video streams will not be produced or consumed in this mode.
626
+ * - **SEND_AND_RECV**: Both audio and video streams will be produced and consumed in this mode.
627
+ * - **RECV_ONLY**: Both audio and video streams will be only consumed in this mode.
628
+ * - **SIGNALLING_ONLY**: Audio and video streams will not be produced or consumed in this mode.
625
629
  * ---
626
630
  * @returns This will return Meeting properties and method. You can refer this [API Reference](https://docs.videosdk.live/react/api/sdk-reference/use-meeting/introduction)
627
631
  *
@@ -739,11 +743,11 @@ export function useMeeting({
739
743
  livestreamUrl
740
744
  }: {
741
745
  status:
742
- | 'HLS_STARTING'
743
- | 'HLS_STARTED'
744
- | 'HLS_PLAYABLE'
745
- | 'HLS_STOPPING'
746
- | 'HLS_STOPPED';
746
+ | 'HLS_STARTING'
747
+ | 'HLS_STARTED'
748
+ | 'HLS_PLAYABLE'
749
+ | 'HLS_STOPPING'
750
+ | 'HLS_STOPPED';
747
751
  downstreamUrl?: string;
748
752
  playbackHlsUrl?: string;
749
753
  livestreamUrl?: string;
@@ -752,37 +756,37 @@ export function useMeeting({
752
756
  status
753
757
  }: {
754
758
  status:
755
- | 'RECORDING_STARTING'
756
- | 'RECORDING_STARTED'
757
- | 'RECORDING_STOPPING'
758
- | 'RECORDING_STOPPED';
759
+ | 'RECORDING_STARTING'
760
+ | 'RECORDING_STARTED'
761
+ | 'RECORDING_STOPPING'
762
+ | 'RECORDING_STOPPED';
759
763
  }) => void;
760
764
  onLivestreamStateChanged?: ({
761
765
  status
762
766
  }: {
763
767
  status:
764
- | 'LIVESTREAM_STARTING'
765
- | 'LIVESTREAM_STARTED'
766
- | 'LIVESTREAM_STOPPING'
767
- | 'LIVESTREAM_STOPPED';
768
+ | 'LIVESTREAM_STARTING'
769
+ | 'LIVESTREAM_STARTED'
770
+ | 'LIVESTREAM_STOPPING'
771
+ | 'LIVESTREAM_STOPPED';
768
772
  }) => void;
769
773
  onMeetingStateChanged?: ({
770
774
  state
771
775
  }: {
772
776
  state:
773
- | 'CONNECTING'
774
- | 'CONNECTED'
775
- | 'FAILED'
776
- | 'DISCONNECTED'
777
- | 'CLOSING'
778
- | 'CLOSED';
777
+ | 'CONNECTING'
778
+ | 'CONNECTED'
779
+ | 'FAILED'
780
+ | 'DISCONNECTED'
781
+ | 'CLOSING'
782
+ | 'CLOSED';
779
783
  }) => void;
780
784
  onParticipantModeChanged?: ({
781
785
  participantId,
782
786
  mode
783
787
  }: {
784
788
  participantId: string;
785
- mode: 'CONFERENCE' | 'VIEWER';
789
+ mode: 'SEND_AND_RECV' | 'SIGNALLING_ONLY' | 'RECV_ONLY'
786
790
  }) => void;
787
791
  onCharacterJoined?: (character: Character) => void;
788
792
  onCharacterLeft?: (character: Character) => void;
@@ -852,6 +856,14 @@ export function useMeeting({
852
856
  theme: 'DEFAULT' | 'DARK' | 'LIGHT';
853
857
  quality: 'low' | 'med' | 'high';
854
858
  mode: 'video-and-audio' | 'audio';
859
+ },
860
+ transcription?: {
861
+ enabled: boolean;
862
+ summary?: {
863
+ enabled: boolean;
864
+ prompt?: string;
865
+ };
866
+ language?: string;
855
867
  }
856
868
  ) => void;
857
869
  stopRecording: () => void;
@@ -897,7 +909,7 @@ export function useMeeting({
897
909
  >;
898
910
  changeMic: (object: string | MediaStream) => void;
899
911
  changeWebcam: (object: string | MediaStream) => void;
900
- changeMode(mode: 'CONFERENCE' | 'VIEWER'): void;
912
+ changeMode(mode: 'SEND_AND_RECV' | 'SIGNALLING_ONLY' | 'RECV_ONLY'): void;
901
913
  startVideo: ({ link }: { link: string }) => void;
902
914
  stopVideo: () => void;
903
915
  pauseVideo: ({ currentTime }: { currentTime: number }) => void;
@@ -1094,11 +1106,13 @@ export function useTranscription({
1094
1106
  * @param config.modelConfig? modelConfig if any, which will be used while doing transcription
1095
1107
  * @param config.summary.enabled Enables or disables summary generation from realtime transcriptions.
1096
1108
  * @param config.summary.prompt Guides summary generation (optional).
1109
+ * @param config.language Language code for transcription, default is 'en' (optional).
1097
1110
  */
1098
1111
  startTranscription: ({
1099
1112
  webhookUrl,
1100
1113
  modelConfig,
1101
- summary
1114
+ summary,
1115
+ language
1102
1116
  }: {
1103
1117
  webhookUrl?: string;
1104
1118
  modelConfig?: object;
@@ -1106,6 +1120,7 @@ export function useTranscription({
1106
1120
  enabled: boolean;
1107
1121
  prompt?: string;
1108
1122
  };
1123
+ language?: string;
1109
1124
  }) => void;
1110
1125
  stopTranscription: () => void;
1111
1126
  };
@@ -1192,7 +1207,8 @@ export function useCharacter(
1192
1207
  characterRole,
1193
1208
  characterMode,
1194
1209
  knowledgeBases,
1195
- language
1210
+ language,
1211
+ metaData
1196
1212
  }: {
1197
1213
  interactionId: string;
1198
1214
  // OR
@@ -1202,6 +1218,7 @@ export function useCharacter(
1202
1218
  characterMode: 'text' | 'co_pilot' | 'auto_pilot' | 'vision_pilot';
1203
1219
  knowledgeBases: string[];
1204
1220
  language: string;
1221
+ metaData: any;
1205
1222
  },
1206
1223
  {
1207
1224
  onCharacterStateChanged,
@@ -1268,6 +1285,7 @@ export function useCharacter(
1268
1285
  characterMode?: CharacterMode;
1269
1286
  characterState?: CharacterState;
1270
1287
  knowledgeBases?: string[];
1288
+ metaData?: any;
1271
1289
 
1272
1290
  enableMic: () => void;
1273
1291
  disableMic: () => void;
@@ -1317,20 +1335,20 @@ export function createMicrophoneAudioTrack({
1317
1335
  microphoneId
1318
1336
  }: {
1319
1337
  noiseConfig?:
1320
- | {
1321
- echoCancellation: boolean;
1322
- autoGainControl: boolean;
1323
- noiseSuppression: boolean;
1324
- }
1325
- | undefined;
1338
+ | {
1339
+ echoCancellation: boolean;
1340
+ autoGainControl: boolean;
1341
+ noiseSuppression: boolean;
1342
+ }
1343
+ | undefined;
1326
1344
  encoderConfig?:
1327
- | 'speech_low_quality'
1328
- | 'speech_standard'
1329
- | 'music_standard'
1330
- | 'standard_stereo'
1331
- | 'high_quality'
1332
- | 'high_quality_stereo'
1333
- | undefined;
1345
+ | 'speech_low_quality'
1346
+ | 'speech_standard'
1347
+ | 'music_standard'
1348
+ | 'standard_stereo'
1349
+ | 'high_quality'
1350
+ | 'high_quality_stereo'
1351
+ | undefined;
1334
1352
  microphoneId?: string | undefined;
1335
1353
  }): Promise<MediaStream>;
1336
1354
 
@@ -1377,25 +1395,25 @@ export function createCameraVideoTrack({
1377
1395
  }: {
1378
1396
  cameraId?: string | undefined;
1379
1397
  encoderConfig?:
1380
- | 'h90p_w160p'
1381
- | 'h180p_w320p'
1382
- | 'h216p_w384p'
1383
- | 'h360p_w640p'
1384
- | 'h540p_w960p'
1385
- | 'h720p_w1280p'
1386
- | 'h1080p_w1920p'
1387
- | 'h1440p_w2560p'
1388
- | 'h2160p_w3840p'
1389
- | 'h120p_w160p'
1390
- | 'h180p_w240p'
1391
- | 'h240p_w320p'
1392
- | 'h360p_w480p'
1393
- | 'h480p_w640p'
1394
- | 'h540p_w720p'
1395
- | 'h720p_w960p'
1396
- | 'h1080p_w1440p'
1397
- | 'h1440p_w1920p'
1398
- | undefined;
1398
+ | 'h90p_w160p'
1399
+ | 'h180p_w320p'
1400
+ | 'h216p_w384p'
1401
+ | 'h360p_w640p'
1402
+ | 'h540p_w960p'
1403
+ | 'h720p_w1280p'
1404
+ | 'h1080p_w1920p'
1405
+ | 'h1440p_w2560p'
1406
+ | 'h2160p_w3840p'
1407
+ | 'h120p_w160p'
1408
+ | 'h180p_w240p'
1409
+ | 'h240p_w320p'
1410
+ | 'h360p_w480p'
1411
+ | 'h480p_w640p'
1412
+ | 'h540p_w720p'
1413
+ | 'h720p_w960p'
1414
+ | 'h1080p_w1440p'
1415
+ | 'h1440p_w1920p'
1416
+ | undefined;
1399
1417
  facingMode?: 'user' | 'environment' | undefined;
1400
1418
  optimizationMode?: 'text' | 'motion' | 'detail' | undefined;
1401
1419
  multiStream?: boolean;
@@ -1433,12 +1451,12 @@ export function createScreenShareVideoTrack({
1433
1451
  withAudio
1434
1452
  }: {
1435
1453
  encoderConfig?:
1436
- | 'h360p_30fps'
1437
- | 'h720p_5fps'
1438
- | 'h720p_15fps'
1439
- | 'h1080p_15fps'
1440
- | 'h1080p_30fps'
1441
- | undefined;
1454
+ | 'h360p_30fps'
1455
+ | 'h720p_5fps'
1456
+ | 'h720p_15fps'
1457
+ | 'h1080p_15fps'
1458
+ | 'h1080p_30fps'
1459
+ | undefined;
1442
1460
  optimizationMode?: 'text' | 'motion' | 'detail' | undefined;
1443
1461
  withAudio?: 'enable' | 'disable';
1444
1462
  }): Promise<MediaStream>;
@@ -1545,8 +1563,13 @@ export const Constants: {
1545
1563
  characterState: CharacterState;
1546
1564
  characterMode: CharacterMode;
1547
1565
  modes: {
1548
- CONFERENCE: string;
1549
- VIEWER: string;
1566
+ // Deprecated modes
1567
+ CONFERENCE: string; // Deprecated
1568
+ VIEWER: string; // Deprecated
1569
+ // New modes
1570
+ SEND_AND_RECV: string; // New mode
1571
+ SIGNALLING_ONLY: string; // New mode
1572
+ RECV_ONLY: string
1550
1573
  };
1551
1574
  permission: {
1552
1575
  AUDIO: Permission;
@@ -89,9 +89,9 @@ export class Meeting {
89
89
  join(): void;
90
90
 
91
91
  /**
92
- * @description These method is used to change the participant mode between CONFERENCE and VIEWER
92
+ * @description This method is used to change the participant mode between SEND_AND_RECV, RECV_ONLY and SIGNALLING_ONLY
93
93
  */
94
- changeMode(mode: 'CONFERENCE' | 'VIEWER'): void;
94
+ changeMode(mode: 'SEND_AND_RECV' | 'SIGNALLING_ONLY' | 'RECV_ONLY'): void;
95
95
 
96
96
  /**
97
97
  * @description These method is used to leave the meeting for local participant
@@ -43,7 +43,7 @@ export class Participant {
43
43
  * @description This represents participant's current mode
44
44
  *
45
45
  */
46
- mode: 'CONFERENCE' | 'VIEWER';
46
+ mode: 'SEND_AND_RECV' | 'SIGNALLING_ONLY' | 'RECV_ONLY'
47
47
  /**
48
48
  * @description This represents metaData which is passed in MeetingProvider
49
49
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@videosdk.live/react-sdk",
3
- "version": "0.1.104",
3
+ "version": "0.2.0",
4
4
  "license": "ISC",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.modern.js",
@@ -74,7 +74,7 @@
74
74
  }
75
75
  },
76
76
  "dependencies": {
77
- "@videosdk.live/js-sdk": "0.0.100",
77
+ "@videosdk.live/js-sdk": "0.1.4",
78
78
  "events": "^3.3.0"
79
79
  }
80
80
  }