MediaTrackSupportedConstraints

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

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.

Properties

Some combination—but not necessarily all—of the following properties will exist on the object.

autoGainControl
A Boolean whose value is true if the autoGainControl constraint is supported in the current environment.
width
A Boolean value whose value is true if the width constraint is supported in the current environment.
height
A Boolean value whose value is true if the height constraint is supported in the current environment.
aspectRatio
A Boolean value whose value is true if the aspectRatio constraint is supported in the current environment.
frameRate
A Boolean value whose value is true if the frameRate constraint is supported in the current environment.
facingMode
A Boolean value whose value is true if the facingMode constraint is supported in the current environment.
resizeMode
A Boolean value whose value is true if the resizeMode constraint is supported in the current environment.
volume
A Boolean value whose value is true if the volume constraint is supported in the current environment.
sampleRate
A Boolean value whose value is true if the sampleRate constraint is supported in the current environment.
sampleSize
A Boolean value whose value is true if the sampleSize constraint is supported in the current environment.
echoCancellation
A Boolean value whose value is true if the echoCancellation constraint is supported in the current environment.
latency
A Boolean value whose value is true if the latency constraint is supported in the current environment.
noiseSuppression
A Boolean whose value is true if the noiseSuppression constraint is supported in the current environment.
channelCount
A Boolean value whose value is true if the channelCount constraint is supported in the current environment.
deviceId
A Boolean value whose value is true if the deviceId constraint is supported in the current environment.
groupId
A Boolean value whose value is true if the groupId constraint is supported in the current environment.

Properties specific to shared screen tracks

For tracks containing video sources from the user's screen contents, the following additional properties are may be included in addition to those available for video tracks.

cursor

A Boolean value which is true if the cursor constraint is supported in the current environment.

displaySurface

A Boolean value which is true if the cursor constraint is supported in the current environment.

logicalSurface
A Boolean value which is true if the logicalSurface constraint is supported in the current environment.

Browser compatibility

DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
MediaTrackSupportedConstraintsChrome Full support 52Edge Full support ≤79Firefox Full support 42IE ? Opera Full support YesSafari ? WebView Android Full support 52Chrome Android Full support 52Firefox Android Full support 42Opera Android Full support YesSafari iOS ? Samsung Internet Android Full support 6.0
aspectRatioChrome Full support 52Edge Full support ≤79Firefox No support NoIE ? Opera Full support YesSafari ? WebView Android Full support 52Chrome Android Full support 52Firefox Android No support NoOpera Android Full support YesSafari iOS ? Samsung Internet Android Full support 6.0
autoGainControlChrome Full support 69Edge Full support ≤79Firefox Full support 55
Full support 55
No support ? — 55
Prefixed
Prefixed Implemented with the vendor prefix: moz
IE ? Opera Full support YesSafari ? WebView Android Full support 69Chrome Android Full support 69Firefox Android Full support 55
Full support 55
No support ? — 55
Prefixed
Prefixed Implemented with the vendor prefix: moz
Opera Android Full support YesSafari iOS ? Samsung Internet Android Full support 10.0
channelCountChrome Full support 52Edge Full support ≤79Firefox Full support 56IE ? Opera Full support YesSafari ? WebView Android Full support 52Chrome Android Full support 52Firefox Android Full support 56Opera Android Full support YesSafari iOS ? Samsung Internet Android Full support 6.0
cursorChrome No support NoEdge No support NoFirefox No support NoIE No support NoOpera Full support YesSafari ? WebView Android No support NoChrome Android No support NoFirefox Android No support NoOpera Android ? Safari iOS ? Samsung Internet Android No support No
deviceIdChrome Full support 52Edge Full support ≤79Firefox Full support 42IE ? Opera Full support YesSafari ? WebView Android Full support 52Chrome Android Full support 52Firefox Android Full support 42Opera Android Full support YesSafari iOS ? Samsung Internet Android Full support 6.0
displaySurfaceChrome No support NoEdge No support NoFirefox No support NoIE No support NoOpera Full support YesSafari ? WebView Android No support NoChrome Android No support NoFirefox Android No support NoOpera Android ? Safari iOS ? Samsung Internet Android No support No
echoCancellationChrome Full support 52Edge Full support ≤79Firefox Full support 46IE ? Opera Full support YesSafari ? WebView Android Full support 52Chrome Android Full support 52Firefox Android Full support 46Opera Android Full support YesSafari iOS ? Samsung Internet Android Full support 6.0
facingModeChrome Full support 52Edge Full support ≤79Firefox Full support 42IE ? Opera Full support YesSafari ? WebView Android Full support 52Chrome Android Full support 52Firefox Android Full support 42Opera Android Full support YesSafari iOS ? Samsung Internet Android Full support 6.0
frameRateChrome Full support 52Edge Full support ≤79Firefox Full support 42IE ? Opera Full support YesSafari ? WebView Android Full support 52Chrome Android Full support 52Firefox Android Full support 42Opera Android Full support YesSafari iOS ? Samsung Internet Android Full support 6.0
groupIdChrome Full support 52Edge Full support ≤79Firefox Full support 70IE ? Opera Full support YesSafari ? WebView Android Full support 52Chrome Android Full support 52Firefox Android No support NoOpera Android Full support YesSafari iOS ? Samsung Internet Android Full support 6.0
heightChrome Full support 52Edge Full support ≤79Firefox Full support 42IE ? Opera Full support YesSafari ? WebView Android Full support 52Chrome Android Full support 52Firefox Android Full support 42Opera Android Full support YesSafari iOS ? Samsung Internet Android Full support 6.0
latencyChrome Full support 52Edge Full support ≤79Firefox No support NoIE ? Opera Full support YesSafari ? WebView Android Full support 52Chrome Android Full support 52Firefox Android No support NoOpera Android Full support YesSafari iOS ? Samsung Internet Android Full support 6.0
logicalSurfaceChrome No support NoEdge No support NoFirefox No support NoIE No support NoOpera Full support YesSafari ? WebView Android No support NoChrome Android No support NoFirefox Android No support NoOpera Android ? Safari iOS ? Samsung Internet Android No support No
noiseSuppressionChrome Full support 69Edge Full support ≤79Firefox Full support 55
Full support 55
No support ? — 55
Prefixed
Prefixed Implemented with the vendor prefix: moz
IE ? Opera Full support YesSafari ? WebView Android Full support 69Chrome Android Full support 69Firefox Android Full support 55
Full support 55
No support ? — 55
Prefixed
Prefixed Implemented with the vendor prefix: moz
Opera Android Full support YesSafari iOS ? Samsung Internet Android Full support 10.0
resizeModeChrome No support NoEdge No support NoFirefox No support NoIE ? Opera No support NoSafari ? WebView Android No support NoChrome Android No support NoFirefox Android No support NoOpera Android No support NoSafari iOS ? Samsung Internet Android No support No
sampleRateChrome Full support 52Edge Full support ≤79Firefox No support NoIE ? Opera Full support YesSafari ? WebView Android Full support 52Chrome Android Full support 52Firefox Android No support NoOpera Android Full support YesSafari iOS ? Samsung Internet Android Full support 6.0
sampleSizeChrome Full support 52Edge Full support ≤79Firefox No support NoIE ? Opera Full support YesSafari ? WebView Android Full support 52Chrome Android Full support 52Firefox Android No support NoOpera Android Full support YesSafari iOS ? Samsung Internet Android Full support 6.0
volume
DeprecatedNon-standard
Chrome Full support 52Edge Full support ≤79Firefox No support NoIE ? Opera Full support YesSafari ? WebView Android Full support 52Chrome Android Full support 52Firefox Android No support NoOpera Android Full support YesSafari iOS ? Samsung Internet Android Full support 6.0
widthChrome Full support 52Edge Full support ≤79Firefox Full support 42IE ? Opera Full support YesSafari ? WebView Android Full support 52Chrome Android Full support 52Firefox Android Full support 42Opera Android Full support YesSafari iOS ? Samsung Internet Android Full support 6.0

Legend

Full support
Full support
No support
No support
Compatibility unknown
Compatibility unknown
Non-standard. Expect poor cross-browser support.
Non-standard. Expect poor cross-browser support.
Deprecated. Not for use in new websites.
Deprecated. Not for use in new websites.
Requires a vendor prefix or different name for use.
Requires a vendor prefix or different name for use.

See also