Table of Contents

Class MediaTrackSupportedConstraints

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

The MediaTrackSupportedConstraints dictionary establishes the list of constrainable properties recognized by the {{Glossary("user agent")}} or browser in its implementation of the MediaStreamTrack object. An object conforming to MediaTrackSupportedConstraints is returned by GetSupportedConstraints().

[ToObject]
public class MediaTrackSupportedConstraints
Inheritance
MediaTrackSupportedConstraints
Inherited Members

Remarks

Because of the way interface definitions in WebIDL work, if a constraint is requested but not supported, no error will occur. Instead, the specified constraints will be applied, with any unrecognized constraints stripped from the request. That can lead to confusing and hard to debug errors, so be sure to use getSupportedConstraints() to retrieve this information before attempting to establish constraints if you need to know the difference between silently ignoring a constraint and a constraint being accepted.

An actual constraint set is described using an object based on the MediaTrackConstraints dictionary.

To learn more about how constraints work, see Capabilities, constraints, and settings.

-Media Capture and Streams API
-Capabilities, constraints, and settings
-Screen Capture API
-Using the Screen Capture API
-MediaTrackConstraints
-GetUserMedia(MediaStreamConstraints)
-GetConstraints()
-ApplyConstraints(MediaTrackConstraints)
-GetSettings()

See also on MDN

Constructors

MediaTrackSupportedConstraints()

public MediaTrackSupportedConstraints()

Fields

AspectRatio

The MediaTrackSupportedConstraints dictionary's aspectRatio property is a read-only Boolean value which is present (and set to true) in the object returned by GetSupportedConstraints() if and only if the
user agent supports the aspectRatio constraint.
If the constraint isn't supported, it's not included in the list, so this value will never be false.

[Value("aspectRatio")]
public bool AspectRatio

Field Value

bool

This property is present in the dictionary (and its value is always true)
if the user agent supports the aspectRatio constraint. If the property
isn't present, this property is missing from the supported constraints dictionary, and
you'll get GlobalObject.Undefined if you try to look at its value.

Remarks

You can access the supported constraints dictionary by calling navigator.mediaDevices.getSupportedConstraints().

-Media Capture and Streams API
-GetSupportedConstraints()
-MediaTrackSupportedConstraints
-MediaStreamTrack

See also on MDN

AutoGainControl

The MediaTrackSupportedConstraints dictionary's autoGainControl property is a read-only Boolean value which is present (and set to true) in the object returned by GetSupportedConstraints() if and only if the {{Glossary("user agent")}} supports the autoGainControl constraint.
If the constraint isn't supported, it's not included in the list, so this value will never be false.

[Value("autoGainControl")]
public bool AutoGainControl

Field Value

bool

This property is present in the dictionary (and its value is always true) if the user agent supports the autoGainControl constraint.
If the property isn't present, this property is missing from the supported constraints dictionary, and you'll get GlobalObject.Undefined if you try to look at its value.

Remarks

You can access the supported constraints dictionary by calling navigator.mediaDevices.getSupportedConstraints().

The autoGainControl constraint indicates whether or not the browser offers the ability to automatically control the gain (volume) on media tracks; this obviously is contingent on whether or not the individual device supports automatic gain control as well; it's typically a feature provided by microphones.

-Media Capture and Streams API
-GetSupportedConstraints()
-MediaTrackSupportedConstraints
-MediaStreamTrack

See also on MDN

BackgroundBlur

[Value("backgroundBlur")]
public bool BackgroundBlur

Field Value

bool

Brightness

[Value("brightness")]
public bool Brightness

Field Value

bool

ChannelCount

The MediaTrackSupportedConstraints dictionary's
channelCount property is a read-only Boolean value which
is present (and set to true) in the object returned by
GetSupportedConstraints() if and only if the
user agent supports the channelCount constraint. If the
constraint isn't supported, it's not included in the list, so this value will never be
false.

[Value("channelCount")]
public bool ChannelCount

Field Value

bool

This property is present in the dictionary (and its value is always true)
if the user agent supports the channelCount constraint. If the property
isn't present, this property is missing from the supported constraints dictionary, and
you'll get GlobalObject.Undefined if you try to look at its value.

Remarks

You can access the supported constraints dictionary by calling
navigator.mediaDevices.getSupportedConstraints().

-Media Capture and Streams API
-GetSupportedConstraints()
-MediaTrackSupportedConstraints
-MediaStreamTrack

See also on MDN

ColorTemperature

[Value("colorTemperature")]
public bool ColorTemperature

Field Value

bool

Contrast

[Value("contrast")]
public bool Contrast

Field Value

bool

Cursor

[Value("cursor")]
public bool Cursor

Field Value

bool

DeviceId

The MediaTrackSupportedConstraints dictionary's
deviceId property is a read-only Boolean value which is
present (and set to true) in the object returned by
GetSupportedConstraints() if and only if the
user agent supports the deviceId constraint. If the
constraint isn't supported, it's not included in the list, so this value will never be
false.

[Value("deviceId")]
public bool DeviceId

Field Value

bool

This property is present in the dictionary (and its value is always true)
if the user agent supports the deviceId constraint. If the property isn't
present, this property is missing from the supported constraints dictionary, and you'll
get GlobalObject.Undefined if you try to look at its value.

Remarks

You can access the supported constraints dictionary by calling
navigator.mediaDevices.getSupportedConstraints().

-Media Capture and Streams API
-GetSupportedConstraints()
-MediaTrackSupportedConstraints
-MediaStreamTrack

See also on MDN

DisplaySurface

The MediaTrackSupportedConstraints dictionary's displaySurface property indicates whether or not the MediaTrackConstraints.DisplaySurface constraint is supported by the user agent and the device on which the content is being used.

[Value("displaySurface")]
public bool DisplaySurface

Field Value

bool

A Boolean value which is true if the MediaTrackConstraints.DisplaySurface constraint is supported by the device and user agent.

Remarks

EchoCancellation

The MediaTrackSupportedConstraints dictionary's
echoCancellation property is a read-only Boolean value
which is present (and set to true) in the object returned by
GetSupportedConstraints() if and only if the
user agent supports the echoCancellation constraint. If the
constraint isn't supported, it's not included in the list, so this value will never be
false.

[Value("echoCancellation")]
public bool EchoCancellation

Field Value

bool

This property is present in the dictionary (and its value is always true)
if the user agent supports the echoCancellation constraint. If the property
isn't present, this property is missing from the supported constraints dictionary, and
you'll get GlobalObject.Undefined if you try to look at its value.

Remarks

You can access the supported constraints dictionary by calling
navigator.mediaDevices.getSupportedConstraints().

-Media Capture and Streams API
-GetSupportedConstraints()
-MediaTrackSupportedConstraints
-MediaStreamTrack

See also on MDN

ExposureCompensation

[Value("exposureCompensation")]
public bool ExposureCompensation

Field Value

bool

ExposureMode

[Value("exposureMode")]
public bool ExposureMode

Field Value

bool

ExposureTime

[Value("exposureTime")]
public bool ExposureTime

Field Value

bool

FacingMode

The MediaTrackSupportedConstraints dictionary's
facingMode property is a read-only Boolean value which is
present (and set to true) in the object returned by
GetSupportedConstraints() if and only if the
user agent supports the facingMode constraint. If the
constraint isn't supported, it's not included in the list, so this value will never be
false.

[Value("facingMode")]
public bool FacingMode

Field Value

bool

This property is present in the dictionary (and its value is always true)
if the user agent supports the facingMode constraint. If the property isn't
present, this property is missing from the supported constraints dictionary, and you'll
get GlobalObject.Undefined if you try to look at its value.

Remarks

You can access the supported constraints dictionary by calling
navigator.mediaDevices.getSupportedConstraints().

-Media Capture and Streams API
-GetSupportedConstraints()
-MediaTrackSupportedConstraints
-MediaStreamTrack

See also on MDN

FocusDistance

[Value("focusDistance")]
public bool FocusDistance

Field Value

bool

FocusMode

[Value("focusMode")]
public bool FocusMode

Field Value

bool

FrameRate

The MediaTrackSupportedConstraints dictionary's frameRate property is a read-only Boolean value which is
present (and set to true) in the object returned by GetSupportedConstraints() if and only if the {{Glossary("user agent")}} supports the MediaTrackConstraints.FrameRate constraint.

[Value("frameRate")]
public bool FrameRate

Field Value

bool

This property is present in the dictionary if the user agent supports the frameRate constraint.
If the property isn't present, the user agent doesn't allow specifying limits on the frame rate for video tracks.

NOTE
If this property is present, its value is always true.

Remarks

If the constraint isn't supported, it's not included in the list, so this value will never be false.

The frameRate constraint can be used to establish acceptable upper and lower bounds on the video frame rate for a new video track, or to specify an exact frame rate that must be provided for the request to succeed.
Checking the value of this property lets you determine if the user agent allows constraining the video track configuration by frame rate. See the example to see how this can be used.

-Media Capture and Streams API
-GetSupportedConstraints()
-MediaTrackSupportedConstraints
-MediaStreamTrack

See also on MDN

GroupId

The MediaTrackSupportedConstraints dictionary's
groupId property is a read-only Boolean value which is
present (and set to true) in the object returned by
GetSupportedConstraints() if and only if the
user agent supports the groupId constraint. If the
constraint isn't supported, it's not included in the list, so this value will never be
false.

[Value("groupId")]
public bool GroupId

Field Value

bool

This property is present in the dictionary (and its value is always true)
if the user agent supports the groupId constraint. If the property isn't
present, this property is missing from the supported constraints dictionary, and you'll
get GlobalObject.Undefined if you try to look at its value.

Remarks

You can access the supported constraints dictionary by calling
navigator.mediaDevices.getSupportedConstraints().

-Media Capture and Streams API
-GetSupportedConstraints()
-MediaTrackSupportedConstraints
-MediaStreamTrack

See also on MDN

Height

The MediaTrackSupportedConstraints dictionary's
height property is a read-only Boolean value which is
present (and set to true) in the object returned by
GetSupportedConstraints() if and only if the
user agent supports the height constraint. If the
constraint isn't supported, it's not included in the list, so this value will never be
false.

[Value("height")]
public bool Height

Field Value

bool

This property is present in the dictionary (and its value is always true)
if the user agent supports the height constraint. If the property isn't
present, this property is missing from the supported constraints dictionary, and you'll
get GlobalObject.Undefined if you try to look at its value.

Remarks

You can access the supported constraints dictionary by calling
navigator.mediaDevices.getSupportedConstraints().

-Media Capture and Streams API
-GetSupportedConstraints()
-MediaTrackSupportedConstraints
-MediaStreamTrack

See also on MDN

Iso

[Value("iso")]
public bool Iso

Field Value

bool

Latency

The MediaTrackSupportedConstraints dictionary's latency property is a read-only Boolean value which is present (and set to true) in the object returned by GetSupportedConstraints() if and only if the {{Glossary("user agent")}} supports the latency constraint.
If the constraint isn't supported, it's not included in the list, so this value will never be false.

[Value("latency")]
public bool Latency

Field Value

bool

This property is present in the dictionary (and its value is always true) if the user agent supports the latency constraint.
If the property isn't present, this property is missing from the supported constraints dictionary, and you'll get GlobalObject.Undefined if you try to look at its value.

Remarks

You can access the supported constraints dictionary by calling navigator.mediaDevices.getSupportedConstraints().

-Media Capture and Streams API
-GetSupportedConstraints()
-MediaTrackSupportedConstraints
-MediaStreamTrack

See also on MDN

LogicalSurface

The MediaTrackSupportedConstraints dictionary's logicalSurface property indicates whether or not the MediaTrackConstraints.LogicalSurface constraint is supported by the user agent and the device on which the content is being used.

[Value("logicalSurface")]
public bool LogicalSurface

Field Value

bool

A boolean value which is true if the MediaTrackConstraints.LogicalSurface constraint is supported by the device and user agent.

Remarks

NoiseSuppression

The MediaTrackSupportedConstraints dictionary's
noiseSuppression property is a read-only Boolean value
which is present (and set to true) in the object returned by
GetSupportedConstraints() if and only if the
user agent supports the noiseSuppression
constraint. If the constraint isn't supported, it's not included in the list, so this
value will never be false.

[Value("noiseSuppression")]
public bool NoiseSuppression

Field Value

bool

This property is present in the dictionary (and its value is always true)
if the user agent supports the noiseSuppression constraint (and therefore
supports noise suppression on audio tracks). If the property isn't present, this
property is missing from the supported constraints dictionary, and you'll get
GlobalObject.Undefined if you try to look at its value.

Remarks

You can access the supported constraints dictionary by calling
navigator.mediaDevices.getSupportedConstraints().

The noiseSuppression constraint indicates whether or not the browser
offers the ability to automatically control the gain (volume) on media tracks; this
obviously is contingent on whether or not the individual device supports automatic gain
control as well.

-Media Capture and Streams API
-GetSupportedConstraints()
-MediaTrackSupportedConstraints
-MediaStreamTrack

See also on MDN

Pan

[Value("pan")]
public bool Pan

Field Value

bool

PointsOfInterest

[Value("pointsOfInterest")]
public bool PointsOfInterest

Field Value

bool

ResizeMode

[Value("resizeMode")]
public bool ResizeMode

Field Value

bool

RestrictOwnAudio

[Value("restrictOwnAudio")]
public bool RestrictOwnAudio

Field Value

bool

SampleRate

The MediaTrackSupportedConstraints dictionary's
sampleRate property is a read-only Boolean value which is
present (and set to true) in the object returned by
GetSupportedConstraints() if and only if the
user agent supports the sampleRate constraint. If the
constraint isn't supported, it's not included in the list, so this value will never be
false.

[Value("sampleRate")]
public bool SampleRate

Field Value

bool

This property is present in the dictionary (and its value is always true)
if the user agent supports the sampleRate constraint. If the property isn't
present, this property is missing from the supported constraints dictionary, and you'll
get GlobalObject.Undefined if you try to look at its value.

Remarks

You can access the supported constraints dictionary by calling
navigator.mediaDevices.getSupportedConstraints().

-Media Capture and Streams API
-GetSupportedConstraints()
-MediaTrackSupportedConstraints
-MediaStreamTrack

See also on MDN

SampleSize

The MediaTrackSupportedConstraints dictionary's
sampleSize property is a read-only Boolean value which is
present (and set to true) in the object returned by
GetSupportedConstraints() if and only if the
user agent supports the sampleSize constraint. If the
constraint isn't supported, it's not included in the list, so this value will never be
false.

[Value("sampleSize")]
public bool SampleSize

Field Value

bool

This property is present in the dictionary (and its value is always true)
if the user agent supports the sampleSize constraint. If the property isn't
present, this property is missing from the supported constraints dictionary, and you'll
get GlobalObject.Undefined if you try to look at its value.

Remarks

You can access the supported constraints dictionary by calling
navigator.mediaDevices.getSupportedConstraints().

-Media Capture and Streams API
-GetSupportedConstraints()
-MediaTrackSupportedConstraints
-MediaStreamTrack

See also on MDN

Saturation

[Value("saturation")]
public bool Saturation

Field Value

bool

Sharpness

[Value("sharpness")]
public bool Sharpness

Field Value

bool

SuppressLocalAudioPlayback

NOTE
Experimental
The MediaTrackSupportedConstraints dictionary's suppressLocalAudioPlayback property indicates whether or not the MediaTrackConstraints.SuppressLocalAudioPlayback constraint is supported by the user agent and the device on which the content is being used.
[Value("suppressLocalAudioPlayback")]
public bool SuppressLocalAudioPlayback

Field Value

bool

A boolean value which is true if the MediaTrackConstraints.SuppressLocalAudioPlayback constraint is supported by the device and user agent.

Remarks

Tilt

[Value("tilt")]
public bool Tilt

Field Value

bool

Torch

[Value("torch")]
public bool Torch

Field Value

bool

WhiteBalanceMode

[Value("whiteBalanceMode")]
public bool WhiteBalanceMode

Field Value

bool

Width

The MediaTrackSupportedConstraints dictionary's
width property is a read-only Boolean value which is
present (and set to true) in the object returned by
GetSupportedConstraints() if and only if the
user agent supports the width constraint. If the constraint
isn't supported, it's not included in the list, so this value will never be
false.

[Value("width")]
public bool Width

Field Value

bool

This property is present in the dictionary (and its value is always true)
if the user agent supports the width constraint. If the property isn't
present, this property is missing from the supported constraints dictionary, and you'll
get GlobalObject.Undefined if you try to look at its value.

Remarks

You can access the supported constraints dictionary by calling
navigator.mediaDevices.getSupportedConstraints().

-Media Capture and Streams API
-GetSupportedConstraints()
-MediaTrackSupportedConstraints
-MediaStreamTrack

See also on MDN

Zoom

[Value("zoom")]
public bool Zoom

Field Value

bool