Skip to main content
Version: 0.x.x

Monitoring Remote Participants' Stream - React

Monitoring the state of a remote participant’s stream helps ensure a consistent and high-quality meeting experience. The onStreamStateChanged event accesible from the useStream hook provides real-time updates whenever the condition of a remote video or screenshare video stream changes — allowing your app to detect issues and respond accordingly.

By subscribing to this event, you can track when a stream becomes active, stuck, or experiences a freeze, and take corrective actions or inform users as needed.

note

This event is emitted exclusively for remote participants, specifically for their video and screen share video streams.

Why It Matters

Stream state monitoring is crucial for maintaining call reliability and diagnosing issues that affect the remote participant’s media. Using this event, you can:

  • Detect when a remote participant’s video freezes or becomes stuck.
  • Notify local participants about possible issues.
  • Log state transitions for diagnostics or quality metrics.

Example Usage

import { useStream } from "@videosdk.live/react-sdk";

function onStreamStateChanged(data) {
const { state, timestamp } = data;
}


const {webcamStream} = useParticipant(participantId)
const {
} = useStream(webcamStream?.id,{
onStreamStateChanged,
...
});

API Reference

The API references for all the methods and events utilized in this guide are provided below.

Got a Question? Ask us on discord