Set Video Quality - Javascript
- Set Video Quality feature allows participants to set other participant's video quality during the meeting.
note
This page uses the following asynchronous methods. Refer to their API reference for the errors each Promise may reject with, and handle these rejections appropriately based on your use case.
Participantclass provides thesetQuality()method to set participant's video quality.
const participant = meeting.participants.get("PARTICIPANT_ID");
const onPressed = async () => {
// Set low quality
try {
await participant.setQuality("low");
} catch (err) {
console.error("setQuality failed:", err);
}
// Set medium quality
try {
await participant.setQuality("med");
} catch (err) {
console.error("setQuality failed:", err);
}
// Set high quality
try {
await participant.setQuality("high");
} catch (err) {
console.error("setQuality failed:", err);
}
};
note
If the quality is set to high, but there is not enough network bandwidth available, quality will reduce untill the newtwork quality improves.
Event
video-quality-changed
-
video-quality-changedis a callback which gets triggered whenever a participant's video quality changes. -
currentQualityandprevQualitycan have valuesHIGH|MEDIUM|LOW.
Example
participant.on("video-quality-changed", (data) => {
const { currentQuality, prevQuality } = data;
//
});
Got a Question? Ask us on discord

