MediaTrackConstraints: suppressLocalAudioPlayback property
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Experimental:This is anexperimental technology
Check theBrowser compatibility table carefully before using this in production.
TheMediaTrackConstraints dictionary'ssuppressLocalAudioPlayback property is aConstrainBoolean describing the requested or mandatory constraints placed upon the value of thesuppressLocalAudioPlayback constrainable property. This property controls whether the audio playing in a tab will continue to be played out of a user's local speakers when the tab is captured.
If needed, you can determine whether or not this constraint is supported by checkingthe value ofMediaTrackSupportedConstraints.suppressLocalAudioPlayback as returnedby a call toMediaDevices.getSupportedConstraints(). However, typicallythis is unnecessary since browsers will ignore any constraints they're unfamiliar with.
In this article
Value
AConstrainBoolean value.
If this value is a simpletrue orfalse, the user agent willattempt to obtain media with local audio playback enabled or disabled as specified, ifpossible, but will not fail if this can't be done.
If the value is given asideal, that field's boolean value indicates an idealsetting for the local audio playback suppression feature; if it can't be met, then the request willresult in an error.
Examples
let isLocalAudioSuppressed = displayStream .getVideoTracks()[0] .getSettings().suppressLocalAudioPlayback;TheConstraint exerciser example shows how to use media track constraints.
Specifications
| Specification |
|---|
| Screen Capture> # dom-mediatrackconstraintset-suppresslocalaudioplayback> |