always accept webRTC webcam request

25,670

Solution 1

There is a Chrome option for that: (This works in both http and https)

--use-fake-ui-for-media-stream

- Windows :

start chrome --use-fake-ui-for-media-stream

- GNU/Linux :

google-chrome --use-fake-ui-for-media-stream

Maybe this is just a matter of time, but it didn't work on my chromium on Ubuntu. I had to get the .deb from the google chrome website.

- Mac :

Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --use-fake-ui-for-media-stream

This could be useful in a development/testing environment.

Solution 2

Firefox : (You have to tell users like..)

  • Go in url about:config

  • Search media.navigator.permission.disabled

  • dbClick or set value to true

Tested version : 23.0 + (and 43.0.4 still working)


Chrome : https://stackoverflow.com/a/16929608/622813 or use HTTPS

Solution 3

Based on what the Chromium developers are saying, there is currently no option to configure your browser to allow camera usage, unless you utilize the "Always allow" dialog - which will only be shown if the site is served using HTTPS. That means, if you serve the HTML page using HTTPS, and once confirm the "Always allow" option, it should work from there on. Here is a collection of links where you'll find answers to the same or similar questions:

  1. Chromium issue 143372: allow "always allow" for http://localhost
  2. WebRTC: allow Chrome to access microphone via Chrome Extension
  3. http://www.chromium.org/developers/web-platform-status (see section on WebRTC): "For the permission dialog: Chrome only show the "Always allow" for sites using https for increased security."
  4. Discuss WebRTC Google Group: Automatically allow Camera Access Request in webrtc enabled Chrome
Share:
25,670

Related videos on Youtube

broen
Author by

broen

Automotive User Interface Researcher from Munich.

Updated on January 18, 2020

Comments

  • broen
    broen over 4 years

    I'm building a web application that uses the computer's webcam via webRTC. The site is only running on one specific machine which will shut down and reboot once a day.

    My problem is: how do I get the machine to automatically confirm the webcam dialogue once the site has loaded?

    The system is OSX Leopard with the latest Chrome. Thanks already, I'm open for anything.

  • Andrew Plummer
    Andrew Plummer almost 11 years
    After half an hour of troubleshooting, it was a lot easier for me to just switch to firefox for this project and use the above. I couldn't ever convince chrome to allow localhost
  • Peter Ehrlich
    Peter Ehrlich almost 10 years
    Mac: /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --use-fake-ui-for-media-stream
  • nha
    nha almost 10 years
    Thanks for the complement @PeterEhrlich. Should you want to, you can edit my answer also :)
  • prespic
    prespic almost 10 years
    You can put this command in a shortcut of chrome. For example for my development is use the desktop shortcut like this: "%localappdata%\Google\Chrome\Application\chrome.exe " --user-data-dir=$(mktemp -d) --kiosk "http://localhost:52902/Default.aspx" --use-fake-ui-for-media-stream
  • A-Diddy
    A-Diddy almost 9 years
    I was looking everywhere for this FireFox option... the Mozilla help page didn't appear to include instructions for http://localhost. Thanks!!
  • user1253414
    user1253414 over 7 years
    Is it working? I have the same problem and it is not working for me. Error: getUserMedia() no longer works on insecure origins.
  • nha
    nha over 7 years
    @user1253414 "Starting with Chrome 47, getUserMedia() requests are only allowed from secure origins: HTTPS or localhost. " developers.google.com/web/updates/2015/10/… There may be a workaround that I am not aware of.