WebIDLpedia

MediaDevices interface

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:

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