Monitoring Network Quality - React Native
VideoSDK's onQualityLimitation event fires when media quality drops during a room and when it recovers.
onQualityLimitation
-
This event is triggered whenever a media quality limitation is either detected or resolved during a room.
-
The callback includes a
typeparameter that specifies the cause of the quality limitation. Possible values:"cpu": Quality is reduced due to high CPU usage."bandwidth": Quality is reduced due to insufficient bandwidth."congestion": Quality is reduced due to network congestion.
-
The callback also includes a
stateparameter that indicates the current status of the limitation:"detected": A limitation has been identified."resolved": The limitation has been cleared.
-
Each
typeis detected and resolved on its own, so more than one limitation can be active at the same time. -
A
timestampparameter is provided, representing the exact time (in milliseconds since epoch) when the event occurred. -
Subscribe to it with the
onQualityLimitationcallback of theuseRoomhook. The callback receivestype,state, andtimestampin one object.
Example
import { useRoom } from "@videosdk.live/react-native-sdk";
export default function RoomScreen() {
useRoom({
onQualityLimitation: ({ type, state, timestamp }) => {
console.log(`Quality Limitation for ${type} is ${state} at ${timestamp}`);
},
});
return null;
}
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

