Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 918367 of MediaDeviceInfo

  • Revision slug: Web/API/MediaDeviceInfo
  • Revision title: MediaDeviceInfo
  • Revision id: 918367
  • Created:
  • Creator: jpmedley
  • Is current revision? No
  • Comment

Revision Content

{{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

Revision Source

<p>{{APIRef("WebRTC")}}{{SeeCompatTable}}</p>

<p><span class="seoSummary">The <strong><code>MediaDevicesInfo</code></strong> interface contains&nbsp;information on the available media input and output devices.</span></p>

<h2 id="Properties">Properties</h2>

<dl>
 <dt>{{domxref("MediaDeviceInfo.deviceId")}}{{readonlyinline}}</dt>
 <dd>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).</dd>
 <dt>{{domxref("MediaDeviceInfo.groupId")}}{{readonlyinline}}</dt>
 <dd>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.</dd>
 <dt>kind</dt>
 <dd>Is an enumerated value that is either <code>"videoinput"</code>, <code>"audioinput"</code> or <code>"audiooutput"</code>.</dd>
 <dt>label</dt>
 <dd>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.</dd>
</dl>

<h2 id="Methods">Methods</h2>

<p>None.</p>

<h2 id="Specifications">Specifications</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
  <tr>
   <td>{{SpecName('Media Capture', '#idl-def-MediaDeviceInfo', 'MediaDevicesInfo')}}</td>
   <td>{{Spec2('Media Capture')}}</td>
   <td>Initial definition</td>
  </tr>
 </tbody>
</table>

<h2 id="Browser_compatibility">Browser compatibility</h2>

<div>{{CompatibilityTable}}</div>

<div id="compat-desktop">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Chrome</th>
   <th>Firefox (Gecko)</th>
   <th>Internet Explorer</th>
   <th>Opera</th>
   <th>Safari (WebKit)</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{CompatChrome(45.0)}} [1]</td>
   <td>39</td>
   <td>{{CompatNo}}&nbsp;</td>
   <td>
    <p>{{CompatNo}}</p>
   </td>
   <td>{{CompatNo}}&nbsp;</td>
  </tr>
 </tbody>
</table>
</div>

<div id="compat-mobile">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Android</th>
   <th>Android Webview</th>
   <th>Firefox Mobile (Gecko)</th>
   <th>Firefox OS (Gecko)</th>
   <th>IE Phone</th>
   <th>Opera Mobile</th>
   <th>Safari Mobile</th>
   <th>Chrome for Android</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{CompatNo}}&nbsp;</td>
   <td>{{CompatNo}}</td>
   <td>39</td>
   <td>39</td>
   <td>{{CompatNo}}&nbsp;</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}&nbsp;</td>
   <td>{{CompatNo}}</td>
  </tr>
 </tbody>
</table>
</div>

<p>[1] Behind a flag.</p>

<h3 id="Chrome_and_Opera_compatibility">Chrome and Opera compatibility</h3>

<ul>
 <li>This interface is available in Chrome and Opera through the <a href="https://github.com/webrtc/adapter">adapter.js</a> polyfill.</li>
</ul>

<h2 id="See_also">See also</h2>

<ul>
 <li><a href="/en-US/docs/WebRTC" title="/en-US/docs/WebRTC">WebRTC</a> - the introductory page to the API</li>
</ul>
Revert to this revision