-
Notifications
You must be signed in to change notification settings - Fork 2.3k
MediaDevices.getUserMedia() add constraints #27891
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
MediaDevices.getUserMedia() add constraints #27891
Conversation
Tip: Review these changes grouped by change (recommended for most PRs), or grouped by feature (for large PRs). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering:
- Would it be better to document this under
getSupportedConstraints()
? - Should we link to the individual
MediaTrackConstraints
pages (e.g. autoGainControl)? - 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
@caugner Thanks for the review
@caugner Yes, as that what we're actually testing. I have moved the features.
Yes. I thought the infrastructure did that automatically - but this is done now.
This I am not so sure about. Firstly, after moving these to Upshot, if you tell me to do this I will as you know the rules better than me. Thoughts? |
} | ||
} | ||
}, | ||
"constraints_resizeMode_parameter": { |
There was a problem hiding this comment.
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.
FF144 added a new constraint parameter
resizeMode
for use withMediaDevices.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