demo · v141

Audio Routing Demo

Play a tone from this tab, then capture the screen twice — once without restrictOwnAudio (the tab's own audio leaks into the share) and once with restrictOwnAudio: true (the tab audio is stripped out). Level meters show the difference in real time.

checking restrictOwnAudio constraint support…

Tab audio source (Web Audio oscillator)

440 Hz
20 %

Standard capture

audio: { restrictOwnAudio: false } — the tab's own audio IS included in the stream.

idle
track.getSettings() will appear here after capture

restrictOwnAudio: true

audio: { restrictOwnAudio: true } — the tab's own audio is EXCLUDED from the stream.

idle
track.getSettings() will appear here after capture

Use case: video call + screen share

Without restrictOwnAudio — feedback loop risk:
remote call audio
speakers / tab
getDisplayMedia
includes own tab audio
remote sees echo

With restrictOwnAudio: true — clean share:
remote call audio
speakers / tab
getDisplayMedia
tab audio stripped
remote sees only screen

the call

// Legacy — tab's own audio is captured:
const stream = await navigator.mediaDevices.getDisplayMedia({
  video: true,
  audio: true,
});

// Chrome 141+ — tab's own audio excluded:
const stream = await navigator.mediaDevices.getDisplayMedia({
  video: true,
  audio: { restrictOwnAudio: true },
});

// Verify the constraint was honoured:
const track = stream.getAudioTracks()[0];
const settings = track.getSettings();
console.log(settings.restrictOwnAudio); // true

// Workaround before 141: route audio through system mixer,
// capture system audio separately and exclude the browser's
// output channel — brittle and OS-specific.

see also