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

烈酒焚心 提交于 2019-12-05 09:45:31
ferrouswheel

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!