@videosdk.live/react-sdk 0.1.78 → 0.1.80

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.
@@ -50,6 +50,8 @@ import { Stream } from './stream';
50
50
  * ---
51
51
  * @param config.customMicrophoneAudioTrack - Set the initial custom audio track using different encoding parameters and optimization mode.
52
52
  * ---
53
+ * @param config.defaultCamera - [For Mobile Browser] It sets the initial camera orientation. Use 'front' to initialize the camera with the front-facing (selfie) mode, or 'back' to initialize it with the rear-facing (main) mode.
54
+ * ---
53
55
  * @param token -
54
56
  * - You can generate a token in two ways:
55
57
  *
@@ -60,7 +62,7 @@ import { Stream } from './stream';
60
62
  * - This is a boolean flag, when set to true, allows a participant to join a meeting directly without explicitly calling the join() function.
61
63
  *
62
64
  * - This is an OPTIONAL parameter. By default, it is set to false meaning, user has to manually call the join().
63
- *
65
+ *
64
66
  */
65
67
  export function MeetingProvider({
66
68
  children,
@@ -85,6 +87,7 @@ export function MeetingProvider({
85
87
  multiStream?: boolean;
86
88
  mode?: 'CONFERENCE' | 'VIEWER';
87
89
  metaData?: object;
90
+ defaultCamera?: 'front' | 'back';
88
91
  };
89
92
  token: string;
90
93
  joinWithoutUserInteraction?: boolean;
@@ -266,11 +269,11 @@ export function MeetingConsumer({
266
269
  livestreamUrl,
267
270
  }: {
268
271
  status:
269
- | 'HLS_STARTING'
270
- | 'HLS_STARTED'
271
- | 'HLS_PLAYABLE'
272
- | 'HLS_STOPPING'
273
- | 'HLS_STOPPED';
272
+ | 'HLS_STARTING'
273
+ | 'HLS_STARTED'
274
+ | 'HLS_PLAYABLE'
275
+ | 'HLS_STOPPING'
276
+ | 'HLS_STOPPED';
274
277
  downstreamUrl?: string;
275
278
  playbackHlsUrl?: string;
276
279
  livestreamUrl?: string;
@@ -279,30 +282,30 @@ export function MeetingConsumer({
279
282
  status,
280
283
  }: {
281
284
  status:
282
- | 'RECORDING_STARTING'
283
- | 'RECORDING_STARTED'
284
- | 'RECORDING_STOPPING'
285
- | 'RECORDING_STOPPED';
285
+ | 'RECORDING_STARTING'
286
+ | 'RECORDING_STARTED'
287
+ | 'RECORDING_STOPPING'
288
+ | 'RECORDING_STOPPED';
286
289
  }) => void;
287
290
  onLivestreamStateChanged?: ({
288
291
  status,
289
292
  }: {
290
293
  status:
291
- | 'LIVESTREAM_STARTING'
292
- | 'LIVESTREAM_STARTED'
293
- | 'LIVESTREAM_STOPPING'
294
- | 'LIVESTREAM_STOPPED';
294
+ | 'LIVESTREAM_STARTING'
295
+ | 'LIVESTREAM_STARTED'
296
+ | 'LIVESTREAM_STOPPING'
297
+ | 'LIVESTREAM_STOPPED';
295
298
  }) => void;
296
299
  onMeetingStateChanged?: ({
297
300
  state,
298
301
  }: {
299
302
  state:
300
- | 'CONNECTING'
301
- | 'CONNECTED'
302
- | 'FAILED'
303
- | 'DISCONNECTED'
304
- | 'CLOSING'
305
- | 'CLOSED';
303
+ | 'CONNECTING'
304
+ | 'CONNECTED'
305
+ | 'FAILED'
306
+ | 'DISCONNECTED'
307
+ | 'CLOSING'
308
+ | 'CLOSED';
306
309
  }) => void;
307
310
  onParticipantModeChanged?: ({
308
311
  participantId,
@@ -426,6 +429,7 @@ export function useParticipant(
426
429
  enableWebcam: () => void;
427
430
  disableWebcam: () => void;
428
431
  remove: () => void;
432
+ captureImage: ({ height, width }: { height?: number, width?: number }) => Promise<string | null>;
429
433
  pin: (data: 'SHARE_AND_CAM' | 'CAM' | 'SHARE') => void;
430
434
  unpin: (data: 'SHARE_AND_CAM' | 'CAM' | 'SHARE') => void;
431
435
  switchTo: ({
@@ -668,11 +672,11 @@ export function useMeeting({
668
672
  livestreamUrl,
669
673
  }: {
670
674
  status:
671
- | 'HLS_STARTING'
672
- | 'HLS_STARTED'
673
- | 'HLS_PLAYABLE'
674
- | 'HLS_STOPPING'
675
- | 'HLS_STOPPED';
675
+ | 'HLS_STARTING'
676
+ | 'HLS_STARTED'
677
+ | 'HLS_PLAYABLE'
678
+ | 'HLS_STOPPING'
679
+ | 'HLS_STOPPED';
676
680
  downstreamUrl?: string;
677
681
  playbackHlsUrl?: string;
678
682
  livestreamUrl?: string;
@@ -681,30 +685,30 @@ export function useMeeting({
681
685
  status,
682
686
  }: {
683
687
  status:
684
- | 'RECORDING_STARTING'
685
- | 'RECORDING_STARTED'
686
- | 'RECORDING_STOPPING'
687
- | 'RECORDING_STOPPED';
688
+ | 'RECORDING_STARTING'
689
+ | 'RECORDING_STARTED'
690
+ | 'RECORDING_STOPPING'
691
+ | 'RECORDING_STOPPED';
688
692
  }) => void;
689
693
  onLivestreamStateChanged?: ({
690
694
  status,
691
695
  }: {
692
696
  status:
693
- | 'LIVESTREAM_STARTING'
694
- | 'LIVESTREAM_STARTED'
695
- | 'LIVESTREAM_STOPPING'
696
- | 'LIVESTREAM_STOPPED';
697
+ | 'LIVESTREAM_STARTING'
698
+ | 'LIVESTREAM_STARTED'
699
+ | 'LIVESTREAM_STOPPING'
700
+ | 'LIVESTREAM_STOPPED';
697
701
  }) => void;
698
702
  onMeetingStateChanged?: ({
699
703
  state,
700
704
  }: {
701
705
  state:
702
- | 'CONNECTING'
703
- | 'CONNECTED'
704
- | 'FAILED'
705
- | 'DISCONNECTED'
706
- | 'CLOSING'
707
- | 'CLOSED';
706
+ | 'CONNECTING'
707
+ | 'CONNECTED'
708
+ | 'FAILED'
709
+ | 'DISCONNECTED'
710
+ | 'CLOSING'
711
+ | 'CLOSED';
708
712
  }) => void;
709
713
  onParticipantModeChanged?: ({
710
714
  participantId,
@@ -888,9 +892,9 @@ export function usePubSub(
888
892
  sendOnly,
889
893
  }: {
890
894
  persist: boolean;
891
- sendOnly: Array<String>;
895
+ sendOnly?: Array<String>;
892
896
  },
893
- payload: object,
897
+ payload?: object,
894
898
  ) => void;
895
899
  messages: Array<{
896
900
  id: string;
@@ -903,6 +907,20 @@ export function usePubSub(
903
907
  }>;
904
908
  };
905
909
 
910
+ export function useFile(): {
911
+ uploadBase64File: ({ base64Data, token, fileName }: {
912
+ base64Data: string;
913
+ token: string;
914
+ fileName: string;
915
+ }) => Promise<string | null>;
916
+
917
+ fetchBase64File: ({ url, token }: {
918
+ url: string;
919
+ token: string;
920
+ }) => Promise<string | null>;
921
+ };
922
+
923
+
906
924
  /**
907
925
  * @param microphoneId - It will be the id of the mic from which the audio should be captured.
908
926
  * ---
@@ -941,20 +959,20 @@ export function createMicrophoneAudioTrack({
941
959
  microphoneId,
942
960
  }: {
943
961
  noiseConfig?:
944
- | {
945
- echoCancellation: boolean;
946
- autoGainControl: boolean;
947
- noiseSuppression: boolean;
948
- }
949
- | undefined;
962
+ | {
963
+ echoCancellation: boolean;
964
+ autoGainControl: boolean;
965
+ noiseSuppression: boolean;
966
+ }
967
+ | undefined;
950
968
  encoderConfig?:
951
- | 'speech_low_quality'
952
- | 'speech_standard'
953
- | 'music_standard'
954
- | 'standard_stereo'
955
- | 'high_quality'
956
- | 'high_quality_stereo'
957
- | undefined;
969
+ | 'speech_low_quality'
970
+ | 'speech_standard'
971
+ | 'music_standard'
972
+ | 'standard_stereo'
973
+ | 'high_quality'
974
+ | 'high_quality_stereo'
975
+ | undefined;
958
976
  microphoneId?: string | undefined;
959
977
  }): Promise<MediaStream>;
960
978
 
@@ -1001,25 +1019,25 @@ export function createCameraVideoTrack({
1001
1019
  }: {
1002
1020
  cameraId?: string | undefined;
1003
1021
  encoderConfig?:
1004
- | 'h90p_w160p'
1005
- | 'h180p_w320p'
1006
- | 'h216p_w384p'
1007
- | 'h360p_w640p'
1008
- | 'h540p_w960p'
1009
- | 'h720p_w1280p'
1010
- | 'h1080p_w1920p'
1011
- | 'h1440p_w2560p'
1012
- | 'h2160p_w3840p'
1013
- | 'h120p_w160p'
1014
- | 'h180p_w240p'
1015
- | 'h240p_w320p'
1016
- | 'h360p_w480p'
1017
- | 'h480p_w640p'
1018
- | 'h540p_w720p'
1019
- | 'h720p_w960p'
1020
- | 'h1080p_w1440p'
1021
- | 'h1440p_w1920p'
1022
- | undefined;
1022
+ | 'h90p_w160p'
1023
+ | 'h180p_w320p'
1024
+ | 'h216p_w384p'
1025
+ | 'h360p_w640p'
1026
+ | 'h540p_w960p'
1027
+ | 'h720p_w1280p'
1028
+ | 'h1080p_w1920p'
1029
+ | 'h1440p_w2560p'
1030
+ | 'h2160p_w3840p'
1031
+ | 'h120p_w160p'
1032
+ | 'h180p_w240p'
1033
+ | 'h240p_w320p'
1034
+ | 'h360p_w480p'
1035
+ | 'h480p_w640p'
1036
+ | 'h540p_w720p'
1037
+ | 'h720p_w960p'
1038
+ | 'h1080p_w1440p'
1039
+ | 'h1440p_w1920p'
1040
+ | undefined;
1023
1041
  facingMode?: 'user' | 'environment' | undefined;
1024
1042
  optimizationMode?: 'text' | 'motion' | 'detail' | undefined;
1025
1043
  multiStream?: boolean;
@@ -1057,12 +1075,12 @@ export function createScreenShareVideoTrack({
1057
1075
  withAudio,
1058
1076
  }: {
1059
1077
  encoderConfig?:
1060
- | 'h360p_30fps'
1061
- | 'h720p_5fps'
1062
- | 'h720p_15fps'
1063
- | 'h1080p_15fps'
1064
- | 'h1080p_30fps'
1065
- | undefined;
1078
+ | 'h360p_30fps'
1079
+ | 'h720p_5fps'
1080
+ | 'h720p_15fps'
1081
+ | 'h1080p_15fps'
1082
+ | 'h1080p_30fps'
1083
+ | undefined;
1066
1084
  optimizationMode?: 'text' | 'motion' | 'detail' | undefined;
1067
1085
  withAudio?: 'enable' | 'disable';
1068
1086
  }): Promise<MediaStream>;
@@ -71,7 +71,11 @@ export class Participant {
71
71
  */
72
72
  disableWebcam(): void;
73
73
  /**
74
- * @description This method can be used to set the incoming video quality of the participant
74
+ * @description This method can be used to capture image in the meeting
75
+ */
76
+ captureImage({height,width}:{height?:number,width?:number}): Promise<string | null>;
77
+ /**
78
+ * @description This method can be used to set the incoming video quality of the participant
75
79
  * @param quality
76
80
  */
77
81
  setQuality(quality: 'low' | 'med' | 'high'): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@videosdk.live/react-sdk",
3
- "version": "0.1.78",
3
+ "version": "0.1.80",
4
4
  "license": "ISC",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.modern.js",
@@ -73,7 +73,7 @@
73
73
  }
74
74
  },
75
75
  "dependencies": {
76
- "@videosdk.live/js-sdk": "0.0.74",
76
+ "@videosdk.live/js-sdk": "0.0.77",
77
77
  "events": "^3.3.0"
78
78
  }
79
79
  }