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()
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 theaspectRatioconstraint. 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
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 theautoGainControlconstraint.
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
BackgroundBlur
[Value("backgroundBlur")]
public bool BackgroundBlur
Field Value
Brightness
[Value("brightness")]
public bool Brightness
Field Value
ChannelCount
The MediaTrackSupportedConstraints dictionary'schannelCount 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 befalse.
[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 thechannelCountconstraint. 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 callingnavigator.mediaDevices.getSupportedConstraints().
-Media Capture and Streams API
-GetSupportedConstraints()
-MediaTrackSupportedConstraints
-MediaStreamTrack
ColorTemperature
[Value("colorTemperature")]
public bool ColorTemperature
Field Value
Contrast
[Value("contrast")]
public bool Contrast
Field Value
Cursor
[Value("cursor")]
public bool Cursor
Field Value
DeviceId
The MediaTrackSupportedConstraints dictionary'sdeviceId 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 befalse.
[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 thedeviceIdconstraint. 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 callingnavigator.mediaDevices.getSupportedConstraints().
-Media Capture and Streams API
-GetSupportedConstraints()
-MediaTrackSupportedConstraints
-MediaStreamTrack
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
trueif the MediaTrackConstraints.DisplaySurface constraint is supported by the device and user agent.
Remarks
The supported constraints list is obtained by calling GetSupportedConstraints().
-Screen Capture API
-Using the screen capture API
-Capabilities, constraints, and settings
-GetDisplayMedia(DisplayMediaStreamOptions)
-GetConstraints()
-ApplyConstraints(MediaTrackConstraints)
-GetSettings()
EchoCancellation
The MediaTrackSupportedConstraints dictionary'sechoCancellation 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 befalse.
[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 theechoCancellationconstraint. 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 callingnavigator.mediaDevices.getSupportedConstraints().
-Media Capture and Streams API
-GetSupportedConstraints()
-MediaTrackSupportedConstraints
-MediaStreamTrack
ExposureCompensation
[Value("exposureCompensation")]
public bool ExposureCompensation
Field Value
ExposureMode
[Value("exposureMode")]
public bool ExposureMode
Field Value
ExposureTime
[Value("exposureTime")]
public bool ExposureTime
Field Value
FacingMode
The MediaTrackSupportedConstraints dictionary'sfacingMode 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 befalse.
[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 thefacingModeconstraint. 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 callingnavigator.mediaDevices.getSupportedConstraints().
-Media Capture and Streams API
-GetSupportedConstraints()
-MediaTrackSupportedConstraints
-MediaStreamTrack
FocusDistance
[Value("focusDistance")]
public bool FocusDistance
Field Value
FocusMode
[Value("focusMode")]
public bool FocusMode
Field Value
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
frameRateconstraint.
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 alwaystrue.
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
GroupId
The MediaTrackSupportedConstraints dictionary'sgroupId 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 befalse.
[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 thegroupIdconstraint. 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 callingnavigator.mediaDevices.getSupportedConstraints().
-Media Capture and Streams API
-GetSupportedConstraints()
-MediaTrackSupportedConstraints
-MediaStreamTrack
Height
The MediaTrackSupportedConstraints dictionary'sheight 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 befalse.
[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 theheightconstraint. 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 callingnavigator.mediaDevices.getSupportedConstraints().
-Media Capture and Streams API
-GetSupportedConstraints()
-MediaTrackSupportedConstraints
-MediaStreamTrack
Iso
[Value("iso")]
public bool Iso
Field Value
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 thelatencyconstraint.
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
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
trueif the MediaTrackConstraints.LogicalSurface constraint is supported by the device and user agent.
Remarks
The supported constraints list is obtained by calling GetSupportedConstraints().
-Screen Capture API
-Using the screen capture API
-Capabilities, constraints, and settings
-GetDisplayMedia(DisplayMediaStreamOptions)
-GetConstraints()
-ApplyConstraints(MediaTrackConstraints)
-GetSettings()
NoiseSuppression
The MediaTrackSupportedConstraints dictionary'snoiseSuppression 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 thenoiseSuppressionconstraint (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 callingnavigator.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
Pan
[Value("pan")]
public bool Pan
Field Value
PointsOfInterest
[Value("pointsOfInterest")]
public bool PointsOfInterest
Field Value
ResizeMode
[Value("resizeMode")]
public bool ResizeMode
Field Value
RestrictOwnAudio
[Value("restrictOwnAudio")]
public bool RestrictOwnAudio
Field Value
SampleRate
The MediaTrackSupportedConstraints dictionary'ssampleRate 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 befalse.
[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 thesampleRateconstraint. 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 callingnavigator.mediaDevices.getSupportedConstraints().
-Media Capture and Streams API
-GetSupportedConstraints()
-MediaTrackSupportedConstraints
-MediaStreamTrack
SampleSize
The MediaTrackSupportedConstraints dictionary'ssampleSize 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 befalse.
[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 thesampleSizeconstraint. 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 callingnavigator.mediaDevices.getSupportedConstraints().
-Media Capture and Streams API
-GetSupportedConstraints()
-MediaTrackSupportedConstraints
-MediaStreamTrack
Saturation
[Value("saturation")]
public bool Saturation
Field Value
Sharpness
[Value("sharpness")]
public bool Sharpness
Field Value
SuppressLocalAudioPlayback
NOTE
ExperimentalsuppressLocalAudioPlayback 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
trueif the MediaTrackConstraints.SuppressLocalAudioPlayback constraint is supported by the device and user agent.
Remarks
The supported constraints list is obtained by calling GetSupportedConstraints().
-Screen Capture API
-Using the screen capture API
-Capabilities, constraints, and settings
-GetDisplayMedia(DisplayMediaStreamOptions)
-GetConstraints()
-ApplyConstraints(MediaTrackConstraints)
-GetSettings()
Tilt
[Value("tilt")]
public bool Tilt
Field Value
Torch
[Value("torch")]
public bool Torch
Field Value
WhiteBalanceMode
[Value("whiteBalanceMode")]
public bool WhiteBalanceMode
Field Value
Width
The MediaTrackSupportedConstraints dictionary'swidth 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 befalse.
[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 thewidthconstraint. 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 callingnavigator.mediaDevices.getSupportedConstraints().
-Media Capture and Streams API
-GetSupportedConstraints()
-MediaTrackSupportedConstraints
-MediaStreamTrack
Zoom
[Value("zoom")]
public bool Zoom