在46.0中工作时,getUserMedia在chrome版本48.0.2560.0中不工作 [英] getUserMedia is not working in chrome version 48.0.2560.0 while working in 46.0

查看:98
本文介绍了在46.0中工作时,getUserMedia在chrome版本48.0.2560.0中不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的困惑是我在页面中使用了gerUSerMedia(),而该页面无法在我们的服务器上运行,而在某些机器中,Chrome浏览器中的chrome版本为48.0.2560.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()不再适用于不安全的来源.要使用此功能,您应该考虑将应用程序切换到安全来源,例如HTTPS.有关更多详细信息,请参见 https://goo.gl/rStTGz .

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.

在chrome 46.0中,可以使用相同的代码和相同的请求(也就是来自我们服务器的服务器)正常工作.

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.

推荐答案

提供给

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

如果您正在使用某些本地文件系统内容,则仍然需要在localhost上运行Web服务器,而不是直接在file://上进行访问.使用python运行网络服务器的一种简单方法是运行:

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

在目录内,则您的内容将在http://localhost:8080上可用,并且getUserMedia()将起作用.

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

这篇关于在46.0中工作时,getUserMedia在chrome版本48.0.2560.0中不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆