Good question.
EDIT: with the Chrome -use-fake-ui-for-media-stream flag, all gUM calls will be automatically accepted and the user interface will never appear.
I believe that there was some discussion of the browser flag, which would mean that permission confirmation was never required using the user interface, but as far as I know, this was not implemented in any browser. (I can imagine potential security issues.)
A few suggestions (which probably won't work for you, considering you are writing a library, not an application ...)
Can you run the test from a Chrome app? If you use the audioCapture / videoCapture permission, permission is requested only once, when installing the application, and not for each session.
Use HTTPS for the page that calls getUserMedia (). This means that permission is requested only once for this domain, the first time gUM is called.
source share