Media Capture and Streams API (Media Stream)
MediaStream consists of zero or more
MediaStreamTrack (en-US) objects, representing various audio or video tracks. Each
MediaStreamTrack may have one or more channels. The channel represents the smallest unit of a media stream, such as an audio signal associated with a given speaker, like left or right in a stereo audio track.
MediaStream objects have a single input and a single output. A
MediaStream object generated by
getUserMedia() (en-US) is called local, and has as its source input one of the user's cameras or microphones. A non-local
MediaStream may be representing to a media element, like <video> (en-US) or <audio> (en-US), a stream originating over the network, and obtained via the WebRTC
RTCPeerConnection (en-US) API, or a stream created using the Web Audio API
The output of the
MediaStream object is linked to a consumer. It can be a media elements, like <audio> (en-US) or <video> (en-US), the WebRTC
RTCPeerConnection (en-US) API or a Web Audio API
In these reference articles, you'll find the fundamental information you'll need to know about each of the interfaces that make up the Media Capture and Streams API.
Early versions of the Media Capture and Streams API specification included separate
VideoStreamTrack interfaces—each based upon
MediaStreamTrack (en-US)—which represented streams of those types. These no longer exist, and you should update any existing code to instead use
The articles below provide additional guidance and how-to information that will help you learn to use the API, and how to perform specific tasks that you may wish to handle.
There are no subpages at this time.
BCD tables only load in the browser