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 an experimental technology
Check the Browser compatibility table carefully before using this in production.

The MediaTrackConstraints dictionary's suppressLocalAudioPlayback property is a ConstrainBoolean describing the requested or mandatory constraints placed upon the value of the suppressLocalAudioPlayback 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 checking the value of MediaTrackSupportedConstraints.suppressLocalAudioPlayback as returned by a call to MediaDevices.getSupportedConstraints(). However, typically this is unnecessary since browsers will ignore any constraints they're unfamiliar with.

Value

A ConstrainBoolean value.

If this value is a simple true or false, the user agent will attempt to obtain media with local audio playback enabled or disabled as specified, if possible, but will not fail if this can't be done.

If the value is given as ideal, that field's boolean value indicates an ideal setting for the local audio playback suppression feature; if it can't be met, then the request will result in an error.

Examples

js
let isLocalAudioSuppressed = displayStream
  .getVideoTracks()[0]
  .getSettings().suppressLocalAudioPlayback;

The Constraint exerciser example shows how to use media track constraints.

Specifications

Specification
Screen Capture
# dom-mediatrackconstraintset-suppresslocalaudioplayback

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
suppressLocalAudioPlayback constraint
Experimental
Chrome – Full support
Chrome 109 (Release date: 2023-01-10)
footnote Full support
Edge – Full support
Edge 109 (Release date: 2023-01-12)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 95 (Release date: 2023-02-01)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – Full support
Chrome Android 109 (Release date: 2023-01-10)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 74 (Release date: 2023-03-13)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Full support
Samsung Internet 21 (Release date: 2023-05-19)
footnote Full support
WebView Android – Full support
WebView Android 109 (Release date: 2023-01-10)
footnote Full support
WebView on iOS – No support
WebView on iOS
footnote No support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
Experimental. Expect behavior to change in the future.

See also