Skip to content

Conversation

hamishwillee
Copy link
Contributor

@hamishwillee hamishwillee commented Sep 16, 2025

FF144 added a new constraint parameter resizeMode for use with MediaDevices.getUserMedia().

We haven't documented the constraints before so this attempts to do so as there are other compat differences.
The results are based on the test https://wpt.live/mediacapture-streams/MediaDevices-getSupportedConstraints.https.html, and more specifically, by bisecting based on the wpt results using product tests like:

The tests and results do not run on the earliest version that constraints should be supported for, so I have used to indicate the earliest version I could test in each case.

Note that there are some constraints I have not documented:

  • backgroundBlur is in spec but not in tests. Assuming it is not implemented though it might be.
  • volume is not in spec, but shows up in some very old builds. Ignoring.
  • voiceIsolation is supported by Chrome but is not in spec. Ignoring.

Note that there a related test https://wpt.live/mediacapture-streams/MediaDevices-getUserMedia.https.html but everything passes in this for things that support the associated constraint, so this does not lead to any compatibility difference to record.

Related docs work can be tracked in mdn/content#41132

@github-actions github-actions bot added data:api Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API size:l [PR only] 101-1000 LoC changed labels Sep 16, 2025
Copy link
Contributor

github-actions bot commented Sep 16, 2025

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

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.

I'm wondering:

  1. Would it be better to document this under getSupportedConstraints()?
  2. Should we link to the individual MediaTrackConstraints pages (e.g. autoGainControl)?
  3. Could we make it clearer that the constraints go inside the audio/video options?

For (3), I could imagine this structure instead:

api.MediaDevices.constraints_parameter.aspectRatio_constraint

@hamishwillee
Copy link
Contributor Author

@caugner Thanks for the review

  1. Would it be better to document this under MediaDevices.getSupportedConstraints()?

@caugner Yes, as that what we're actually testing. I have moved the features.

  1. Should we link to the individual MediaTrackConstraints pages (e.g. autoGainControl)?

Yes. I thought the infrastructure did that automatically - but this is done now.

  1. Could we make it clearer that the constraints go inside the audio/video options?
    I could imagine this structure instead:
api.MediaDevices.constraints_parameter.aspectRatio_constraint ``

This I am not so sure about. Firstly, after moving these to getSupportedConstraints it is a return value. Secondly, isn't it usual to document the features in a flat structure.

Upshot, if you tell me to do this I will as you know the rules better than me.

Thoughts?

}
}
},
"constraints_resizeMode_parameter": {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@caugner I originally did this under MediaDevices.getUserMedia() because the documentation work I'm looking at is for resizeMode on that method.

So I'd quite like to record at least this particular constraint on this method. I've done that here but its a TBD because I am assuming that the other browsers match the data in the getUserConstraints method.
Or do you think I should make that assumption and duplicate everything here, or do something else.

Note, also pending your response on whether you want this all under a sub feature for the constraint parameter.

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:l [PR only] 101-1000 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants