@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.
- package/dist/index.js +45 -1
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +45 -2
- package/dist/index.modern.js.map +1 -1
- package/dist/types/index.d.ts +97 -79
- package/dist/types/participant.d.ts +5 -1
- package/package.json +2 -2
package/dist/types/index.d.ts
CHANGED
|
@@ -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
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
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
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
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
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
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
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
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
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
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
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
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
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
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
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
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
|
|
895
|
+
sendOnly?: Array<String>;
|
|
892
896
|
},
|
|
893
|
-
payload
|
|
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
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
962
|
+
| {
|
|
963
|
+
echoCancellation: boolean;
|
|
964
|
+
autoGainControl: boolean;
|
|
965
|
+
noiseSuppression: boolean;
|
|
966
|
+
}
|
|
967
|
+
| undefined;
|
|
950
968
|
encoderConfig?:
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
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
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
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
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
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
|
-
*
|
|
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.
|
|
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.
|
|
76
|
+
"@videosdk.live/js-sdk": "0.0.77",
|
|
77
77
|
"events": "^3.3.0"
|
|
78
78
|
}
|
|
79
79
|
}
|