files/en-us/web/api/mediatrackconstraints/echocancellation/index.md
{{APIRef("Media Capture and Streams")}}
The {{domxref("MediaTrackConstraints")}} dictionary's
echoCancellation property is a
ConstrainBooleanOrDOMString describing the requested or mandatory constraints placed
upon the value of the {{domxref("MediaTrackSettings.echoCancellation", "echoCancellation")}} constrainable property.
If needed, you can determine whether or not this constraint is supported by checking the value of {{domxref("MediaTrackSupportedConstraints.echoCancellation")}} as returned by a call to {{domxref("MediaDevices.getSupportedConstraints()")}}. However, typically this is unnecessary since browsers will ignore any constraints they're unfamiliar with.
A boolean, a string, or a ConstrainBooleanOrDOMString object.
If the browser supports specific echo cancellation types, the value can be set as one of the following:
"all" {{experimental_inline}}
"remote-only" {{experimental_inline}}
true
remote-only and should attempt to cancel as much as all.false
If the browser doesn't support specific echo cancellation types, the value can be true or false.
If set as one of the above values, the user agent will attempt to obtain media with echo cancellation enabled or disabled as specified, if possible, but will not fail if this can't be done.
If the value is given as an object with an exact field, that field's value indicates a required setting for the echo cancellation feature; if it can't be met, then the request will result in an error.
See the Constraint exerciser example.
{{Specifications}}
{{Compat}}