Re: [mediacapture-main] Clarify when the application can retry getUserMedia after it returns "InvalidStateError" due to the window not being in focus (#763)

Thanks for the suggestion. Some followup questions:

Assuming the user gesture requirement change refers to w3c/mediacapture-extensions#11 and the definition of _user gesture_ refers to _transient activation_ in the [getDisplayMedia spec](https://w3c.github.io/mediacapture-screen-share/#dom-mediadevices-getdisplaymedia):

> When the getDisplayMedia() method is called, the User Agent MUST run the following steps:
>
> 1. If the relevant global object of this does not have transient activation, return a promise rejected with a DOMException object whose name attribute has the value InvalidStateError.

The specific scenario I'm thinking about is this:

1. the user is using a calendaring app for managing meeting schedules
2. the user clicks on a "join meeting" button in the calendaring app
3. this opens up a new window or tab loading the meetings app
   a. does this new window or tab satisfy the transient activation criteria? my read of the spec is that it does not, but I feel it should.
4. before the meetings app code is downloaded / executed, the user switches to a different window for something else
5. the meeting app normally would auto-open the camera to show a preview, but now it would fail because, I think, it does not satisfy the "window visible and in focus" criteria
6. the user notices that the meeting window has some content showing up, and switches back to the meeting window
   a. if the transient activation criteria was satisfied before, would this invalidate it since the _transient activation duration_ is likely to have passed?
   b. would it be reasonable for the application to want to retry `getUserMedia`, if it knows now the "window visible and in focus" criteria has been satisfied? instead of showing blanks and waiting for the user to click a button...

-- 
GitHub Notification of comment by q-alex-zhao
Please view or discuss this issue at https://github.com/w3c/mediacapture-main/issues/763#issuecomment-759868107 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 14 January 2021 01:40:48 UTC