demo · v152 · media capture
Options Inspector
Assemble the DisplayMediaStreamOptions object member by member. audioSelection is the new v152 hint; its siblings (systemAudio, windowAudio, monitorTypeSurfaces) shape the rest of the picker. Watch the exact JSON build up, then run the call and read the result back.
A key honesty point:
audioSelection is a dictionary member, and unknown dictionary members are
silently dropped — there is no getSupportedConstraints().audioSelection and nothing on
navigator to sniff. So you cannot feature-detect it in JS. The right pattern is to always pass it (older
browsers ignore that member rather than rejecting for that reason) and design for the case where audio does not arrive. To test Chromium's runtime-gated
hint, use a suitable build with chrome://flags/#enable-experimental-web-platform-features or
--enable-blink-features=GetDisplayMediaAudioSelection.
probing…
AudioSelectionPreferenceEnum — only value is "preferred"
SystemAudioPreferenceEnum — offer the system mix for a monitor share
WindowAudioPreferenceEnum — audio behaviour when a window is picked
MonitorTypeSurfacesEnum — whether whole-monitor surfaces are offered
{ }
the resulting call
await navigator.mediaDevices.getDisplayMedia(options);
// An unknown member alone does not cause rejection.
// Capture may still reject, stall, or return video only for other reasons.
see also
- Preferred Capture — the single hinted call, with a level meter
- Hint vs Default — with-hint vs without-hint outcomes
- ChromeStatus entry
- Spec — DisplayMediaStreamOptions