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?
source share