{{APIRef("WebRTC")}}{{SeeCompatTable}}
The MediaDevicesInfo
interface contains information on the available media input and output devices.
Properties
- {{domxref("MediaDeviceInfo.deviceId")}}{{readonlyinline}}
- Is a {{domxref("DOMString")}} that is an identifier for the represented device that is persisted across sessions. It is un-guessable by other applications and unique to the origin of the calling application. It is reset when the user clears cookies (for Private Browsing, a different identifier is used that is not persisted across sessions).
- {{domxref("MediaDeviceInfo.groupId")}}{{readonlyinline}}
- Is a {{domxref("DOMString")}} that is a group identifier. Two devices have the same group identifier if they belong to the same physical device; for example a monitor with both a built-in camera and microphone.
- kind
- Is an enumerated value that is either
"videoinput"
,"audioinput"
or"audiooutput"
. - label
- Is a {{domxref("DOMString")}} that is a label describing this device (for example "External USB Webcam"). Only available during active MediaStream use or when persistent permissions have been granted.
Methods
None.
Specifications
Specification | Status | Comment |
---|---|---|
{{SpecName('Media Capture', '#idl-def-MediaDeviceInfo', 'MediaDevicesInfo')}} | {{Spec2('Media Capture')}} | Initial definition |
Browser compatibility
{{CompatibilityTable}}
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|
Basic support | {{CompatChrome(45.0)}} [1] | 39 | {{CompatNo}} |
{{CompatNo}} |
{{CompatNo}} |
Feature | Android | Android Webview | Firefox Mobile (Gecko) | Firefox OS (Gecko) | IE Phone | Opera Mobile | Safari Mobile | Chrome for Android |
---|---|---|---|---|---|---|---|---|
Basic support | {{CompatNo}} | {{CompatNo}} | 39 | 39 | {{CompatNo}} | {{CompatNo}} | {{CompatNo}} | {{CompatNo}} |
[1] Behind a flag.
Chrome and Opera compatibility
- This interface is available in Chrome and Opera through the adapter.js polyfill.
See also
- WebRTC - the introductory page to the API