-
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
Ignore PTZ request if no PTZ camera #246
Comments
This risk of a prompt should be enough to deter trackers from calling It's unclear to me though whether we need to do the same for |
What exactly should be ignored? If a web site calls What if a web site calls What if a web site calls |
From my reading of the spec, the request will be
The request should probably be
If there is no PTZ camera, there will be no permission request as the algorithm will bail out early. |
Yes, exactly. But what should happen then? Should the
Yes, exactly. But what should happen then? Should be Or should the fitness distance be positive infinity because there is no actual pan setting? This would cause all non-PTZ cameras to be ignored and an OverconstrainedError to be thrown.
Yes, probably. So the I am asking there questions because it does not make sense to ignore PTZ permission request without specifying what do with PTZ constraints (or non-constraints) in whose cases. |
Since there is no PTZ camera in that case, all devices will react to pan : { ideal : 0 } the same way and it will be as if it is ignored. The problem you seem to point out is when there is a mix of cameras with and without PTZ. We could try fiddling with distances to maximise the ability to select a PTZ. |
I've opened #256 for that, so we can focus on how to "ignore" constraints to solve |
I fear we may have hit the limits of normative prose in field descriptions, and may need to modify algorithms. So for clarity, here's what I think we need:
This order should clarify that:
|
I think we want to go further and make it so that PTZ constraints can never trigger an OverconstrainedError, whatever the underlying setup. It seems the issue is that getUserMedia algorithm is asking permission for a set of devices. We could change getUserMedia algorithm so that it asks permission for one specific device of a given kind. With this algorithm, the downside would be if opening device fails after user granted access. |
@youennf Sorry how does the permission level granted relate to
That's the case in Firefox by default where one-time permissions are per device. For If the user picks a different one then obviously the site won't be able to move it. I gather the latter mirrors other browsers more, where even per-session permissions are for all cams or all mics. |
Given there is no required constraints anymore, the problem is simplified a bit. I still believe we should try to mandate that, should the PTZ permission is granted, the User-Agent tries hard to pick a PTZ device, but this is an orthogonal issue. |
#261 states that [t]he [getUserMedia()] algorithm MUST request permission to use a PermissionDescriptor with its name member set to PermissionName/camera and its panTiltZoom member set to true, and, optionally, consider its deviceId member set to any appropriate device's deviceId unless there are no pan capable cameras (and similarly for tilt and zoom). |
@youennf It does. Though just to clarify: there are no required basic imageCapture constraints anymore in
This should fall out naturally once we fix #256 to have the spec match current design intent (right now I personally don't think we need to go further than that. |
I disagree. If user denied PTZ permission, PTZ constraints should have zero effect. As mediacapture-main is not constraining in any way how selection should happen, mediacapture-image can easily prescribes some selection rules without changing anything with the fitness distance. |
Thanks for all the discussions here. We have put up #280 to update the spec. |
That did not land and was replaced by w3c/mediacapture-main#707 which is now merged. Regarding the title of this issue (Ignore PTZ request if no PTZ camera), I think it is in essence resolved by w3c/mediacapture-main#707, w3c/mediacapture-main#766 and #271. According to the current main spec (after w3c/mediacapture-main#707), all required image capture constraints (including the PTZ constraints) are always outright rejected with a TypeError (regardless of whether or not there are any PTZ cameras) and if there are no PTZ cameras,
So while the PTZ constraints are not fully ignored if there are no PTZ cameras, the PTZ constraints either increase the fitness distance by the same amount for all non-PTZ cameras, cause some advanced constraint sets to be ignored for all non-PTZ cameras or have no effect all non-PTZ cameras. Thus the PTZ constraints have basically no effect if there are no PTZ cameras. Therefore, the constraint part is resolved. According to the current spec (after #271), there are no requirements for a user-agent ever to request a PTZ permission as long as the user-agent does not does not expose pan, tilt nor zoom settings. If there are no PTZ cameras, the user-agent even cannot expose pan, tilt or zoom settings (because there is nothing to expose), so that is a perfect case for a user-agent not to request a PTZ permission. Therefore, the permission part is resolved, too. So, in my opinion, the issue at hand is resolved and should be closed.
@youennf: Since your comment, the spec has be changed (by #271). The intention (there is a bug, see #279 and #280) is that if a user denied the PTZ permission, the user-agent MUST decide not to expose pan, tilt and zoom settings, in which case none of the settings dictionaries contains pan, tilt or zoom settings (regardless of whether the actual camera hardware supports PTZ) thus all algorithms behave like all cameras were non-PTZ cameras thus PTZ constraints have basically no effect like in the case of no-PTZ cameras above. So, in my option, this issue is also resolved. If you disagree, let's create another issue for this case.
Please note that while that is not currently stated in the spec, the user-agent is perfectly allowed to do the reverse and request the PTZ permission only if a PTZ device is about to be selected. On the other hand, if a page does navigator.mediaDevices.getUserMedia({video: {deviceId, pan: true}}) to check if the device is pan-capable, another user-agent may want to request a PTZ permission even if the device is pan-incapable, and that is allowed, too. However, if you want to discuss more on this case, lets create another issue for this. |
Sounds good to me.
That is fine too. While we might not want to go too deep in device selection territory here, which is ultimately UA specific, it would be good to add some guidelines to implementors, something like:
Right, but it does not really make sense to do so. |
As raised in #243 (comment) by @youennf, the spec should explicitly say that the PTZ request will be ignored and it will be treated like a regular camera request if there are no cameras with PTZ capabilities on the user machine during getUserMedia.
The text was updated successfully, but these errors were encountered: