如何在没有HTTPS的情况下在Chrome中访问摄像头和麦克风? [英] How to access Camera and Microphone in Chrome without HTTPS?

查看:217
本文介绍了如何在没有HTTPS的情况下在Chrome中访问摄像头和麦克风?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当网站为http时,是否可以使用任何方式使用chrome访问麦克风和相机?

Is there any way to access the Microphone and Camera using chrome when the website is http?

我尝试启用将不安全来源视为安全" 标志,但是当浏览器关闭并再次打开时,该标志中使用的域消失了,我必须重新输入并重新启用它

I tried enabling "Insecure origins treated as secure" flag, however when the browser is closed and opened again, the domain used in this flag disappears and I have to retype and re-enable it again.

我还尝试了以-不安全地处理-insecure-origin-as-secure = http://example.com "参数,但是当使用此参数时,Chrome上会显示一条消息,提示

I also tried starting chrome with "--unsafely-treat-insecure-origin-as-secure=http://example.com" argument, however when this was used a message appears on Chrome saying

您使用的命令行不受支持标志:-unsafely-treat-insecure-origin-as-secure = http://example.com .稳定性和安全性将受到损害

You are using an unsupported command line flag:--unsafely-treat-insecure-origin-as-secure=http://example.com. Stability and Security will suffer

我不希望消息出现,所以我也不能使用这种技术.

I don't want the message to appear, so I couldn't use this technique as well.

在没有收到任何警告的情况下,还有其他方法可以访问麦克风和相机吗?(我正在使用WebRTC访问该设备.)

Is there any other way to access the Microphone and Camera without getting any warnings? (I am accessing the device using WebRTC).

推荐答案

这对我有用.尽管仅用于测试目的.

This worked for me. Although it's for Testing purpose only.

要忽略Chrome的安全来源政策,请按照以下步骤操作.在Chrome中导航到 chrome://flags/#unsafely-treat-insecure-origin-as-secure .

To ignore Chrome’s secure origin policy, follow these steps. Navigate to chrome://flags/#unsafely-treat-insecure-origin-as-secure in Chrome.

找到并启用不安全来源视为安全部分(请参见下文).添加您要忽略其安全来源策略的所有地址.记住也要包括端口号(如果需要).保存并重新启动Chrome.

Find and enable the Insecure origins treated as secure section (see below). Add any addresses you want to ignore the secure origin policy for. Remember to include the port number too (if required). Save and restart Chrome.

请记住,这仅是出于开发目的.实时工作的应用程序将需要托管在https上,以便用户能够使用其麦克风或摄像头.

Remember this is for dev purposes only. The live working app will need to be hosted on https for users to be able to use their microphone or camera.

不安全地处理不安全的原产地安全"标志在Chrome上不起作用

这篇关于如何在没有HTTPS的情况下在Chrome中访问摄像头和麦克风?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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