@videosdk.live/react-sdk 0.1.86 → 0.1.87

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.
@@ -1,468 +0,0 @@
1
- export class Meeting {
2
- /**
3
- * @description
4
- * This represents the meetingId
5
- */
6
- id: string;
7
- /**
8
- * @description
9
- * This represents the `participantId` of the active speaker in the meeting
10
- */
11
- activeSpeakerId?: string;
12
- /**
13
- * @description
14
- * This represents the `participantId` of the active presenter in the meeting
15
- */
16
- activePresenterId?: string;
17
- /**
18
- * @description
19
- * This represents the `participantId` of the main participant in the meeting
20
- */
21
- mainParticipantId: string;
22
- /**
23
- * @deprecated
24
- */
25
- connections: Map<string, Connection>;
26
- /**
27
- * @description
28
- * These represents the `Participant` object for the local participant
29
- */
30
- localParticipant: Participant;
31
- /**
32
- * @description
33
- * These represents the Map of all the Participant objects except local participant
34
- */
35
- participants: Map<string, Participant>;
36
- /**
37
- * @description These represents the current state of the meeting Livestream
38
- */
39
- livestreamState: 'LIVESTREAM_STOPPED' | 'LIVESTREAM_STARTING' | 'LIVESTREAM_STARTED' | 'LIVESTREAM_STOPPING';
40
- /**
41
- * @description These represents the current state of the meeting recording
42
- */
43
- recordingState: 'RECORDING_STOPPED' | 'RECORDING_STARTING' | 'RECORDING_STARTED' | 'RECORDING_STOPPING';
44
- /**
45
- * @description These represents the current state of the meeting HLS
46
- *
47
- */
48
- hlsState: 'HLS_STOPPED' | 'HLS_STARTING' | 'HLS_STARTED' | 'HLS_STOPPING';
49
- /**
50
- * @description These object will provide the URLs to play the HLS streams
51
- */
52
- hlsUrls: {
53
- downstreamUrl?: string;
54
- playbackHlsUrl?: string;
55
- livestreamUrl?: string;
56
- };
57
- /**
58
- * @description These object will contain all the messages send using the `sendChatMessage` method
59
- */
60
- messages: Array<{
61
- message: string;
62
- senderId: string;
63
- senderName: string;
64
- timestamp: Date;
65
- topic: string;
66
- payload: object;
67
- }>;
68
-
69
- /**
70
- * @description These method is used to join the meeting
71
- */
72
- join(): void;
73
-
74
- /**
75
- * @description These method is used to change the participant mode between CONFERENCE and VIEWER
76
- */
77
- changeMode(mode: 'CONFERENCE' | 'VIEWER'): void;
78
-
79
- /**
80
- * @description These method is used to leave the meeting for local participant
81
- */
82
- leave(): void;
83
-
84
- /**
85
- * @description These method is used to end the meeting for all participants
86
- */
87
- end(): void;
88
-
89
- /**
90
- * @param participantId `participantId` for which entry is to be responed
91
- * @param decision `true` if the participant is allowed to join the meeting else `false`
92
- */
93
- respondEntry(participantId: string, decision: boolean): void;
94
- /**
95
- * @description returns all the pinned participants in the meeting
96
- */
97
- get pinnedParticipants(): Map<string, Participant>;
98
-
99
- /**
100
- * @description Mute the mic of local participant and stop broadcasting audio
101
- */
102
- muteMic(): void;
103
-
104
- /**
105
- * @param customAudioTrack You can pass your own custom audio track here.
106
- * To learn more checkour this [reference](https://docs.videosdk.live/javascript/guide/video-and-audio-calling-api-sdk/features/custom-track/custom-audio-track)
107
- * @description unmute the mic of local participant and start broadcasting audio
108
- */
109
- unmuteMic(customAudioTrack?: MediaStream): void;
110
-
111
- /**
112
- *
113
- * @description This method is used to stop boradcasting the video to other participants
114
- */
115
- disableWebcam(): void;
116
-
117
- /**
118
- * @param customVideoTrack You can pass your own custom video track here.
119
- * To learn more checkour this [reference](https://docs.videosdk.live/javascript/guide/video-and-audio-calling-api-sdk/features/custom-track/custom-video-track)
120
- * @description This method will turn on the webcam of local participant and start broadcasting video
121
- */
122
- enableWebcam(customVideoTrack?: MediaStream): void;
123
- /**
124
- * @description This method is used to stop boradcasting the screenshare to other participants
125
- */
126
- disableScreenShare(): void;
127
- /**
128
- * @param customScreenSharingTrack You can pass your own custom screen share track here.
129
- * To learn more checkour this [reference](https://docs.videosdk.live/javascript/guide/video-and-audio-calling-api-sdk/features/custom-track/custom-screen-share-track)
130
- * @description This method will start broadcasting participants screen share
131
- *
132
- */
133
- enableScreenShare(customScreenSharingTrack?: MediaStream): void;
134
-
135
- /**
136
- * @deprecated
137
- * @param text Message which is to be send to all participants in th meeting
138
- */
139
- sendChatMessage(text: string): void;
140
-
141
- /**
142
- * @param webhookUrl
143
- * Webhook URL which will be called by VideoSDK when the recording state gets changed
144
- * @param awsDirPath?
145
- * awsDirPath represents the Directory you want to store your recording if you have configured your own S3 storage
146
- *
147
- * @param config Config can be used to configure the HLS stream
148
- * @param config.layout.type These represents the layout which is to used in the HLS
149
- * @param config.layout.priority These defines the priority of participants to be considered while composing HLS
150
- * @param config.layout.gridSize These defines the maximum number of participants in the grid
151
- * @param config.theme These defines the color theme of the HLS livestream
152
- * @param config.mode These defines the mode of the HLS livestream as only audio or vidoe and audio both
153
- * @param config.quality These defines the quality of the HLS livestream
154
- */
155
- startRecording(
156
- webhookUrl: string,
157
- awsDirPath: string,
158
- config: {
159
- layout: {
160
- type: 'GRID' | 'SPOTLIGHT' | 'SIDEBAR';
161
- priority: 'SPEAKER' | 'PIN';
162
- gridSize: number;
163
- };
164
- theme: 'DARK' | 'LIGHT' | 'DEFAULT';
165
- mode: 'video-and-audio' | 'audio';
166
- quality: 'low' | 'med' | 'high';
167
- },
168
- ): void;
169
-
170
- /**
171
- * @description This method is used to stop the meeting recording
172
- */
173
- stopRecording(): void;
174
-
175
- /**
176
- * These method is used to start the meeting RTMP to provided output
177
- * @param outputs These defines the array of outputs to which the RTMP has to be broadcasted
178
- * @param config Config can be used to configure the HLS stream
179
- * @param config.layout.type These represents the layout which is to used in the HLS
180
- * @param config.layout.priority These defines the priority of participants to be considered while composing HLS
181
- * @param config.layout.gridSize These defines the maximum number of participants in the grid
182
- * @param config.theme These defines the color theme of the RTMP livestream
183
- */
184
- startLivestream(
185
- outputs: Array<{
186
- url: string;
187
- streamKey: string;
188
- }>,
189
- config?: {
190
- layout: {
191
- type: 'GRID' | 'SPOTLIGHT' | 'SIDEBAR';
192
- priority: 'SPEAKER' | 'PIN';
193
- gridSize: number;
194
- };
195
- theme: 'DARK' | 'LIGHT' | 'DEFAULT';
196
- },
197
- ): void;
198
-
199
- /**
200
- * @description This method is used to stop the meeting livestream
201
- */
202
- stopLivestream(): void;
203
-
204
- /**
205
- * These method is used to start the meeting HLS
206
- * @param config Config can be used to configure the HLS stream
207
- * @param config.layout.type These represents the layout which is to used in the HLS
208
- * @param config.layout.priority These defines the priority of participants to be considered while composing HLS
209
- * @param config.layout.gridSize These defines the maximum number of participants in the grid
210
- * @param config.theme These defines the color theme of the HLS livestream
211
- * @param config.mode These defines the mode of the HLS livestream as only audio or vidoe and audio both
212
- * @param config.quality These defines the quality of the HLS livestream
213
- */
214
- startHls(config?: {
215
- layout: {
216
- type: 'GRID' | 'SPOTLIGHT' | 'SIDEBAR';
217
- priority: 'SPEAKER' | 'PIN';
218
- gridSize: number;
219
- };
220
- theme: 'DARK' | 'LIGHT' | 'DEFAULT';
221
- mode: 'video-and-audio' | 'audio';
222
- quality: 'low' | 'med' | 'high';
223
- }): Promise<void>;
224
-
225
- /**
226
- * @description This method is used to stop the meeting HLS
227
- */
228
- stopHls(): void;
229
-
230
- /**
231
- * @description This method returns all the available mics
232
- */
233
- getMics(): Promise<
234
- Array<{
235
- deviceId: string;
236
- label: string;
237
- }>
238
- >;
239
-
240
- /**
241
- * @description This method returns all the available webcams
242
- */
243
- getWebcams(): Promise<
244
- Array<{
245
- deviceId: string;
246
- label: string;
247
- facingMode: 'front' | 'environment';
248
- }>
249
- >;
250
-
251
- /**
252
- *
253
- * @param object These can be the `deviceId` to which the mic input has to be changed or
254
- * you can pass the audio stream to this method which will be used for the audio broadcast
255
- */
256
- changeMic(object: string | MediaStream): void;
257
-
258
- /**
259
- *
260
- * @param object These can be the `deviceId` to which the webcam input has to be changed or
261
- * you can pass the video stream to this method which will be used for the video broadcast
262
- */
263
- changeWebcam(object: string | MediaStream): void;
264
-
265
- /**
266
- * @param stream This method will be used to replace the provided stream with current webcam stream
267
- */
268
- replaceWebcamStream(stream: MediaStream): void;
269
-
270
- /**
271
- *
272
- * @param quality This method will be used set the webcam quality to be used.
273
- */
274
- setWebcamQuality(quality: 'low' | 'med' | 'high'): void;
275
-
276
- /**
277
- * Used for internal purpose
278
- */
279
- startWhiteboard(): void;
280
-
281
- /**
282
- * Used for internal purpose
283
- */
284
- stopWhiteboard(): void;
285
-
286
- /**
287
- * @deprecated
288
- * @param options
289
- */
290
- startVideo({ link }: { link: string }): void;
291
- /**
292
- * @deprecated
293
- */
294
- stopVideo(): void;
295
- /**
296
- * @deprecated
297
- */
298
- resumeVideo(): void;
299
- refreshConnection(): void;
300
- /**
301
- * @deprecated
302
- * @param options
303
- */
304
- pauseVideo({ currentTime }: { currentTime: number }): void;
305
- /**
306
- * @deprecated
307
- * @param options
308
- */
309
- seekVideo({ currentTime }: { currentTime: number }): void;
310
- pubSub: {
311
- /**
312
- * Publish message to a topic
313
- *
314
- * @param topic Topic to which the message will be published
315
- * @param message This will be the actual message which has to be send
316
- * @param options This will define other options like `persist` which will decide if the message has to be stored or not
317
- */
318
- publish: (
319
- topic: string,
320
- message: string,
321
- options: {
322
- persist: boolean;
323
- },
324
- payload: object,
325
- sendOnly: Array<String>
326
- ) => Promise<void>;
327
- /**
328
- * Subscribe to message on a topic
329
- *
330
- * @param topic Topic to which you want to subscribe
331
- * @param callback Callback function which will be triggered when a new message is received
332
- */
333
- subscribe: (
334
- topic: string,
335
- callback: (message: {
336
- id: string;
337
- message: string;
338
- senderId: string;
339
- senderName: string;
340
- timestamp: string;
341
- topic: string;
342
- payload: object;
343
- }) => void,
344
- ) => Promise<
345
- Array<{
346
- id: string;
347
- message: string;
348
- senderId: string;
349
- senderName: string;
350
- timestamp: string;
351
- topic: string;
352
- payload: object;
353
- }>
354
- >;
355
- /**
356
- * Unsubscribe from messages on a topic
357
- *
358
- * @param topic Topic to which you want to stop getting message for
359
- * @param callback Callback function which was passed which subscribing to the topic
360
- */
361
- unsubscribe: (
362
- topic: string,
363
- callback: (message: {
364
- id: string;
365
- message: string;
366
- senderId: string;
367
- senderName: string;
368
- timestamp: string;
369
- topic: string;
370
- payload: object;
371
- }) => void,
372
- ) => Promise<void>;
373
- };
374
- /**
375
- * @deprecated
376
- * @param options
377
- */
378
- connectTo({ meetingId, payload }: { meetingId: string; payload: string }): Promise<void>;
379
- /**
380
- * Add event listener
381
- * @param eventType Event name to which you want to subscribe.
382
- * @param listener Callback function which will be triggered when the event happens
383
- */
384
- on(
385
- eventType:
386
- | 'participant-joined'
387
- | 'participant-left'
388
- | 'participant-mode-change'
389
- | 'speaker-changed'
390
- | 'presenter-changed'
391
- | 'main-participant-changed'
392
- | 'entry-requested'
393
- | 'entry-responded'
394
- | 'recording-started'
395
- | 'recording-stopped'
396
- | 'recording-state-changed'
397
- | 'livestream-started'
398
- | 'livestream-stopped'
399
- | 'livestream-state-changed'
400
- | 'hls-started'
401
- | 'hls-stopped'
402
- | 'hls-state-changed'
403
- | 'stream-enabled'
404
- | 'stream-disabled'
405
- | 'whiteboard-started'
406
- | 'whiteboard-stopped'
407
- | 'meeting-joined'
408
- | 'meeting-left'
409
- | 'video-state-changed'
410
- | 'video-seeked'
411
- | 'mic-requested'
412
- | 'webcam-requested'
413
- | 'pin-state-changed'
414
- | 'connection-open'
415
- | 'connection-close'
416
- | 'meeting-state-changed'
417
- | 'switch-meeting'
418
- | 'error'
419
- | 'chat-message',
420
- listener: (data: any) => void,
421
- ): void;
422
- /**
423
- * Remove event listener
424
- * @param eventType Event name to which you want to unsubscribe.
425
- * @param listener Callback function which was passed while subscribing to the event
426
- */
427
- off(
428
- eventType:
429
- | 'participant-joined'
430
- | 'participant-left'
431
- | 'participant-mode-change'
432
- | 'speaker-changed'
433
- | 'presenter-changed'
434
- | 'main-participant-changed'
435
- | 'entry-requested'
436
- | 'entry-responded'
437
- | 'recording-started'
438
- | 'recording-stopped'
439
- | 'recording-state-changed'
440
- | 'livestream-started'
441
- | 'livestream-stopped'
442
- | 'livestream-state-changed'
443
- | 'hls-started'
444
- | 'hls-stopped'
445
- | 'hls-state-changed'
446
- | 'stream-enabled'
447
- | 'stream-disabled'
448
- | 'whiteboard-started'
449
- | 'whiteboard-stopped'
450
- | 'meeting-joined'
451
- | 'meeting-left'
452
- | 'video-state-changed'
453
- | 'video-seeked'
454
- | 'mic-requested'
455
- | 'webcam-requested'
456
- | 'pin-state-changed'
457
- | 'connection-open'
458
- | 'connection-close'
459
- | 'meeting-state-changed'
460
- | 'switch-meeting'
461
- | 'error'
462
- | 'chat-message',
463
- listener: (data: any) => void,
464
- ): void;
465
- }
466
-
467
- import { Participant } from './participant';
468
- import { Connection } from './connection';
@@ -1,194 +0,0 @@
1
- export class Participant {
2
- /**
3
- * @description This represents the participant's ID
4
- */
5
- id: string;
6
- /**
7
- * @description This represents the participant's name
8
- */
9
- displayName: string;
10
- /**
11
- * @description This represents the all the Streams that the participant is producing
12
- *
13
- */
14
- streams: Map<string, Stream>;
15
- /**
16
- * @description This represents the quality of video being consumed for the participant
17
- *
18
- */
19
- quality: 'low' | 'med' | 'high';
20
- /**
21
- * @description This represents if the participant is local or remote
22
- *
23
- */
24
- local: boolean;
25
- /**
26
- * @description This represents participant's current pin state
27
- *
28
- */
29
- pinState: {
30
- cam: boolean;
31
- share: boolean;
32
- };
33
- /**
34
- * @description This represents participant's current webcam status
35
- */
36
- webcamOn: boolean;
37
- /**
38
- * @description This represents participant's current mic status
39
- *
40
- */
41
- micOn: boolean;
42
- /**
43
- * @description This represents participant's current mode
44
- *
45
- */
46
- mode: 'CONFERENCE' | 'VIEWER';
47
- /**
48
- * @description This represents metaData which is passed in MeetingProvider
49
- *
50
- */
51
- metaData: object;
52
-
53
- /**
54
- * @description This method can be used to kickout a participant from the meeting
55
- */
56
- remove(): void;
57
- /**
58
- * @description This method can be used to enable mic of the participant in the meeting
59
- */
60
- enableMic(): void;
61
- /**
62
- * @description This method can be used to disable mic of the participant in the meeting
63
- */
64
- disableMic(): void;
65
- /**
66
- * @description This method can be used to enable webcam of the participant in the meeting
67
- */
68
- enableWebcam(): void;
69
- /**
70
- * @description This method can be used to disable webcam of the participant in the meeting
71
- */
72
- disableWebcam(): void;
73
- /**
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
79
- * @param quality
80
- */
81
- setQuality(quality: 'low' | 'med' | 'high'): void;
82
- /**
83
- * @description This method can be used to set the video quality of the participant based on the size of the viewport it is being displayed in
84
- * @param width Width of the Viewport in which participant video is shown
85
- * @param height Height of the Viewport in which participant video is shown
86
- */
87
- setViewPort(width: number, height: number): void;
88
-
89
- /**
90
- * @param type If `SHARE_AND_CAM` is provided, it will pin screenshare and camera of the participant.
91
- * If `CAM` is provided, it will only pin the participant's camera, If `SHARE` is provided, it will only pin the participant's screen share
92
- */
93
- pin(type: 'SHARE_AND_CAM' | 'CAM' | 'SHARE'): void;
94
- /**
95
- * @param type If `SHARE_AND_CAM` is provided, it will unpin screenshare and camera of the participant.
96
- * If `CAM` is provided, it will only unpin the participant's camera, If `SHARE` is provided, it will only unpin the participant's screen share
97
- */
98
- unpin(type: 'SHARE_AND_CAM' | 'CAM' | 'SHARE'): void;
99
- /**
100
- * @deprecated
101
- * @param options
102
- */
103
- switchTo({ meetingId, payload, token }: { meetingId: string; payload: string; token: string }): Promise<void>;
104
- /**
105
- * @description This method returns the Video Statistics of the participant.
106
- * To learn more about the video statistics check these [reference](https://docs.videosdk.live/react/guide/video-and-audio-calling-api-sdk/render-media/understanding-call-quality)
107
- */
108
- getVideoStats(): Promise<
109
- Array<{
110
- bitrate: number;
111
- rtt: number;
112
- network: string;
113
- codec: string;
114
- jitter: number;
115
- limitation: any;
116
- totalPackets: number;
117
- packetsLost: number;
118
- concealmentEvents: number;
119
- insertedSamplesForDecelaration: number;
120
- removedSamplesForAccelaration: number;
121
- size: any;
122
- currentSpatialLayer: number;
123
- currentTemporalLayer: number;
124
- preferredSpatialLayer: number;
125
- preferredTemporalLayer: number;
126
- }>
127
- >;
128
- /**
129
- * @description This method returns the Screen Share Statistics of the participant.
130
- * To learn more about the video statistics check these [reference](https://docs.videosdk.live/react/guide/video-and-audio-calling-api-sdk/render-media/understanding-call-quality)
131
- */
132
- getShareStats(): Promise<
133
- Array<{
134
- bitrate: number;
135
- rtt: number;
136
- network: string;
137
- codec: string;
138
- jitter: number;
139
- limitation: any;
140
- totalPackets: number;
141
- packetsLost: number;
142
- concealmentEvents: number;
143
- insertedSamplesForDecelaration: number;
144
- removedSamplesForAccelaration: number;
145
- size: any;
146
- currentSpatialLayer: number;
147
- currentTemporalLayer: number;
148
- preferredSpatialLayer: number;
149
- preferredTemporalLayer: number;
150
- }>
151
- >;
152
- /**
153
- * @description This method returns the Audio Statistics of the participant.
154
- * To learn more about the video statistics check these [reference](https://docs.videosdk.live/react/guide/video-and-audio-calling-api-sdk/render-media/understanding-call-quality)
155
- */
156
- getAudioStats(): Promise<
157
- Array<{
158
- bitrate: number;
159
- rtt: number;
160
- network: string;
161
- codec: string;
162
- jitter: number;
163
- totalPackets: number;
164
- packetsLost: number;
165
- concealmentEvents: number;
166
- insertedSamplesForDecelaration: number;
167
- removedSamplesForAccelaration: number;
168
- size: any;
169
- }>
170
- >;
171
- consumeMicStreams(): void;
172
- consumeWebcamStreams(): void;
173
- stopConsumingWebcamStreams(): void;
174
- stopConsumingMicStreams(): void;
175
- /**
176
- * Add event listener
177
- * @param eventType Event name to which you want to subscribe.
178
- * @param listener Callback function which will be triggered when the event happens
179
- */
180
- on(
181
- eventType: 'stream-enabled' | 'stream-disabled' | 'media-status-changed' | 'video-quality-changed',
182
- listener: (data: any) => void,
183
- ): void;
184
- /**
185
- * Remove event
186
- * @param eventType Event name to which you want to unsubscribe.
187
- * @param listener Callback function which was passed while subscribing to the event
188
- */
189
- off(
190
- eventType: 'stream-enabled' | 'stream-disabled' | 'media-status-changed' | 'video-quality-changed',
191
- listener: (data: any) => void,
192
- ): void;
193
- }
194
- import { Stream } from './stream';
@@ -1,5 +0,0 @@
1
- export declare enum Permission {
2
- AUDIO = "audio",
3
- VIDEO = "video",
4
- AUDIO_AND_VIDEO = "audio_video"
5
- }
@@ -1,27 +0,0 @@
1
- export class Stream {
2
- /**
3
- * Id of the stream
4
- */
5
- id: string;
6
- /**
7
- * @description This represents the type of Stream
8
- */
9
- kind: 'audio' | 'video' | 'share' | 'shareAudio';
10
- /**
11
- * @description This represents the codec of the stream
12
- */
13
- codec: string;
14
- /**
15
- * @description This represents the track which can be used to play the audio or video of the participant
16
- */
17
- track: MediaStreamTrack;
18
- /**
19
- * @description This method can be used to pause the incoming audio stream
20
- */
21
- pause(): void;
22
- /**
23
- * @description This method can be used to resume the incoming audio stream
24
- */
25
- resume(): void;
26
- get paused(): any;
27
- }