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 1126475 of ConstrainDOMString

  • Revision slug: Web/API/ConstrainDOMStringParameters
  • Revision title: ConstrainDOMStringParameters
  • Revision id: 1126475
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment New page for bug 1213517

Revision Content

{{APIRef("Media Capture and Streams")}}

The ConstrainDOMStringParameters dictionary is used to specify a constraint for a property whose value is a string. It allows you to specify one or more exact string values from which one must be the parameter's value, or a set of ideal values which should be used if possible.

Properties

exact
Either a single {{domxref("DOMString")}} which must be the value of the property, or an array of DOMString objects one of which must be the property's value. If the property can't be set to one of the listed values, matching will fail.
ideal
Either a single {{domxref("DOMString")}} or an arrray of DOMStrings specifying ideal values for the property. If possible, one of the listed values will be used, but if it's not possible, the user agent will use the closest possible match.

Specifications

Specification Status Comment
{{SpecName('Media Capture', '#idl-def-ConstrainDOMStringParameters', 'ConstrainDOMStringParameters')}} {{Spec2('Media Capture')}} Initial definition

Browser compatibility

{{CompatibilityTable}}
Feature Chrome Firefox (Gecko) Internet Explorer Microsoft Edge Opera Safari (WebKit)
Basic support {{CompatVersionUnknown}} {{CompatGeckoDesktop(50)}} {{CompatNo}} {{CompatUnknown}} {{CompatNo}} {{CompatUnknown}}
Feature Android Android Webview Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile Chrome for Android
Basic support {{CompatUnknown}} {{CompatVersionUnknown}} {{CompatGeckoMobile(50)}} {{CompatNo}} {{CompatNo}} {{CompatUnknown}} {{CompatVersionUnknown}}

See also

Revision Source

<div>{{APIRef("Media Capture and Streams")}}</div>

<p>The <strong><code>ConstrainDOMStringParameters</code></strong> dictionary is used to specify a constraint for a property whose value is a string. It allows you to specify one or more <code>exact</code> string values from which one must be the parameter's value, or a set of <code>ideal</code> values which should be used if possible.</p>

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

<dl>
 <dt><code>exact</code></dt>
 <dd>Either a single {{domxref("DOMString")}} which must be the value of the property, or an array of <code>DOMString</code> objects one of which must be the property's value. If the property can't be set to one of the listed values, matching will fail.</dd>
 <dt><code>ideal</code></dt>
 <dd>Either a single {{domxref("DOMString")}} or an arrray of DOMStrings specifying ideal values for the property. If possible, one of the listed values will be used, but if it's not possible, the user agent will use the closest possible match.</dd>
</dl>

<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-ConstrainDOMStringParameters', 'ConstrainDOMStringParameters')}}</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>Microsoft Edge</th>
   <th>Opera</th>
   <th>Safari (WebKit)</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatGeckoDesktop(50)}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatUnknown}}</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>IE Phone</th>
   <th>Opera Mobile</th>
   <th>Safari Mobile</th>
   <th>Chrome for Android</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatGeckoMobile(50)}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
  </tr>
 </tbody>
</table>
</div>

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

<ul>
 <li><a href="/en-US/docs/Web/API/Media_Streams_API">Media Capture and Streams API</a></li>
 <li><a href="/en-US/docs/Web/API/Media_Streams_API/Constraints">Capabilities, constraints, and settings</a></li>
 <li>{{domxref("MediaTrackConstraints")}}</li>
 <li>{{domxref("MediaTrackCapabilities")}}</li>
 <li>{{domxref("MediaTrackSupportedConstraints")}}</li>
</ul>
Revert to this revision