问题
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.
回答1:
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?
回答2:
In last version of safari, the option to allow media capture from insecure sites is located directly in the web inspector window :
来源:https://stackoverflow.com/questions/44523609/getusermedia-is-not-allowed-in-localhost-safari-11