webcam "You have denied camera access" chrome + php

1

I have problems accessing a webcam on the site using php where I have the message "You have denied camera access", the same script in the local php served works fine, I have no problem. The hosting I am using is from HOSTINGER, and the browser is the last version chrome. I've been searching for something and for example the plugin link ande searching a little more see that you have to have ssl because the chrome browser asks for this security Has anyone ever had this problem?

    
asked by anonymous 08.12.2017 / 22:42

1 answer

2

The particular message:

  

You have denied camera access

Indicates that you previously denied access to the camera beforehand for the specific domain, are not necessarily connected to HTTPS, to confirm that your site is blocked in your browser, access the address on Chrome:

  • chrome://settings/content/camera

And then see if it's on the blocked list:

  

Ifyouclickonthetrashcantoremoveit,thenthenexttimeyoutrytousethecameraonyoursite,therequestwillprobablyappear.

AboutHTTPS

AsfarasIknow,itisimpossibletouseanon-HTTPScamerainchrome,soforexample,theMediaDevices.getUserMedia()functionwillnotwork,theydidthistopreventunencryptedconnectionsfrombeinginterceptedor"attacked" as in Wi-Fi networks. example.

As per the notice in link

  

Warning: Direct camera access is a powerful feature and therefore requires user authorization and your site must be in a secure source (HTTPS).

If you try, this warning will appear in the console:

  

[Deprecation] getUserMedia () no longer works on insecure origins. To use this feature, you should consider switching your application to a secure source, such as HTTPS.

For details on the APIs that require HTTPS, go to:

However in your browser, and only on your own, for testing you can add an allowed domain without HTTPS, just in the Chrome shortcut icon add this

--unsafely-treat-insecure-origin-as-secure="meu-site.com.br"

However as I said it is only in your browser, it will not work for other users / computers, unless the person does this manually, the only solution is to use HTTPS or a third party service to work with videos and webcam.

    
08.12.2017 / 22:55