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

Provide a little more transparency into the inner workings of getUserMedia #764

Closed
q-alex-zhao opened this issue Jan 13, 2021 · 3 comments
Closed

Comments

@q-alex-zhao
Copy link

As an application developer I'd like to give the user a bit more help in guiding them through the video calling experience. Particularly when calling getUserMedia and the resulting promise does not resolve immediately:

  • Does it mean that the user agent is showing the permissions prompt? In that case the application may want to tell the user to find that prompt and deal with that first, which is not always obvious to the user.
  • Does it mean that the device (e.g. camera) is simply slow to open? In that case the application may tell the user be patient.
  • Does it mean the system is under too much load or is too slow to respond? The application should probably do nothing here.
  • Or it could be a bug where the promise never settles. The application could use a reasonably large timeout to catch this, so this is already covered.

Thanks.

@youennf
Copy link
Contributor

youennf commented Jan 13, 2021

  • Does it mean that the user agent is showing the permissions prompt? In that case the application may want to tell the user to find that prompt and deal with that first, which is not always obvious to the user.

I think there is value in exposing whether there will be a prompt or not.
The Permissions API may help since it has Deny/Grant/Prompt values.
For Safari, we are not sure about the 'Deny' case though but Grant/Prompt should be sufficient for you.

  • Does it mean that the device (e.g. camera) is simply slow to open? In that case the application may tell the user be patient.

This is not really covered though opening the device is implementation dependent and can have several meanings.
I am not sure what we could do. I am not sure there is a justification for a new API surfacing getUserMedia decision taken from device opening. In some other issue, we are considering delaying actual opening of the device just before getUserMedia promise resolution callback to limit device recalibration.

There is also the case where getUserMedia processing is delayed until the page has focus.
In general, it seems best for an application to request getUserMedia access based on a user gesture.

@q-alex-zhao
Copy link
Author

Ah this makes sense. Thanks.

@q-alex-zhao
Copy link
Author

Except Firefox doesn't seem to support the camera or microphone PermissionName enum, yet. And Safari doesn't support the permissions API.

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

No branches or pull requests

2 participants