Google Chrome webkitGetUserMedia - what if the user ignores the dialog?

So the standard way to use navigator.webkitGetUserMedia is this:

function success() { console.log('User accepted'); } function deny() { console.log('User rejected'); } navigator.webkitGetUserMedia({video: true, audio: true}, success, deny); 

For the site I’m developing, it’s absolutely necessary to use the user's webcam and microphone (in fact, using Flash, but it seems to be going through this API now), so I try to do everything so that the user always knows what they need to click for the site to work.

  • If none of the functions is called, suppose that a dialog is displayed and gives instructions to the user.
  • If deny is called, explain that you need access to webcams, and show them that they can click the camera icon in the Chrome URL bar to change their mind.
  • Of course, if success is triggered, then the user accepted and will continue as usual.

Here is the kicker; and you could follow by pasting the above Javascript into any site you like (in Chrome). If a user navigates to a new web page or refreshes the current page without accepting, rejecting or rejecting the drop-down list, they will not see the permissions dialog for the current domain for the browser session.

Calling navigator.webkitGetUserMedia(...) again will cause the dialog box to not display permissions, and the camera icon will not even appear in the URL bar. The console does not even register "User Rejected." What's more, for many users, this drop-down menu is very easy to accidentally ignore. The only fix is ​​to close the browser completely and reopen it (or to manually navigate through the complex settings menu that we DO NOT want to force our users to do).

Can I confirm someone here, is it intended "somehow", or if something is missing?

+6
source share
1 answer

This seems to be a known bug.

Issue 252904 : Infobar pop-up window for microphone / camera resolution leads to an unexpected resolution state; causes an unrecoverable lack of permission to reboot

There are currently two patches in the comment thread for this error, so at least you know that they are working on fixing the problem. Unfortunately, there are currently no real workarounds for the error.

One thing worth mentioning: if you close the tab and then open the URL again, this seems to make the permission dialog show again. I know this is not a real solution, but at least it is better than closing the entire browser (which, I think, is what you have done so far).

+6
source

Source: https://habr.com/ru/post/949145/


All Articles