Skip to content

Conversation

@chrisdavidmills
Copy link
Contributor

Summary

Chrome/Edge desktop 141 add support for the getDisplayMedia() windowAudio option. See https://chromestatus.com/feature/5072779506089984.

This PR adds support for the new option. Note the slightly weird set of default values that differ across browsers and versions, and the partial implementation. I found these results by testing a modified version of https://mdn.github.io/dom-examples/screen-capture-api/basic-screen-capture/ with the new option added in.

Test results and supporting details

Related issues

@github-actions github-actions bot added data:api Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API size:m [PR only] 25-100 LoC changed labels Oct 8, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Oct 8, 2025

Tip: Review these changes grouped by change (recommended for most PRs), or grouped by feature (for large PRs).

@chrisdavidmills
Copy link
Contributor Author

@eladalon1983, could you have a look at this compat data PR and let me know if it agrees with your understanding? The data is a bit weird, but this is what my tests showed.

Copy link
Contributor

@caugner caugner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we sure the default values are inversed between Chrome and Edge?

Your changes state:

  • Chrome 141 = system, but Edge 141/142 = exclude
  • Chrome 142+ = exclude, but Edge 143+ = system

Comment on lines 472 to 490
"chrome": [
{
"version_added": "142",
"partial_implementation": true,
"notes": [
"Default value = `exclude`",
"`window` value not supported"
]
},
{
"version_added": "141",
"version_removed": "142",
"partial_implementation": true,
"notes": [
"Default value = `system`",
"`window` value not supported"
]
}
],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's merge the partial statements:

Suggested change
"chrome": [
{
"version_added": "142",
"partial_implementation": true,
"notes": [
"Default value = `exclude`",
"`window` value not supported"
]
},
{
"version_added": "141",
"version_removed": "142",
"partial_implementation": true,
"notes": [
"Default value = `system`",
"`window` value not supported"
]
}
],
"chrome": {
"version_added": "141",
"partial_implementation": true,
"notes": [
"Defaults to `\"exclude\". Before Chrome 142, it defaulted to `\"system\"`.",
"Only supports values `\"exclude\"` and `\"system\"`, not `\"window\"`."
]
},

@caugner caugner changed the title Chrome 141 getDisplayMedia() windowAudio option Chrome 141 adds getDisplayMedia() windowAudio option Oct 17, 2025
@eladalon1983
Copy link

@eladalon1983, could you have a look at this compat data PR and let me know if it agrees with your understanding? The data is a bit weird, but this is what my tests showed.

I think @drkron should take it from here. :-)

@github-actions github-actions bot added the data:css Compat data for CSS features. https://developer.mozilla.org/docs/Web/CSS label Oct 17, 2025
@chrisdavidmills
Copy link
Contributor Author

Are we sure the default values are inversed between Chrome and Edge?

Your changes state:

* Chrome 141 = `system`, but Edge 141/142 = `exclude`

* Chrome 142+ = `exclude`, but Edge 143+ = `system`

@caugner it sounds weird, but this is what I found during testing.

I agree with merging the partials; I've implemented the updates locally and then pushed.

@github-actions github-actions bot removed the data:css Compat data for CSS features. https://developer.mozilla.org/docs/Web/CSS label Oct 17, 2025
@caugner caugner merged commit 125ce8e into mdn:main Oct 17, 2025
6 checks passed
@mdn-bot mdn-bot mentioned this pull request Oct 17, 2025
@drkron
Copy link

drkron commented Oct 20, 2025

Could you share some details on how this was tested?

My understanding is that the default value in Chrome should be system, and my own testing on macOS confirms this behavior. If it's defaulting to something else, that seems like it could be a bug.

@mdn mdn deleted a comment from bentalakai21-ux Oct 20, 2025
@chrisdavidmills
Copy link
Contributor Author

Could you share some details on how this was tested?

My understanding is that the default value in Chrome should be system, and my own testing on macOS confirms this behavior. If it's defaulting to something else, that seems like it could be a bug.

I tested it using a modified version of the basic demo at https://mdn.github.io/dom-examples/screen-capture-api/basic-screen-capture/. I modified it to add the different windowAudio options in turn to see what the effect was, then removed it altogether to see what the default behavior was.

@chrisdavidmills chrisdavidmills deleted the getDisplayMedia-windowAudio-option branch October 20, 2025 10:18
@drkron
Copy link

drkron commented Oct 20, 2025

Can you test on this sample page to if see you get the same behavior?
https://drkron.github.io/system-audio-demo/

If you click the getDisplayMedia button without changing anything, getDisplayMedia() is called without windowAudio being set.

@chrisdavidmills
Copy link
Contributor Author

Can you test on this sample page to if see you get the same behavior? https://drkron.github.io/system-audio-demo/

If you click the getDisplayMedia button without changing anything, getDisplayMedia() is called without windowAudio being set.

Ah, looks like my testing went wrong somehow. Testing using your demo:

  • Chrome shows system as the default all the way through.
  • Edge shows system as the default from Edge 142 onwards, and exclude before that.

I'll raise another PR to correct this. Thanks for your help.

@drkron
Copy link

drkron commented Oct 20, 2025

Ah, looks like my testing went wrong somehow. Testing using your demo:

  • Chrome shows system as the default all the way through.
  • Edge shows system as the default from Edge 142 onwards, and exclude before that.

I'll raise another PR to correct this. Thanks for your help.

Thanks for testing again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

data:api Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API size:m [PR only] 25-100 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants