Controlling Media Quality and Constraints
Learn to shape WebRTC media: applying resolution and frame-rate constraints, muting tracks, switching devices, and adjusting encoding bitrate for adaptive quality.
Beyond Just Getting Media
You can access devices and display remote streams. Now you will learn to control media quality: resolution, frame rate, muting, device switching, and bandwidth, so calls look good and stay smooth on any network.
Media Constraints
When requesting media you pass constraints describing the quality you want. The browser tries to satisfy them, falling back if the hardware cannot.
const stream = await navigator.mediaDevices.getUserMedia({
video: { width: 1280, height: 720, frameRate: 30 },
audio: { echoCancellation: true }
});All lessons in this course
- Accessing User Media Devices
- Adding and Removing Media Tracks
- Displaying Remote Audio/Video
- Controlling Media Quality and Constraints