@videosdk.live/react-sdk 0.1.105 → 0.2.1

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;
@@ -905,7 +909,7 @@ export function useMeeting({
905
909
  >;
906
910
  changeMic: (object: string | MediaStream) => void;
907
911
  changeWebcam: (object: string | MediaStream) => void;
908
- changeMode(mode: 'CONFERENCE' | 'VIEWER'): void;
912
+ changeMode(mode: 'SEND_AND_RECV' | 'SIGNALLING_ONLY' | 'RECV_ONLY'): void;
909
913
  startVideo: ({ link }: { link: string }) => void;
910
914
  stopVideo: () => void;
911
915
  pauseVideo: ({ currentTime }: { currentTime: number }) => void;
@@ -1331,20 +1335,20 @@ export function createMicrophoneAudioTrack({
1331
1335
  microphoneId
1332
1336
  }: {
1333
1337
  noiseConfig?:
1334
- | {
1335
- echoCancellation: boolean;
1336
- autoGainControl: boolean;
1337
- noiseSuppression: boolean;
1338
- }
1339
- | undefined;
1338
+ | {
1339
+ echoCancellation: boolean;
1340
+ autoGainControl: boolean;
1341
+ noiseSuppression: boolean;
1342
+ }
1343
+ | undefined;
1340
1344
  encoderConfig?:
1341
- | 'speech_low_quality'
1342
- | 'speech_standard'
1343
- | 'music_standard'
1344
- | 'standard_stereo'
1345
- | 'high_quality'
1346
- | 'high_quality_stereo'
1347
- | undefined;
1345
+ | 'speech_low_quality'
1346
+ | 'speech_standard'
1347
+ | 'music_standard'
1348
+ | 'standard_stereo'
1349
+ | 'high_quality'
1350
+ | 'high_quality_stereo'
1351
+ | undefined;
1348
1352
  microphoneId?: string | undefined;
1349
1353
  }): Promise<MediaStream>;
1350
1354
 
@@ -1391,25 +1395,25 @@ export function createCameraVideoTrack({
1391
1395
  }: {
1392
1396
  cameraId?: string | undefined;
1393
1397
  encoderConfig?:
1394
- | 'h90p_w160p'
1395
- | 'h180p_w320p'
1396
- | 'h216p_w384p'
1397
- | 'h360p_w640p'
1398
- | 'h540p_w960p'
1399
- | 'h720p_w1280p'
1400
- | 'h1080p_w1920p'
1401
- | 'h1440p_w2560p'
1402
- | 'h2160p_w3840p'
1403
- | 'h120p_w160p'
1404
- | 'h180p_w240p'
1405
- | 'h240p_w320p'
1406
- | 'h360p_w480p'
1407
- | 'h480p_w640p'
1408
- | 'h540p_w720p'
1409
- | 'h720p_w960p'
1410
- | 'h1080p_w1440p'
1411
- | 'h1440p_w1920p'
1412
- | 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;
1413
1417
  facingMode?: 'user' | 'environment' | undefined;
1414
1418
  optimizationMode?: 'text' | 'motion' | 'detail' | undefined;
1415
1419
  multiStream?: boolean;
@@ -1447,12 +1451,12 @@ export function createScreenShareVideoTrack({
1447
1451
  withAudio
1448
1452
  }: {
1449
1453
  encoderConfig?:
1450
- | 'h360p_30fps'
1451
- | 'h720p_5fps'
1452
- | 'h720p_15fps'
1453
- | 'h1080p_15fps'
1454
- | 'h1080p_30fps'
1455
- | undefined;
1454
+ | 'h360p_30fps'
1455
+ | 'h720p_5fps'
1456
+ | 'h720p_15fps'
1457
+ | 'h1080p_15fps'
1458
+ | 'h1080p_30fps'
1459
+ | undefined;
1456
1460
  optimizationMode?: 'text' | 'motion' | 'detail' | undefined;
1457
1461
  withAudio?: 'enable' | 'disable';
1458
1462
  }): Promise<MediaStream>;
@@ -1559,8 +1563,13 @@ export const Constants: {
1559
1563
  characterState: CharacterState;
1560
1564
  characterMode: CharacterMode;
1561
1565
  modes: {
1562
- CONFERENCE: string;
1563
- 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
1564
1573
  };
1565
1574
  permission: {
1566
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.105",
3
+ "version": "0.2.1",
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.101",
77
+ "@videosdk.live/js-sdk": "0.1.5",
78
78
  "events": "^3.3.0"
79
79
  }
80
80
  }