demo · v152 · media capture
Hint vs Default
Run two separately user-mediated captures — one with audioSelection: "preferred", one without — and record what each returned. This is an outcome log, not a controlled proof of hint effect: source choice, audio consent, browser policy, and OS state can differ between runs.
An implementation that does not recognize
audioSelection ignores that dictionary member rather than
rejecting for that reason, but JavaScript cannot determine whether this happened. To test Chromium's implementation, use a suitable build with
chrome://flags/#enable-experimental-web-platform-features or
--enable-blink-features=GetDisplayMediaAudioSelection to exercise the real hint. Either way the picker
still decides. Use the same source and audio choice across repeated trials before comparing rates; one pair of rows cannot establish causation.
probing…
| run | options passed | audio track? | track detail |
|---|---|---|---|
| with hint | audio:true, audioSelection:"preferred" | not run | — |
| without hint | audio:true | not run | — |
the two calls
// A — with the preference hint
await navigator.mediaDevices.getDisplayMedia({
video: true, audio: true, audioSelection: "preferred"
});
// B — plain request, no hint
await navigator.mediaDevices.getDisplayMedia({
video: true, audio: true
});
// Observe track presence; do not attribute one-run differences to the hint.
see also
- Preferred Capture — the single call with a live level meter
- Options Inspector — build the full options object
- ChromeStatus entry
- Spec — AudioSelectionPreferenceEnum