Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. InputDeviceInfo

InputDeviceInfo

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Secure context: This feature is available only insecure contexts (HTTPS), in some or allsupporting browsers.

TheInputDeviceInfo interface of theMedia Capture and Streams API gives access to the capabilities of the input device that it represents.

InputDeviceInfo objects are returned byMediaDevices.enumerateDevices() if the returned device is an audio or video input device.

MediaDeviceInfo InputDeviceInfo

Instance properties

Also inherits properties from its parent interface,MediaDeviceInfo.

Instance methods

Also inherits methods from its parent interface,MediaDeviceInfo.

InputDeviceInfo.getCapabilities()

Returns aMediaTrackCapabilities object describing the primary audio or video track of a device'sMediaStream.

Examples

The following example gets all media devices withMediaDevices.enumerateDevices(). If any of the devices are input devices thenconsole.log(device) will print anInputDeviceInfo object to the console.

js
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

Specification
Media Capture and Streams
# dom-inputdeviceinfo

Browser compatibility

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp