MediaTrackSupportedConstraints: restrictOwnAudio property
Experimental:This is anexperimental technology
Check theBrowser compatibility table carefully before using this in production.
TheMediaTrackSupportedConstraints dictionary'srestrictOwnAudio property is a read-only boolean value which is present (and set totrue) in the object returned byMediaDevices.getSupportedConstraints() if and only if theuser agent supports therestrictOwnAudio constraint. If the constraint isn't supported, it's not included in the list, so this value will never befalse.
You can access the supported constraints dictionary by callingnavigator.mediaDevices.getSupportedConstraints().
In this article
Value
This property is present in the dictionary (and its value is alwaystrue) if the user agent supports therestrictOwnAudio constraint. If the property isn't present, this property is missing from the supported constraints dictionary, and you'll getundefined if you try to access its value.
Examples
<div></div>#result { font: 14px "Arial", sans-serif;}const result = document.getElementById("result");const supported = navigator.mediaDevices.getSupportedConstraints().restrictOwnAudio;result.textContent = supported ? "Supported!" : "Not supported!";Result
Specifications
| Specification |
|---|
| Screen Capture> # dom-mediatrackconstraintset-restrictownaudio> |