@videosdk.live/react-sdk 0.3.8 → 0.3.9
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 +155 -33
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +150 -34
- package/dist/index.modern.js.map +1 -1
- package/dist/types/index.d.ts +67 -20
- package/dist/types/meeting.d.ts +36 -3
- package/dist/types/participant.d.ts +5 -13
- package/package.json +1 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -235,8 +235,8 @@ export function MeetingConsumer({
|
|
|
235
235
|
participantId: string;
|
|
236
236
|
decision: string;
|
|
237
237
|
}) => void;
|
|
238
|
-
onPausedAllStreams?: ({ kind }: { kind: "audio" | "video" | "share" | "shareAudio" | "all" | undefined}) => void;
|
|
239
|
-
onResumedAllStreams?: ({ kind }: { kind: "audio" | "video" | "share" | "shareAudio" | "all" | undefined}) => void;
|
|
238
|
+
onPausedAllStreams?: ({ kind }: { kind: "audio" | "video" | "share" | "shareAudio" | "all" | undefined }) => void;
|
|
239
|
+
onResumedAllStreams?: ({ kind }: { kind: "audio" | "video" | "share" | "shareAudio" | "all" | undefined }) => void;
|
|
240
240
|
onRecordingStarted?: () => void;
|
|
241
241
|
onRecordingStopped?: () => void;
|
|
242
242
|
onChatMessage?: (data: {
|
|
@@ -522,6 +522,7 @@ export function useParticipant(
|
|
|
522
522
|
stopConsumingMicStreams: () => void;
|
|
523
523
|
stopConsumingWebcamStreams: () => void;
|
|
524
524
|
setQuality: (quality: 'low' | 'med' | 'high') => void;
|
|
525
|
+
setScreenShareQuality: (quality: 'low' | 'med' | 'high') => void;
|
|
525
526
|
setViewPort: (width: number, height: number) => void;
|
|
526
527
|
enableMic: () => void;
|
|
527
528
|
disableMic: () => void;
|
|
@@ -537,15 +538,6 @@ export function useParticipant(
|
|
|
537
538
|
}) => Promise<string | null>;
|
|
538
539
|
pin: (data: 'SHARE_AND_CAM' | 'CAM' | 'SHARE') => void;
|
|
539
540
|
unpin: (data: 'SHARE_AND_CAM' | 'CAM' | 'SHARE') => void;
|
|
540
|
-
switchTo: ({
|
|
541
|
-
meetingId,
|
|
542
|
-
payload,
|
|
543
|
-
token
|
|
544
|
-
}: {
|
|
545
|
-
meetingId: string;
|
|
546
|
-
payload: string;
|
|
547
|
-
token: string;
|
|
548
|
-
}) => Promise<void>;
|
|
549
541
|
getShareAudioStats: () => Promise<
|
|
550
542
|
Array<{
|
|
551
543
|
bitrate: number;
|
|
@@ -722,7 +714,12 @@ export function useMeeting({
|
|
|
722
714
|
onMeetingStateChanged,
|
|
723
715
|
onParticipantModeChanged,
|
|
724
716
|
onCharacterJoined,
|
|
725
|
-
onCharacterLeft
|
|
717
|
+
onCharacterLeft,
|
|
718
|
+
onMediaRelayStarted,
|
|
719
|
+
onMediaRelayStopped,
|
|
720
|
+
onMediaRelayError,
|
|
721
|
+
onMediaRelayRequestResponse,
|
|
722
|
+
onMediaRelayRequestReceived,
|
|
726
723
|
}?: {
|
|
727
724
|
onParticipantJoined?: (participant: Participant) => void;
|
|
728
725
|
onParticipantLeft?: (participant: Participant) => void;
|
|
@@ -747,8 +744,8 @@ export function useMeeting({
|
|
|
747
744
|
participantId: string;
|
|
748
745
|
decision: string;
|
|
749
746
|
}) => void;
|
|
750
|
-
onPausedAllStreams?: ({ kind }: { kind: "audio" | "video" | "share" | "shareAudio" | "all" | undefined}) => void;
|
|
751
|
-
onResumedAllStreams?: ({ kind }: { kind: "audio" | "video" | "share" | "shareAudio" | "all" | undefined}) => void;
|
|
747
|
+
onPausedAllStreams?: ({ kind }: { kind: "audio" | "video" | "share" | "shareAudio" | "all" | undefined }) => void;
|
|
748
|
+
onResumedAllStreams?: ({ kind }: { kind: "audio" | "video" | "share" | "shareAudio" | "all" | undefined }) => void;
|
|
752
749
|
onRecordingStarted?: () => void;
|
|
753
750
|
onRecordingStopped?: () => void;
|
|
754
751
|
onChatMessage?: (data: {
|
|
@@ -851,6 +848,47 @@ export function useMeeting({
|
|
|
851
848
|
}) => void;
|
|
852
849
|
onCharacterJoined?: (character: Character) => void;
|
|
853
850
|
onCharacterLeft?: (character: Character) => void;
|
|
851
|
+
onMediaRelayStarted?: ({
|
|
852
|
+
meetingId
|
|
853
|
+
}: {
|
|
854
|
+
meetingId: string
|
|
855
|
+
}) => void;
|
|
856
|
+
onMediaRelayStopped?: ({
|
|
857
|
+
meetingId,
|
|
858
|
+
reason
|
|
859
|
+
}: {
|
|
860
|
+
meetingId: string;
|
|
861
|
+
reason: string;
|
|
862
|
+
}) => void;
|
|
863
|
+
onMediaRelayError?: ({
|
|
864
|
+
meetingId,
|
|
865
|
+
error
|
|
866
|
+
}: {
|
|
867
|
+
meetingId: string;
|
|
868
|
+
error: string;
|
|
869
|
+
}) => void;
|
|
870
|
+
onMediaRelayRequestResponse?: ({
|
|
871
|
+
decision,
|
|
872
|
+
decidedBy,
|
|
873
|
+
meetingId
|
|
874
|
+
}: {
|
|
875
|
+
decision: "accepted" | "declined";
|
|
876
|
+
decidedBy: string;
|
|
877
|
+
meetingId: string;
|
|
878
|
+
}) => void;
|
|
879
|
+
onMediaRelayRequestReceived?: ({
|
|
880
|
+
participantId,
|
|
881
|
+
meetingId,
|
|
882
|
+
displayName,
|
|
883
|
+
accept,
|
|
884
|
+
reject
|
|
885
|
+
}: {
|
|
886
|
+
participantId: string;
|
|
887
|
+
meetingId: string;
|
|
888
|
+
displayName: string;
|
|
889
|
+
accept: () => void;
|
|
890
|
+
reject: () => void;
|
|
891
|
+
}) => void;
|
|
854
892
|
}): {
|
|
855
893
|
meetingId: string;
|
|
856
894
|
meeting: Meeting;
|
|
@@ -1503,6 +1541,8 @@ export function createCameraVideoTrack({
|
|
|
1503
1541
|
*
|
|
1504
1542
|
* #### Values : `enable`, `disable`
|
|
1505
1543
|
* ---
|
|
1544
|
+
* @param multiStream - It will specifiy if the stream should send multiple resolution layers or single resolution layer.
|
|
1545
|
+
* Please refere thi link for more understanding [What is multiStream ?](https://docs.videosdk.live/react/guide/video-and-audio-calling-api-sdk/render-media/optimize-video-track#what-is-multistream)
|
|
1506
1546
|
*
|
|
1507
1547
|
* **Code Example**
|
|
1508
1548
|
* ```js
|
|
@@ -1512,23 +1552,30 @@ export function createCameraVideoTrack({
|
|
|
1512
1552
|
* optimizationMode: "motion", // "text" | "detail", Default : "motion"
|
|
1513
1553
|
* encoderConfig: "h720p_15fps", // `h360p_30fps` | `h1080p_30fps` // Default : `h720p_15fps`
|
|
1514
1554
|
* withAudio:'enable' // `disable`, Default : `disable`
|
|
1555
|
+
* multiStream: true // false, Default : false
|
|
1556
|
+
*
|
|
1515
1557
|
* });
|
|
1516
1558
|
* ```
|
|
1517
1559
|
*/
|
|
1518
1560
|
export function createScreenShareVideoTrack({
|
|
1519
1561
|
encoderConfig,
|
|
1520
1562
|
optimizationMode,
|
|
1521
|
-
withAudio
|
|
1563
|
+
withAudio,
|
|
1564
|
+
multiStream,
|
|
1522
1565
|
}: {
|
|
1523
1566
|
encoderConfig?:
|
|
1524
|
-
|
|
|
1525
|
-
|
|
|
1526
|
-
|
|
|
1527
|
-
|
|
|
1528
|
-
|
|
|
1567
|
+
| "h360p_30fps"
|
|
1568
|
+
| "h480p_15fps"
|
|
1569
|
+
| "h480p_30fps"
|
|
1570
|
+
| "h720p_5fps"
|
|
1571
|
+
| "h720p_15fps"
|
|
1572
|
+
| "h720p_30fps"
|
|
1573
|
+
| "h1080p_15fps"
|
|
1574
|
+
| "h1080p_30fps"
|
|
1529
1575
|
| undefined;
|
|
1530
1576
|
optimizationMode?: 'text' | 'motion' | 'detail' | undefined;
|
|
1531
1577
|
withAudio?: 'enable' | 'disable';
|
|
1578
|
+
multiStream?: boolean;
|
|
1532
1579
|
}): Promise<MediaStream>;
|
|
1533
1580
|
|
|
1534
1581
|
/**
|
package/dist/types/meeting.d.ts
CHANGED
|
@@ -170,7 +170,7 @@ export class Meeting {
|
|
|
170
170
|
resumeAllStreams(
|
|
171
171
|
kind?: "audio" | "video" | "share" | "shareAudio" | "all"
|
|
172
172
|
): void;
|
|
173
|
-
|
|
173
|
+
|
|
174
174
|
/**
|
|
175
175
|
* @param webhookUrl
|
|
176
176
|
* Webhook URL which will be called by VideoSDK when the recording state gets changed
|
|
@@ -463,6 +463,25 @@ export class Meeting {
|
|
|
463
463
|
meetingId: string;
|
|
464
464
|
payload: string;
|
|
465
465
|
}): Promise<void>;
|
|
466
|
+
|
|
467
|
+
/**
|
|
468
|
+
* @description This method is used to request media relay to another meeting
|
|
469
|
+
* @param options.destinationMeetingId The ID of the meeting to relay media to
|
|
470
|
+
* @param options.token Optional token for the destination meeting
|
|
471
|
+
* @param options.kinds Optional array of media types to relay ('audio', 'video', 'share', 'share_audio')
|
|
472
|
+
*/
|
|
473
|
+
requestMediaRelay(options: {
|
|
474
|
+
destinationMeetingId: string;
|
|
475
|
+
token?: string;
|
|
476
|
+
kinds?: Array<'audio' | 'video' | 'share' | 'share_audio'>;
|
|
477
|
+
}): void;
|
|
478
|
+
|
|
479
|
+
/**
|
|
480
|
+
* @description Stop relaying media to a destination meeting
|
|
481
|
+
* @param destinationMeetingId The meeting ID to stop media relay to
|
|
482
|
+
*/
|
|
483
|
+
stopMediaRelay(destinationMeetingId: string): void;
|
|
484
|
+
|
|
466
485
|
/**
|
|
467
486
|
* Add event listener
|
|
468
487
|
* @param eventType Event name to which you want to subscribe.
|
|
@@ -507,7 +526,14 @@ export class Meeting {
|
|
|
507
526
|
| 'transcription-text'
|
|
508
527
|
| 'transcription-state-changed'
|
|
509
528
|
| 'character-joined'
|
|
510
|
-
| 'character-left'
|
|
529
|
+
| 'character-left'
|
|
530
|
+
| "paused-all-streams"
|
|
531
|
+
| "resumed-all-streams"
|
|
532
|
+
| "media-relay-started"
|
|
533
|
+
| "media-relay-stopped"
|
|
534
|
+
| "media-relay-error"
|
|
535
|
+
| "media-relay-request-response"
|
|
536
|
+
| "media-relay-request-received",
|
|
511
537
|
listener: (data: any) => void
|
|
512
538
|
): void;
|
|
513
539
|
/**
|
|
@@ -554,7 +580,14 @@ export class Meeting {
|
|
|
554
580
|
| 'transcription-text'
|
|
555
581
|
| 'transcription-state-changed'
|
|
556
582
|
| 'character-joined'
|
|
557
|
-
| 'character-left'
|
|
583
|
+
| 'character-left'
|
|
584
|
+
| "paused-all-streams"
|
|
585
|
+
| "resumed-all-streams"
|
|
586
|
+
| "media-relay-started"
|
|
587
|
+
| "media-relay-stopped"
|
|
588
|
+
| "media-relay-error"
|
|
589
|
+
| "media-relay-request-response"
|
|
590
|
+
| "media-relay-request-received",
|
|
558
591
|
|
|
559
592
|
listener: (data: any) => void
|
|
560
593
|
): void;
|
|
@@ -85,6 +85,11 @@ export class Participant {
|
|
|
85
85
|
* @param quality
|
|
86
86
|
*/
|
|
87
87
|
setQuality(quality: 'low' | 'med' | 'high'): void;
|
|
88
|
+
/**
|
|
89
|
+
* @description This method can be used to set the incoming screen sharevideo quality of the participant
|
|
90
|
+
* @param quality
|
|
91
|
+
*/
|
|
92
|
+
setScreenShareQuality(quality: 'low' | 'med' | 'high'): void;
|
|
88
93
|
/**
|
|
89
94
|
* @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
|
|
90
95
|
* @param width Width of the Viewport in which participant video is shown
|
|
@@ -102,19 +107,6 @@ export class Participant {
|
|
|
102
107
|
* 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
|
|
103
108
|
*/
|
|
104
109
|
unpin(type: 'SHARE_AND_CAM' | 'CAM' | 'SHARE'): void;
|
|
105
|
-
/**
|
|
106
|
-
* @deprecated
|
|
107
|
-
* @param options
|
|
108
|
-
*/
|
|
109
|
-
switchTo({
|
|
110
|
-
meetingId,
|
|
111
|
-
payload,
|
|
112
|
-
token
|
|
113
|
-
}: {
|
|
114
|
-
meetingId: string;
|
|
115
|
-
payload: string;
|
|
116
|
-
token: string;
|
|
117
|
-
}): Promise<void>;
|
|
118
110
|
/**
|
|
119
111
|
* @description This method returns the Video Statistics of the participant.
|
|
120
112
|
* 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)
|