demo · v141

Include Window Audio

Decision matrix for the three windowAudio values across the three things a user can pick (full monitor, single window, browser tab). Use case: a video-call app that wants to capture the window's audio for a demo (Loom, Tella) — windowAudio: "window" is the right default.

checking support…

Headings: user's picker choice. Rows: app's windowAudio value. Cells: what audio you get:

user picks: full monitor

user picks: window

user picks: tab

windowAudio: "window"

system audio (from systemAudio)

windowAudio: "window"

that window's audio only

windowAudio: "window"

that tab's audio only

windowAudio: "exclude"

system audio (the hint doesn't apply)

windowAudio: "exclude"

no audio (silently dropped)

windowAudio: "exclude"

no audio

windowAudio: "system"

system audio

windowAudio: "system"

system audio (not just the window)

windowAudio: "system"

system audio

no capture yet

the call

// app demo / tutorial recorder — want the window's own audio
const stream = await navigator.mediaDevices.getDisplayMedia({
  video: { displaySurface: "window" },
  audio: true,
  windowAudio: "window",
});

const settings = stream.getAudioTracks()[0]?.getSettings();
// settings.windowAudio === "window" if the platform honoured the hint

why this angle

The first concept covered the conservative use case (exclude). This one covers the opposite — apps that intentionally want the chosen window's audio. The interaction with the user's picker choice is non-obvious, which is why the matrix above matters: the same hint produces different outcomes depending on what the user selects, and the only honest way to know is getSettings().

see also