Skip to content
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

Enforcing user gesture for getUserMedia in case of PTZ request #254

Open
youennf opened this issue Aug 27, 2020 · 6 comments
Open

Enforcing user gesture for getUserMedia in case of PTZ request #254

youennf opened this issue Aug 27, 2020 · 6 comments
Labels
PTZ Pan-Tilt-Zoom

Comments

@youennf
Copy link
Contributor

youennf commented Aug 27, 2020

Following on https://github.com/w3c/mediacapture-main/issues/639, calling getUserMedia would ideally be gated by a user gesture.
This is difficult to enforce it for regular getUserMedia calls due to existing usage of getUserMedia.
But it might be possible to enforce it in case getUserMedia is requesting PTZ privilege, since this is a new feature.

@riju riju added the PTZ Pan-Tilt-Zoom label Aug 28, 2020
@beaufortfrancois
Copy link
Contributor

LGTM

@jan-ivar @alvestrand any objections?

@beaufortfrancois
Copy link
Contributor

(gentle ping)

@jan-ivar @alvestrand @guidou for thoughts

@jan-ivar
Copy link
Member

@youennf is this something you think we need to address before wide review?

@youennf
Copy link
Contributor Author

youennf commented Apr 12, 2021

Given there is consensus there, what is missing is the editorial work..
I think it would be good to do so before wide review.

I guess this could be added directly to medicapture-image, in pan, tilt and zoom sections that talk about permission requests.

@eehakkin
Copy link
Contributor

eehakkin commented May 4, 2021

So how should this gating work? Should the descriptions of pan, tilt and zoom photo capabilities and constrainable properties be amended with text like

"The user agent MUST ignore any persisted granted permissions unless the document's Window object has transient activation."

The idea here is to align with the main spec which might get similar gating if w3c/mediacapture-extensions#11 is resolved as @youennf suggested (w3c/mediacapture-extensions#11 (comment)) based on @alvestrand's and @jan-ivar 's comments.

In that is it would actually be that the persisted granted permissions (and not the getUserMedia calls per se) would be gated by a user gesture which is apparently called transient activation nowadays.

@youennf
Copy link
Contributor Author

youennf commented May 5, 2021

Given this is a new feature and that applications should opt-in, I do not think we have compat breakage by requiring transient activation.
We could probably do like for getDisplayMedia: reject the promise if getUserMedia is called with any pan/tilt/zoom constraint and document does not have transient activation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PTZ Pan-Tilt-Zoom
Projects
None yet
Development

No branches or pull requests

5 participants