MediaStream API
The
MediaStream API is designed to allow you to access streams of media from local input devices, such as cameras and microphones. It was initially focused upon the getUserMedia API or gUM for short, but has now been formalized as the broader media capture and streams API, or MediaStream API for short. However, the getUserMedia()
method is still the primary way to initiate access to local input devices.
Each MediaStream object can contain a number of different MediaStreamTrack objects that each represents different input media, such as video or audio from different input sources.
Each MediaStreamTrack can then contain multiple channels (for example, the left and right audio channels). These channels are the smallest units that are defined by the MediaStream API.
MediaStream objects can then be output in two key ways. First, they can be used to render output into a MediaElement
such as a <video>
or <audio>
element (although the latter may require pre-processing...