Question

I am trying to allow a http website to use my camera without the prompt without luck.

I changed the Preference file (when Chrome is closed) and changed the Profile part as follows:

"profile": {
  "avatar_index": 0,
  "content_settings": {
     "clear_on_exit_migrated": true,
     "pattern_pairs": {
        "http://mywebsite.com:80,*": {
           "media-stream-camera": 1,
           "media-stream-mic": 1
        },
        ...

However, for some reason it keeps showing the prompt.

Any idea? I'm using Chrome version 33.

Thanks!

Was it helpful?

Solution

It seems like Chrome overwrites the preference file every time it starts. I couldn't get any of my changes to stick.

Solution 1. Packaged Chrome app.

One way to grant permissions is to run your site as a chrome app. Just include videoCapture in the manifest.json. This will definitely work.

"permissions": [
    "videoCapture"
],

Solution 2. Get an SSL Certificate.

I know you specifically said 'http', but if you have serve your site over https, it will only require the user to grant permissions once.

Solution 3. Modify device policy.

If you can't package your site as a chrome app for some reason, there might be another way to get it to work. It involves editing Chrome's policy list to allow camera access. I can't get this to work, currently, but I'm looking into it.

http://www.chromium.org/administrators/policy-list-3#VideoCaptureAllowedUrls

VideoCaptureAllowedUrls are a list of urls to automatically grant webcam permission to. The problem is setting this property. I know where the file lives, but there are no examples on HOW to set properties.

/Applications/Google\ Chrome.app/Contents/Resources/com.google.Chrome.manifest/Contents/Resources/com.google.Chrome.manifest

There are 'instructions' on editing the policy list, but they're totally useless. All it does is point to that file, and gives templates for Windows and Linux (I'm on OSX).

Note that this solution will only work in kiosk mode. To run Chrome in kiosk mode, add the flag --kiosk http://yoursite.com. This forces the app into fullscreen mode.

If you're on Windows/Linux, this SO post might help you.

OTHER TIPS

Solution 4. Use command-line flag

use --use-fake-ui-for-media-stream command-line flag

example (OS X) : /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome http://html5-demos.appspot.com/static/getusermedia/record-user-webm.html --use-fake-ui-for-media-stream

More info here http://creativcoders.wordpress.com/2014/08/18/chrome-always-allow-access-to-webcam-and-microphone-over-http-webrtc/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top