GetUserMedia does not work in chrome version 48.0.2560.0 while working in 46.0

My confusion is that I used gerUSerMedia () on my page, which does not work from our server, and some of them had chrome with version 48.0.2560.0 in this Chrome browser, it will give the following warning:

getUserMedia () no longer works with unsafe origins. To use this feature, you should switch the application to a secure origin, such as HTTPS. See https://goo.gl/rStTGz for more details .

while with chrome 46.0 it works fine with the same code and the same request as the server from our server.

How will we continue? therefore, the same thing will work perfectly in all browsers and in all versions.

+4
source share
1 answer

The link provided in the Security Offer allows you to use this function on the local host, or you can transfer these flags to Chrome, replacing example.comwith 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 the contents of the local file system that you are working with, you still have to run the web server on the local host, rather than directly contacting file://. An easy way to start a web server using python:

python -m SimpleHTTPServer 8080

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

0
source

Source: https://habr.com/ru/post/1616154/


All Articles