Cameras and microphones available on a huge number of devices can be exploited from Web browsers via the Media Capture and Streams API. The specification also exposes information about devices able to capture and render media, including the facing mode of the device, the number of independent channels of sound, the framerate and other media settings, as well as the target latency of the configuration.
Specifications in progress
The HTML Media Capture specification defines a markup-based mechanism (the
capture attribute) to access media capture device sensors such as a camera or microphone from within a file upload control. Implementations of the
capture attribute are available on mobile devices (Safari on iOS and Chrome for Android in particular), where media capture is a common need.
Any media content captured, generated or received as a stream can be recorded via the Media Recorder API.
Media content generated or viewed in a given Web application can itself be turned into a media stream (for recording or transmission) via the Media Capture from DOM elements API. More generally, content produced by any other application (or the whole of the display) can also be turned into such a stream via the Screen Capture API.
The Mediastream Image Capture specification caters for more advanced usage of cameras that offer still-pictures settings (e.g. to control zoom or white-balance).
As depth-sensing cameras come to the market, the Media Capture Depth Stream Extensions allows capturing of the additional dimension in information they produce.
Features not covered by ongoing work
- Audio output capture
- The same way one may wish to capture the current screen display as a video stream, it would be useful to enable capturing the current audio output of the device as an audio stream.