files/en-us/web/api/inputdeviceinfo/index.md
{{APIRef("Media Capture and Streams")}}{{securecontext_header}}
The InputDeviceInfo interface of the {{domxref("Media Capture and Streams API", "", "", "nocode")}} gives access to the capabilities of the input device that it represents.
InputDeviceInfo objects are returned by {{domxref("MediaDevices.enumerateDevices()")}} if the returned device is an audio or video input device.
{{InheritanceDiagram}}
Also inherits properties from its parent interface, {{DOMxRef("MediaDeviceInfo")}}.
Also inherits methods from its parent interface, {{DOMxRef("MediaDeviceInfo")}}.
MediaTrackCapabilities object describing the primary audio or video track of a device's MediaStream.The following example gets all media devices with {{domxref("MediaDevices.enumerateDevices()")}}. If any of the devices are input devices then console.log(device) will print an InputDeviceInfo object to the console.
navigator.mediaDevices.enumerateDevices().then((devices) => {
devices.forEach((device) => {
console.log(device); // an InputDeviceInfo object if the device is an input device, otherwise a MediaDeviceInfo object.
});
});
{{Specifications}}
{{Compat}}