Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

getUserMedia is not working in chrome version 48.0.2560.0 while working in 46.0

my confusion is that i had used the gerUSerMedia() in my page which is not working from our our server while in some of the machine had chrome with version of 48.0.2560.0 in those chrome browser it will give following warning :

getUserMedia() no longer works on insecure origins. To use this feature, you should consider switching your application to a secure origin, such as HTTPS. See https://goo.gl/rStTGz for more details.

while in with chrome 46.0 its working fine with the same code and with same request which is server from our server.

how do we proceed ? so the same thing will working fine in all browser and in all versions.

like image 445
Sagar Gauswami Avatar asked Oct 31 '22 15:10

Sagar Gauswami


1 Answers

The link provided to the Security Proposal suggests that you can still use this feature on localhost, or you can pass these flags to Chrome, replacing example.com with the site you need to access:

--unsafely-treat-insecure-origin-as-secure="http://example.com" --user-data-dir=/test/only/profile/dir

If you have some local filesystem content you are working with, then you'll still need to run a webserver on localhost rather than access directly on file://. A simple way to run a webserver with python is to run:

python -m SimpleHTTPServer 8080

inside the directory, then your content will be available on http://localhost:8080 and getUserMedia() will work.

like image 74
ferrouswheel Avatar answered Nov 12 '22 13:11

ferrouswheel