-
Notifications
You must be signed in to change notification settings - Fork 22.9k
Get user media constraints resizemode #41153
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
Get user media constraints resizemode #41153
Conversation
Preview URLs
Flaws (2)Note! 2 documents with no flaws that don't need to be listed. 🎉 URL:
External URLs (2)URL:
URL:
(comment last updated: 2025-09-19 01:08:22) |
Co-authored-by: wbamberg <[email protected]>
Co-authored-by: wbamberg <[email protected]>
- `none` | ||
- : The user agent uses the resolution provided by the underlying hardware, such as a camera or its driver, or the OS. | ||
|
||
If `resizeMode` is unspecified the browser will choose a resolution based on a [fitness distance](https://w3c.github.io/mediacapture-main/#dfn-fitness-distance) that considers the specified constraints and _both_ of the allowed values. |
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.
@wbamberg I added this line since last review to make it clear that there is no explicit default - just a calculation that works out what would be best based on the constraints with none
and the constraints with crop-and-scale
set.
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.
👍 thank you Hamish!
FF144 added a new constraint parameter
resizeMode
for use withMediaDevices.getUserMedia()
andgetDisplayMedia()
.This allows a developer to specify whether the video from the camera should be cropped and/or downscaled to match other constraints, which may be natively supported by the camera - essentially gives them what they ask for rather than what the camera is capable of delivering. It also allows them to specify that it doesn't want scaling.
This updates the relevant docs (First two commits are layout only).
The main changes are to:
MediaTrackConstraints
which is where the constraint is documented to make it clear that it is also used in these methods (not just some others).Related docs work can be tracked in #41132