@videosdk.live/react-sdk 0.4.7 → 0.4.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.
@@ -176,6 +176,8 @@ export function MeetingProvider({
176
176
  * - **SEND_AND_RECV**: Both audio and video streams will be produced and consumed in this mode.
177
177
  * - **RECV_ONLY**: Both audio and video streams will be only consumed in this mode.
178
178
  * - **SIGNALLING_ONLY**: Audio and video streams will not be produced or consumed in this mode.
179
+ * ---
180
+ * @param onQualityLimitation - This event will be emitted when a quality limitation is detected or resolved during the meeting.
179
181
  */
180
182
 
181
183
  export function MeetingConsumer({
@@ -211,7 +213,8 @@ export function MeetingConsumer({
211
213
  onRecordingStateChanged,
212
214
  onLivestreamStateChanged,
213
215
  onMeetingStateChanged,
214
- onParticipantModeChanged
216
+ onParticipantModeChanged,
217
+ onQualityLimitation,
215
218
  }: {
216
219
  children: any;
217
220
  onParticipantJoined?: (participant: Participant) => void;
@@ -338,6 +341,15 @@ export function MeetingConsumer({
338
341
  participantId: string;
339
342
  mode: 'SEND_AND_RECV' | 'SIGNALLING_ONLY' | 'RECV_ONLY'
340
343
  }) => void;
344
+ onQualityLimitation?: ({
345
+ type,
346
+ state,
347
+ timestamp,
348
+ }: {
349
+ type: "congestion" | "bandwidth" | "cpu",
350
+ state: "detected" | "resolved",
351
+ timestamp: number,
352
+ }) => void,
341
353
  }): any;
342
354
 
343
355
  /**
@@ -613,6 +625,53 @@ export function useParticipant(
613
625
  >;
614
626
  };
615
627
 
628
+ /**
629
+ *
630
+ * @param streamId - ID of the stream.
631
+ * ---
632
+ * @param onStreamStateChanged - It’s a callback that triggers whenever the state of a remote participant’s video stream changes.
633
+ *
634
+ * **Code Example:**
635
+ * ```js
636
+ * function onStreamStateChanged({ state, timestamp }) {
637
+ * console.log("onStreamStateChanged", state, timestamp);
638
+ * }
639
+ * const { kind, paused, pause, resume } = useStream(streamId, {
640
+ * onStreamStateChanged,
641
+ * });
642
+ * ```
643
+ * ---
644
+ * @returns This will return the stream properties and methods.
645
+ */
646
+ export function useStream(
647
+ streamId: string,
648
+ {
649
+ onStreamStateChanged,
650
+ }?: {
651
+ onStreamStateChanged?: ({
652
+ state,
653
+ timestamp,
654
+ }: {
655
+ state:
656
+ | 'active'
657
+ | 'ended'
658
+ | 'stuck'
659
+ | 'freeze-detected'
660
+ | 'freeze-resolved';
661
+ timestamp: number;
662
+ }) => void;
663
+ }
664
+ ): {
665
+ kind: 'audio' | 'video' | 'share' | 'shareAudio';
666
+ stream: Stream;
667
+ codec: string;
668
+ track: MediaStreamTrack;
669
+ paused: boolean;
670
+ pause: () => void;
671
+ resume: () => void;
672
+ };
673
+
674
+
616
675
  /**
617
676
  * @param onParticipantJoined - This event callback is trigger when a new participant joins the meeting.
618
677
  * ---
@@ -679,6 +738,9 @@ export function useParticipant(
679
738
  * ---
680
739
  * @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)
681
740
  *
741
+ * ---
742
+ * @param onQualityLimitation - This event will be emitted when a quality limitation is detected or resolved during the meeting.
743
+
682
744
  */
683
745
 
684
746
  export function useMeeting({
@@ -721,6 +783,7 @@ export function useMeeting({
721
783
  onMediaRelayError,
722
784
  onMediaRelayRequestResponse,
723
785
  onMediaRelayRequestReceived,
786
+ onQualityLimitation,
724
787
  }?: {
725
788
  onParticipantJoined?: (participant: Participant) => void;
726
789
  onParticipantLeft?: (participant: Participant) => void;
@@ -889,6 +952,15 @@ export function useMeeting({
889
952
  accept: () => void;
890
953
  reject: () => void;
891
954
  }) => void;
955
+ onQualityLimitation?: ({
956
+ type,
957
+ state,
958
+ timestamp,
959
+ }: {
960
+ type: "congestion" | "bandwidth" | "cpu",
961
+ state: "detected" | "resolved",
962
+ timestamp: number,
963
+ }) => void,
892
964
  }): {
893
965
  meetingId: string;
894
966
  meeting: Meeting;
@@ -1707,6 +1779,8 @@ export function getNetworkStats({
1707
1779
  * ---
1708
1780
  * @param videoStyle - Custom styles for the video element inside the container.
1709
1781
  *
1782
+ * @param videoRef - Optional ref to the underlying <video> element.
1783
+ *
1710
1784
  * ---
1711
1785
  * @returns A React component that renders the participant's video stream with optional adaptive observers.
1712
1786
  *
@@ -1728,7 +1802,8 @@ export function VideoPlayer({
1728
1802
  containerStyle,
1729
1803
  className,
1730
1804
  classNameVideo,
1731
- videoStyle
1805
+ videoStyle,
1806
+ videoRef
1732
1807
  }: {
1733
1808
  participantId: string;
1734
1809
  type?: "video" | "share";
@@ -1736,6 +1811,7 @@ export function VideoPlayer({
1736
1811
  className?: string;
1737
1812
  classNameVideo?: string;
1738
1813
  videoStyle?: React.CSSProperties;
1814
+ videoRef?: React.Ref<HTMLVideoElement>
1739
1815
  }): JSX.Element;
1740
1816
 
1741
1817
  /**
@@ -552,7 +552,8 @@ export class Meeting {
552
552
  | "media-relay-stopped"
553
553
  | "media-relay-error"
554
554
  | "media-relay-request-response"
555
- | "media-relay-request-received",
555
+ | "media-relay-request-received"
556
+ | "quality-limitation",
556
557
  listener: (data: any) => void
557
558
  ): void;
558
559
  /**
@@ -609,7 +610,8 @@ export class Meeting {
609
610
  | "media-relay-stopped"
610
611
  | "media-relay-error"
611
612
  | "media-relay-request-response"
612
- | "media-relay-request-received",
613
+ | "media-relay-request-received"
614
+ | "quality-limitation",
613
615
 
614
616
  listener: (data: any) => void
615
617
  ): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@videosdk.live/react-sdk",
3
- "version": "0.4.7",
3
+ "version": "0.4.9",
4
4
  "license": "ISC",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.modern.js",
@@ -76,6 +76,5 @@
76
76
  "dependencies": {
77
77
  "@videosdk.live/js-sdk": "0.3.9",
78
78
  "events": "^3.3.0"
79
- },
80
- "packageManager": "yarn@1.22.22+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610"
81
- }
79
+ }
80
+ }