demo · v131
One MediaStreamTrack per screen
The real surprise of getAllScreensMedia() isn't that it captures everything — it's that the call returns one MediaStream per display, each containing the captured screen's video track. Primary-screen metadata comes from track.screenDetailed().isPrimary when that capture-track method is available, not from the generic track settings.
getAllScreensMedia() only resolves inside Isolated Web Apps that ship the all-screens-capture permission policy. From a normal origin it rejects synchronously. This page probes the API and shows what comes back from your environment.
tracks
the api in use
const streams = await navigator.mediaDevices.getAllScreensMedia();
for (const stream of streams) {
const [track] = stream.getVideoTracks();
const s = track.getSettings();
// s.displaySurface === "monitor"
// track.label e.g. "DELL P2419H"
// s.deviceId stable per-display id
// s.aspectRatio / width / height
// track.screenDetailed?.()?.isPrimary // ScreenDetailed metadata
}
why one-track-per-screen matters
The planning use cases included compliance recording in regulated industries (contact centres, financial advisors, prisons) where every connected display must be archived. A single combined-canvas stream would not be enough: investigators need to be able to replay each monitor independently. The per-track design also lets a kiosk app route one display to local preview while uploading the others, and it lets web-based digital-signage products show different content per screen without window choreography.