recursal/MDN huggingface dataset:
MediaTrackSettings: aspectRatio property
========================================

 The `MediaTrackSettings` dictionary's **`aspectRatio`** property is a double-precision floating-point number indicating the aspect ratio of the `MediaStreamTrack` as currently configured.
 This lets you determine what value was selected to comply with your specified constraints for this property's value as described in the `MediaTrackConstraints.aspectRatio` property you provided when calling either `getUserMedia()` or `MediaStreamTrack.applyConstraints()`.

 If needed, you can determine whether or not this constraint is supported by checking
 the value of `MediaTrackSupportedConstraints.aspectRatio` as returned by a
 call to `MediaDevices.getSupportedConstraints()`. However, typically this
 is unnecessary since browsers will ignore any constraints they're unfamiliar with.

Value
-----

 A double-precision floating-point number indicating the current configuration of the
 track's aspect ratio. The aspect ratio is computed by taking the track's width, dividing
 by its height, and rounding the result to ten decimal places. For example, the standard
 16:9 high-definition aspect ratio can be computed as 1920/1080, or 1.7777777778.

Examples
--------

See the Constraint exerciser example.

Specifications
--------------

| Specification |
| --- |
| Media Capture and Streams # dom-mediatracksettings-aspectratio |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* Media Capture and Streams API
* Capabilities, constraints, and settings
* `MediaTrackConstraints.aspectRatio`
* `MediaTrackSettings`
MediaTrackSettings: width property
==================================

 The `MediaTrackSettings` dictionary's **`width`**
 property is an integer indicating the number of pixels wide
 `MediaStreamTrack` is currently configured to be. This lets you determine
 what value was selected to comply with your specified constraints for this property's
 value as described in the `MediaTrackConstraints.width` property you
 provided when calling either `getUserMedia()`
 or `MediaStreamTrack.applyConstraints()`.

 If needed, you can determine whether or not this constraint is supported by checking
 the value of `MediaTrackSupportedConstraints.width` as returned by a call
 to `MediaDevices.getSupportedConstraints()`. However, typically this is
 unnecessary since browsers will ignore any constraints they're unfamiliar with.

Value
-----

An integer value indicating the width, in pixels, of the video track as currently configured.

Examples
--------

See the Constraint exerciser example.

Specifications
--------------

| Specification |
| --- |
| Media Capture and Streams # dom-mediatracksettings-width |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* Media Capture and Streams API
* Capabilities, constraints, and settings
* `MediaTrackConstraints.width`
* `MediaTrackSettings`
MediaTrackSettings: suppressLocalAudioPlayback property
=======================================================

**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

The `MediaTrackSettings` dictionary's **`suppressLocalAudioPlayback`** property controls whether the audio playing in a tab will continue to be played out of a user's local speakers when the tab is captured.

For example, in cases where you broadcast a video call to an external AV system in a conference room, you will want the audio to play out of the AV system, and not the local speakers. This way, the audio will be louder and clearer, and also in sync with the conference video.

Value
-----

The value of `suppressLocalAudioPlayback` is a boolean — `true` enables local audio playback suppression, and `false` disables it.

Examples
--------

The below function sets up the constraints object specifying the options for the call to `getDisplayMedia()`. It adds the `suppressLocalAudioPlayback` constraint (requesting that captured audio is not played out of the user's local speakers) only if it is known to be supported by the browser. Capturing is then started by calling `getDisplayMedia()` and attaching the returned stream to the video element referenced by the variable `videoElem`.


```js
async function capture() {
  const supportedConstraints = navigator.mediaDevices.getSupportedConstraints();
  const displayMediaOptions = {
    audio: {},
  };

  if (supportedConstraints.suppressLocalAudioPlayback) {
    displayMediaOptions.audio.suppressLocalAudioPlayback = true;
  }

  try {
    videoElem.srcObject =
      await navigator.mediaDevices.getDisplayMedia(displayMediaOptions);
  } catch (err) {
    /\* handle the error \*/
  }
}
```

Specifications
--------------

| Specification |
| --- |
| Screen Capture # dom-mediatracksettings-suppresslocalaudioplayback |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* Screen Capture API
* Using the screen capture API
* Capabilities, constraints, and settings
* `MediaDevices.getDisplayMedia()`
* `MediaStreamTrack.getConstraints()`
* `MediaStreamTrack.applyConstraints()`
* `MediaStreamTrack.getSettings()`
MediaTrackSettings: sampleRate property
=======================================

 The `MediaTrackSettings` dictionary's
 **`sampleRate`** property is an integer indicating how many
 audio samples per second the `MediaStreamTrack` is currently configured
 for. This lets you determine what value was selected to comply with your specified
 constraints for this property's value as described in the
 `MediaTrackConstraints.sampleRate` property you provided when calling
 either `getUserMedia()` or
 `MediaStreamTrack.applyConstraints()`.

 If needed, you can determine whether or not this constraint is supported by checking
 the value of `MediaTrackSupportedConstraints.sampleRate` as returned by a
 call to `MediaDevices.getSupportedConstraints()`. However, typically this
 is unnecessary since browsers will ignore any constraints they're unfamiliar with.

Value
-----

 An integer value indicating how many samples each second of audio data includes. Common
 values include 44,100 (standard CD audio), 48,000 (standard digital audio), 96,000
 (commonly used in audio mastering and post-production), and 192,000 (used for
 high-resolution audio in professional recording and mastering sessions). However, lower
 values are often used to reduce bandwidth requirements; 8,000 samples per second is
 adequate for comprehensible albeit imperfect human speech, and both 11,025 FPS and
 22,050 FPS are often used for low-bandwidth, reduced quality sound and music.

Examples
--------

See the Constraint exerciser example.

Specifications
--------------

| Specification |
| --- |
| Media Capture and Streams # dom-mediatracksettings-samplerate |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* Media Capture and Streams API
* Capabilities, constraints, and settings
* `MediaTrackConstraints.sampleRate`
* `MediaTrackSettings`
MediaTrackSettings: echoCancellation property
=============================================

 The `MediaTrackSettings` dictionary's
 **`echoCancellation`** property is a Boolean value whose value
 indicates whether or not echo cancellation is enabled on an audio track. This lets you
 determine what value was selected to comply with your specified constraints for this
 property's value as described in the
 `MediaTrackConstraints.echoCancellation` property you provided when calling
 either `getUserMedia()` or
 `MediaStreamTrack.applyConstraints()`.

 Echo cancellation is a feature which attempts to prevent echo effects on a two-way
 audio connection by attempting to reduce or eliminate crosstalk between the user's
 output device and their input device. For example, it might apply a filter that negates
 the sound being produced on the speakers from being included in the input track
 generated from the microphone.

 If needed, you can determine whether or not this constraint is supported by checking
 the value of `MediaTrackSupportedConstraints.echoCancellation` as returned
 by a call to `MediaDevices.getSupportedConstraints()`. However, typically
 this is unnecessary since browsers will ignore any constraints they're unfamiliar with.

 Because RTP doesn't include this information, tracks associated with a
 WebRTC `RTCPeerConnection`
 will never include this property.

Value
-----

 A Boolean value which is `true` if the track has echo cancellation
 functionality enabled or `false` if echo cancellation is disabled.

Examples
--------

See the Constraint exerciser example.

Specifications
--------------

| Specification |
| --- |
| Media Capture and Streams # dom-mediatracksettings-echocancellation |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* Media Capture and Streams API
* Capabilities, constraints, and settings
* `MediaTrackConstraints.echoCancellation`
* `MediaTrackSettings`
MediaTrackSettings: logicalSurface property
===========================================

 The `MediaTrackSettings` dictionary's
 **`logicalSurface`** property indicates whether or not the
 display area being captured is a logical surface. Logical surfaces are those which are
 not necessarily entirely onscreen, or may even be off-screen, such as windows' backing
 buffers (where only part of the buffer is visible without scrolling the containing
 window) and offscreen rendering contexts.

Value
-----

 A Boolean value which is `true` if the video track in the stream of captured
 video is taken from a logical display surface.

 The most common scenario in which a display surface may be a logical one is if the
 selected surface contains the entire content area of a window which is too large to
 display onscreen at once. Since the window that contains the surface has to be scrolled
 to show the rest of the contents, the surface is a logical one.

 A visible display surface (that is, a surface for which `logicalSurface`
 returns `false`) is the portion of a logical display surface which is
 currently visible onscreen.

 For example, a user agent *may* choose to allow the user to choose whether to
 share the entire document (a `browser` with `logicalSurface` value
 of `true`), or just the currently visible portion of the document (where the
 `logicalSurface` of the `browser` surface is `false`).

Specifications
--------------

| Specification |
| --- |
| Screen Capture # dom-mediatrackconstraintset-logicalsurface |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* Screen Capture API
* Using the screen capture API
* Capabilities, constraints, and settings
* `MediaDevices.getDisplayMedia()`
* `MediaStreamTrack.getConstraints()`
* `MediaStreamTrack.applyConstraints()`
* `MediaStreamTrack.getSettings()`
MediaTrackSettings: displaySurface property
===========================================

 The `MediaTrackSettings` dictionary's
 **`displaySurface`** property indicates the type of display
 surface being captured.

Value
-----

The value of `displaySurface` is a string that comes from the `DisplayCaptureSurfaceType` enumerated type, and is one of the following:

`browser`

The stream's video track presents the entire contents of a single browser tab which the user selected during the `getDisplayMedia()` call.

`monitor`

 The video track in the stream presents the complete contents of one or more of the
 user's screens. Any empty space (if the displays are of different dimensions) is
 filled with a backdrop chosen by the user agent.


`window`

 The stream's video track presents the contents of a single window selected by the user.
 The window may be from any application, not necessarily just from within the user agent.


Not all user agents support all of these surface types.

Specifications
--------------

| Specification |
| --- |
| Screen Capture # dom-mediatrackconstraintset-displaysurface |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* Screen Capture API
* Using the screen capture API
* Capabilities, constraints, and settings
* `MediaDevices.getDisplayMedia()`
* `MediaStreamTrack.getConstraints()`
* `MediaStreamTrack.applyConstraints()`
* `MediaStreamTrack.getSettings()`
MediaTrackSettings: autoGainControl property
============================================

 The `MediaTrackSettings` dictionary's
 **`autoGainControl`** property is a Boolean value whose value
 indicates whether or not automatic gain control (AGC) is enabled on an audio track. This
 lets you determine what value was selected to comply with your specified constraints for
 this property's value as described in the
 `MediaTrackConstraints.autoGainControl` property you provided when calling
 either `getUserMedia()` or
 `MediaStreamTrack.applyConstraints()`.

 Automatic gain control is a feature in which a sound source automatically manages
 changes in the volume of its source media to maintain a steady overall volume level.
 This feature is typically used on microphones, although it can be provided by other
 input sources as well.

 If needed, you can determine whether or not this constraint is supported by checking
 the value of `MediaTrackSupportedConstraints.autoGainControl` as returned
 by a call to `MediaDevices.getSupportedConstraints()`. However, typically
 this is unnecessary since browsers will ignore any constraints they're unfamiliar with.

Value
-----

 A Boolean value which is `true` if the track has automatic gain control
 enabled or `false` if AGC is disabled.

Examples
--------

See the Constraint exerciser example.

Specifications
--------------

| Specification |
| --- |
| Media Capture and Streams # dom-mediatracksettings-autogaincontrol |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* Media Capture and Streams API
* Capabilities, constraints, and settings
* `MediaTrackConstraints.autoGainControl`
* `MediaTrackSupportedConstraints`
MediaTrackSettings: noiseSuppression property
=============================================

 The `MediaTrackSettings` dictionary's
 **`noiseSuppression`** property is a Boolean value whose value
 indicates whether or not noise suppression technology is enabled on an audio track. This
 lets you determine what value was selected to comply with your specified constraints for
 this property's value as described in the
 `MediaTrackConstraints.noiseSuppression` property you provided when calling
 either `getUserMedia()` or
 `MediaStreamTrack.applyConstraints()`.

 Noise suppression automatically filters the audio to remove background noise, hum
 caused by equipment, and the like from the sound before delivering it to your code. This
 feature is typically used on microphones, although it is technically possible it could
 be provided by other input sources as well.

 If needed, you can determine whether or not this constraint is supported by checking
 the value of `MediaTrackSupportedConstraints.noiseSuppression` as returned
 by a call to `MediaDevices.getSupportedConstraints()`. However, typically
 this is unnecessary since browsers will ignore any constraints they're unfamiliar with.

Value
-----

 A Boolean value which is `true` if the input track has noise suppression
 enabled or `false` if AGC is disabled.

Examples
--------

See the Constraint exerciser example.

Specifications
--------------

| Specification |
| --- |
| Media Capture and Streams # dom-mediatracksettings-noisesuppression |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* Media Capture and Streams API
* Capabilities, constraints, and settings
* `MediaTrackConstraints.noiseSuppression`
* `MediaTrackSupportedConstraints`
MediaTrackSettings: height property
===================================

 The `MediaTrackSettings` dictionary's **`height`**
 property is an integer indicating the number of pixels tall
 `MediaStreamTrack` is currently configured to be. This lets you determine
 what value was selected to comply with your specified constraints for this property's
 value as described in the `MediaTrackConstraints.height` property you
 provided when calling either `getUserMedia()`
 or `MediaStreamTrack.applyConstraints()`.

 If needed, you can determine whether or not this constraint is supported by checking
 the value of `MediaTrackSupportedConstraints.height` as returned by a call
 to `MediaDevices.getSupportedConstraints()`. However, typically this is
 unnecessary since browsers will ignore any constraints they're unfamiliar with.

Value
-----

 An integer value indicating the height, in pixels, of the video track as currently
 configured.

Examples
--------

See the Constraint exerciser example.

Specifications
--------------

| Specification |
| --- |
| Media Capture and Streams # dom-mediatracksettings-height |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* Media Capture and Streams API
* Capabilities, constraints, and settings
* `MediaTrackConstraints.height`
* `MediaTrackSettings`
MediaTrackSettings: volume property
===================================

**Deprecated:** This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

**Non-standard:** This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.

 The `MediaTrackSettings` dictionary's **`volume`**
 property is a double-precision floating-point number indicating the volume of the
 `MediaStreamTrack` as currently configured, as a value from 0.0 (silence)
 to 1.0 (maximum supported volume for the device). This lets you determine what value was
 selected to comply with your specified constraints for this property's value as
 described in the `MediaTrackConstraints.volume` property you provided when
 calling either `getUserMedia()` or
 `MediaStreamTrack.applyConstraints()`.

 If needed, you can determine whether or not this constraint is supported by checking
 the value of `MediaTrackSupportedConstraints.volume` as returned by a call
 to `MediaDevices.getSupportedConstraints()`. However, typically this is
 unnecessary since browsers will ignore any constraints they're unfamiliar with.

Value
-----

 A double-precision floating-point number indicating the volume, from 0.0 to 1.0, of the
 audio track as currently configured.

Examples
--------

See the Constraint exerciser example.

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* Media Capture and Streams API
* Capabilities, constraints, and settings
* `MediaTrackConstraints.volume`
* `MediaTrackSettings`
MediaTrackSettings: deviceId property
=====================================

 The `MediaTrackSettings` dictionary's
 **`deviceId`** property is a string which
 uniquely identifies the source for the corresponding `MediaStreamTrack` for
 the origin corresponding to the browsing session. This lets you determine what value was
 selected to comply with your specified constraints for this property's value as
 described in the `MediaTrackConstraints.deviceId` property you provided
 when calling either `getUserMedia()`.

 If needed, you can determine whether or not this constraint is supported by checking
 the value of `MediaTrackSupportedConstraints.deviceId` as returned by a
 call to `MediaDevices.getSupportedConstraints()`. However, typically this
 is unnecessary since browsers will ignore any constraints they're unfamiliar with.

 Because RTP doesn't include this information, tracks associated with a
 WebRTC `RTCPeerConnection`
 will never include this property.

Value
-----

 A string whose value is an origin-unique identifier for the track's
 source. This ID is valid across multiple browsing sessions for the same origin and is
 guaranteed to be different for all other origins, so you can safely use it to request
 the same source be used for multiple sessions, for example.

 The actual value of the string, however, is determined by the source of the track, and
 there is no guarantee what form it will take, although the specification does recommend
 it be a GUID.

 Since there is a one-to-one pairing of ID with each source, all tracks with the same
 source will share the same ID for any given origin, so
 `MediaStreamTrack.getCapabilities()` will always return exactly one value
 for `deviceId`. That makes the device ID not useful for any changes to
 constraints when calling `MediaStreamTrack.applyConstraints()`.


**Note:** An exception to the rule that device IDs are the same across browsing sessions:
 private browsing mode will use a different ID, and will change it each browsing
 session.


Examples
--------

See the Constraint exerciser example.

Specifications
--------------

| Specification |
| --- |
| Media Capture and Streams # dom-mediatracksettings-deviceid |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* Media Capture and Streams API
* Capabilities, constraints, and settings
* `MediaTrackSettings.groupId`
* `MediaTrackConstraints.deviceId`
* `MediaTrackSettings`
MediaTrackSettings: cursor property
===================================

The `MediaTrackSettings` dictionary's **`cursor`** property indicates whether or not the cursor should be captured as part of the video track included in the `MediaStream` returned by `getDisplayMedia()`.

Value
-----

The value of `cursor` comes from the `CursorCaptureConstraint` enumerated string type, and may have one of the following values:

`always`

The mouse should always be visible in the video content of the `MediaStream`, unless the mouse has moved outside the area of the content.

`motion`

The mouse cursor should always be included in the video if it's moving, and for a short time after it stops moving.

`never`

The mouse cursor is never included in the shared video.

Specifications
--------------

| Specification |
| --- |
| Screen Capture # dom-mediatracksettings-cursor |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* Screen Capture API
* Using the screen capture API
* Capabilities, constraints, and settings
* `MediaDevices.getDisplayMedia()`
* `MediaStreamTrack.getConstraints()`
* `MediaStreamTrack.applyConstraints()`
* `MediaStreamTrack.getSettings()`