Definition
Media Capture and Streams defines MediaDevices
[Exposed=Window, SecureContext]
interface MediaDevices : EventTarget {
attribute EventHandler ondevicechange;
Promise<sequence<MediaDeviceInfo>> enumerateDevices();
};
partial interface MediaDevices {
MediaTrackSupportedConstraints getSupportedConstraints();
Promise<MediaStream> getUserMedia(optional MediaStreamConstraints constraints = {});
};
This interface is extended in the following specifications:
- The Capture-Handle Actions Mechanism
partial interface MediaDevices { undefined setSupportedCaptureActions(sequence<DOMString> actions); attribute EventHandler oncaptureaction; };
- Audio Output Devices API
partial interface MediaDevices { Promise<MediaDeviceInfo> selectAudioOutput(optional AudioOutputOptions options = {}); };
- Capture Handle - Bootstrapping Collaboration when Screensharing
partial interface MediaDevices { undefined setCaptureHandleConfig(optional CaptureHandleConfig config = {}); };
- Viewport Capture
partial interface MediaDevices { Promise<MediaStream> getViewportMedia( optional DisplayMediaStreamOptions options = {}); };
- Screen Capture
partial interface MediaDevices { Promise<MediaStream> getDisplayMedia(optional DisplayMediaStreamOptions options = {}); };
Consolidated IDL (across mixin and partials)
[Exposed=Window, SecureContext]
interface MediaDevices : EventTarget {
attribute EventHandler ondevicechange;
Promise<sequence<MediaDeviceInfo>> enumerateDevices();
MediaTrackSupportedConstraints getSupportedConstraints();
Promise<MediaStream> getUserMedia(optional MediaStreamConstraints constraints = {});
undefined setSupportedCaptureActions(sequence<DOMString> actions);
attribute EventHandler oncaptureaction;
Promise<MediaDeviceInfo> selectAudioOutput(optional AudioOutputOptions options = {});
undefined setCaptureHandleConfig(optional CaptureHandleConfig config = {});
Promise<MediaStream> getViewportMedia(
optional DisplayMediaStreamOptions options = {});
Promise<MediaStream> getDisplayMedia(optional DisplayMediaStreamOptions options = {});
};
Methods and attributes that return objects implementing MediaDevices
Referring IDL interfaces/dictionaries
Referring specifications
- The Capture-Handle Actions Mechanism refers to
MediaDevices
- Audio Output Devices API refers to
MediaDevices
- Capture Handle - Bootstrapping Collaboration when Screensharing refers to
MediaDevices
- Viewport Capture refers to
MediaDevices
- Screen Capture refers to
MediaDevices