本地主机中不允许使用 getUserMedia() - Safari 11 [英] getUserMedia() is not allowed in localhost - Safari 11
问题描述
试图从不安全的文档调用 getUserMedia.
我正在测试 safari 11 技术预览版.尝试在本地主机中运行
选择允许不安全站点上的媒体捕获
<小时>原答案:
是的,使用 Safari 时,您需要使用 HTTPS 运行它,甚至使用本地主机.
即使使用使用 HTTPS 的 ngrok 隧道,您是否也看到此错误?
Trying to call getUserMedia from an insecure document.
I'm testing safari 11 tech preview. Got this error while trying to run basic peer in localhost. Does anyone experience the same or is localhost treated as insecure region in safari 11?
Any flag or settings to allow this in safari? Currently i'm using ngrok to tunnel it via https and accessing in the same machine.
Update:
You can now enable this from the Develop menu:
Select Allow Media Capture on Insecure Sites
Original Answer:
Yes, you will need to run it with HTTPS, even with localhost, when using Safari.
Do you see get this error even with an ngrok tunnel using HTTPS?
这篇关于本地主机中不允许使用 getUserMedia() - Safari 11的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!