MediaTrackSettings: restrictOwnAudio property

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The MediaTrackSettings dictionary's restrictOwnAudio property controls whether system audio originating from the capturing tab is filtered out of screen capture, allowing for cleaner screen recordings in some cases.

For example, if the capturing web page itself is playing embedded audio or video, that audio would be included in the capture. Since this could lead to an undesirable echo or interfere with the intended audio sources from other tabs or applications, removing it from the capture is desirable.

Value

A boolean value, where true enables the capturing tab's system audio restriction and false disables it.

If the value is true, the user agent will attempt to remove any audio originating from the captured audio produced by the tab that called MediaDevices.getDisplayMedia() to initiate screen capture. If removal of audio via processing fails, the user agent may exclude all audio originating from the capturing tab.

Note: If the captured display surface doesn't include system audio, this setting will have no effect.

Examples

The following function sets up a constraints object that specifies the options for a call to getDisplayMedia(). It adds the restrictOwnAudio constraint (requesting that system audio originating from the capturing tab be filtered out of the screen capture) only if it is known to be supported by the browser. Capture then starts by calling getDisplayMedia() and attaching the returned stream to the <video> element referenced by the variable videoElem.

js
async function capture() {
  const supportedConstraints = navigator.mediaDevices.getSupportedConstraints();
  const displayMediaOptions = {
    audio: {},
  };

  if (supportedConstraints.restrictOwnAudio) {
    displayMediaOptions.audio.restrictOwnAudio = true;
  }

  try {
    videoElem.srcObject =
      await navigator.mediaDevices.getDisplayMedia(displayMediaOptions);
  } catch (err) {
    /* handle the error */
  }
}

Specifications

Specification
Screen Capture
# dom-mediatrackconstraintset-restrictownaudio

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
restrictOwnAudio constraint
Experimental
Chrome – Full support
Chrome 141 (Release date: 2025-09-30)
footnote Full support
Edge – Full support
Edge 141 (Release date: 2025-10-03)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 125 (Release date: 2025-12-04)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – No support
Chrome Android
footnote No support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – No support
Opera Android
footnote No support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – No support
Samsung Internet
footnote No support
WebView Android – No support
WebView Android
footnote No 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