Accessing User Media Devices
Discover how to use `navigator.mediaDevices.getUserMedia()` to access a user's camera and microphone in a web browser.
Get User's Camera & Mic
Welcome! In this lesson, we'll learn how to access a user's camera and microphone directly from their web browser. This is the first step for any real-time video or audio application.
We'll use a powerful Web API called navigator.mediaDevices.getUserMedia().
Why getUserMedia?
getUserMedia() is a core WebRTC feature. It allows your web application to:
- Capture audio from a microphone.
- Capture video from a camera.
- Access these streams as
MediaStreamobjects.
These streams can then be displayed, recorded, or sent to other peers.
All lessons in this course
- Accessing User Media Devices
- Adding and Removing Media Tracks
- Displaying Remote Audio/Video
- Controlling Media Quality and Constraints