demo · v141
Audio Routing Matrix
Three getDisplayMedia audio capture modes side by side — system audio, window-only audio (Chrome 141), and restricted own-audio. Try each capture, inspect the resulting MediaStreamTrack.getSettings(), and see the live level meter.
getDisplayMedia(), which requires a user gesture and the browser's screen-share picker. The audio: 'window' mode is Chrome 141+. The other modes work in all Chromium-based browsers. If you dismiss the picker the result box shows the rejection reason.
System audio
Captures everything your OS is playing — all apps, system sounds, notifications.
audio: true
Window audio only
Captures only the audio produced by the selected window — the key new Chrome 141 capability.
audio: 'window'
Screen minus own audio
Captures screen audio but excludes the browser's own output — avoids echo when the recording plays back.
audio: { restrictOwnAudio: true }
use case decision matrix
| Use case | audio: true | audio: 'window' (141) | restrictOwnAudio |
|---|---|---|---|
| Podcast recording (app only) | risky — catches all | ideal | depends on app |
| Lecture/screen capture | works | only window chosen | works + no echo |
| Game streaming | may include chat | game window only | game + chat mixed |
| Video call screen share | leaks everything | share window quietly | no own-audio loop |
| Tutorial recording | notification risk | only tutorial app | no browser sounds |
| Remote support/demo | works | exact app only | clean output |
privacy comparison
How many audio sources each mode potentially exposes (lower = more private):
Window-audio is the privacy-first choice: no accidental notification sounds, no other app's music, no system audio from other users if the machine is shared.
feature detection
// Check if 'window' is supported as an audio value
async function supportsWindowAudio() {
// No formal API to check — test by examining the SupportedConstraints,
// or by attempting capture and checking the track's getSettings().
const constraints = navigator.mediaDevices.getSupportedConstraints();
// windowAudio is a top-level option, not a constraint — check Chrome 141+
const ua = navigator.userAgent.match(/Chrome\/(\d+)/);
return ua && parseInt(ua[1]) >= 141;
}
// The call
const stream = await navigator.mediaDevices.getDisplayMedia({
video: true,
audio: "window", // Chrome 141+ — only this window's audio
});
const audioTrack = stream.getAudioTracks()[0];
if (audioTrack) {
const settings = audioTrack.getSettings();
console.log("displaySurface:", settings.displaySurface); // 'window'
console.log("label:", audioTrack.label);
}
see also
- windowAudio for getDisplayMedia() — feature index
- ChromeStatus entry
- Screen Capture spec