-
Notifications
You must be signed in to change notification settings - Fork 40
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
Stop referring to advanced
constraints
#252
Comments
advanced
constraintsadvanced
constraints
How would we differentiate an optional PTZ request without advanced constraints? (Sorry I'm on mobile and ooo this week) |
@beaufortfrancois show me where in the spec |
@beaufortfrancois note constraints are non-required by default, so this should suffice: {video: {pan: true, tilt: true, zoom: true}} |
Here's a good example of why const videoStream = await navigator.mediaDevices.getUserMedia({
video: {
advanced: [{
// [NEW] Website asks to control camera PTZ as well.
pan: true, tilt: true, zoom: true,
}],
},
}); The above will, if the constraints algorithm is implemented correctly, only discover cameras that have all three capabilities. To get cameras with one or more of the video: {
advanced: [
{pan: true},
{tilt: true},
{zoom: true}
],
} ...or simply: video: {pan: true, tilt: true, zoom: true} |
MDN has a good constraints explainer. |
Based on the above it sounds like we want to define something like this to support mandatory PTZ constraints: const videoStream = await navigator.mediaDevices.getUserMedia({
video: {pan: {exact: true}, tilt: {exact: true}, zoom: {exact: true}}
}); I think this makes sense if we make these properties |
That would seem to run counter to #246. |
Agreed, though that seems to make the use of Focusing on the intention of this design, the reason for the |
Yes but Using required constraints that way is not a pattern we want to promote (or with #246 even make possible). |
IIUC, the presence of a pan, tilt or zoom constraint without an explicit min/man/exact should be an optional request of capability/permission whether it is an basic or advanced set; and with an explicit min/man/exact it should be a mandatory request for capability/permission whether it is an basic or advanced set. Note that in advanced set, the lack of PTZ capability just means that the advanced set will be ignored, not that the PTZ request will fail. This means permission shouldn't be asked when in an advanced set and no capability. If that looks good to you, we'll update spec and explainer. |
Not for Only then would what I wrote earlier actually be true (my bad):
|
I think if we go down the path of #256 (comment), we would not need advanced constraints |
@riju I believe we can close this issue as we chose to only allowing ideal PTZ constraints in the basic set, and discarding mandatory PTZ constraints in advanced sets. |
This spec refers to the overly complex and outdated advanced constraints syntax in:
The former is unnecessary, and the latter is a non-standard.
The differences between the older
advanced
constraints and the modernideal
constraints are minimal and best forgotten. TL;DR: they allowed for non-linear fallbacks betweenwidth
xheight
xframeRate
combos whenresizeMode
isnone
. They're largely redundant elsewhere, since most other constrainable capabilities are orthogonal to each other.It's therefore best to not mention them, to discourage use. Maybe one day we'll be able to remove them from the platform.
The text was updated successfully, but these errors were encountered: