-
Notifications
You must be signed in to change notification settings - Fork 42
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
Don't require user gesture when capturing user media #109
Conversation
w3c/picture-in-picture#109 Change-Id: Ib8fab10b713d9ed7df1147045a75abfc974e866b
My concerns with this is that it is very specific to some use cases and wouldn't allow a whole class of use cases to work. Also, I do not know about iOS but on Android, I do not think this could be implemented because the Android API expect Picture-in-Picture to happen synchronously when the activity gets hidden and the blur event would happen to late. |
It is specific you're right. However I'd like user to be able to jump on a video call by simply going to a website that would provide the best of PiP: autoPiP. Ephemeral and seamless are key there and I think Do you have something in mind that would allow this for a whole class of use cases?
Sorry. I'm not sure I understand this argument. What prevents us to call Android code |
@jernoble I'd love to hear your thoughts on this Auto Picture-in-Picture behavior we're trying to accomplish. |
I’m inclined to say that pip should always require a user gesture, and that loosening this requirement will lead to a slippery slope of sites with similar use cases demanding the restriction be lifted for them as well. That said, iOS Safari does have an “auto-pip” behavior when an app is dismissed and video is being presented in full screen. This proposed behavior is pretty similar in effect. Hypothetically speaking, if we did agree to enable this use case, I can see it working one of three ways:
Option 1) seems ripe for abuse and even purely accidental bad behavior. |
Note that auto-pip is probably needed on blur, not just on hidden, since IIRC alt-tab doesn't cause a hidden event. |
On the contrary, I’d argue auto-PiP is not needed on blur, for precisely the reason that the document isn’t hidden. |
Well, neither are perfect; AFAICT, hidden does not fire when the browser is completely obscured by another window (and, in my testing, doesn't seem to fire on minimize either, but maybe that is a bug). Blur at least fails safely in edge cases (showing the PIP and the document), whereas hidden fails more definitively, as nothing is displayed. |
Those both seem like bugs; Safari at least should fire a visibilityState change event when the window is fully obscured. Other UA may have made a policy decision not to fire change events when obscured, or the platforms on which they run do not elevate that information to apps. IIRC, the spec allows but does not mandate this behavior. But to look at another angle, do we really want to allow pages to pop up a PiP window every time the user clicks away from the browser window? That seems like particularly annoying and potentially abusive behavior. That said, maybe some UA does want to do so; in that case, option 3 (declarative opt-in) would allow that kind of experimentation without mandating any specific behavior. |
If visibilityState worked like you describe, I think that would be the best solution, since it really avoids all the problems I am concerned about without introducing the problems of blur. |
IOW, for this spec, sounds like we should proceed in the visibilityState direction. |
What are the next steps here? @beaufortfrancois, do you want to take a shot at a new PR regarding declarative behavior? @jernoble, did you have something specific in mind? |
@juberti I'm working on a new PR for a declarative behaviour. It will hopefully be ready for review really soon. |
@juberti @jernoble @mounirlamouri What do you think of this "Auto Picture-in-Picture" proposal at #111? |
Video meetings web apps would benefit from automatic Picture-in-Picture behavior when user switches back and forth between web app and other applications/tabs. This is currently not possible with the user gesture requirement in https://wicg.github.io/picture-in-picture/#request-pip (step 6).
I'm proposing to not enforce the user gesture requirement if document is capturing user media with
getUserMedia()
when requesting Picture-in-Picture.What do you think @mounirlamouri?
Preview | Diff