MediaTrackConstraints

The MediaTrackConstraints dictionary is used to describe a set of capabilities and the value or values each can take on. A constraints dictionary is passed into applyConstraints() to allow a script to establish a set of ideal values and/or preferred ranges of values for the track, and the most recently-requested set of custom constraints can be retrieved by calling getConstraints().

To learn more about how constraints work, see "Capabilities and constraints" in Media Capture and Streams API (Media Streams).

Properties

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

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.
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.
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.

See also

License

© 2016 Mozilla Contributors
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-us/docs/web/api/mediatrackconstraints

API Dictionary Interface Media Capture and Streams API Media Streams API MediaTrackConstraints Reference