Reputation: 1553
I am using Google's WebSpeech API found on this site: https://developers.google.com/web/updates/2013/01/Voice-Driven-Web-Apps-Introduction-to-the-Web-Speech-API
With Python's http.server on my Windows machine,
I upload exactly same files, same API but it does not work in my CentOS remote server throwing a 'not-allowed' error for the microphone permission:
I thought that problem could be http server related. So I tried with Apache Httpd, Python http.server and Nginx. None of them worked.
Any idea about what's blocking the microphone? Thanks!
Upvotes: 6
Views: 7312
Reputation: 31
I experienced not-allowed
also - trying to access mic from Chrome inside cross-origin iframe. Resolved by adding allow="microphone;"
to the iframe:
<iframe src="mysrc" allow="microphone;"></iframe>
Note: Also required using HTTPS for parent page & iframe page
Upvotes: 3
Reputation:
I've encountered the same issue (throws not-allowed
), but I was using HTTPS.
In my case, it turned out that you can't obtain speech or enable microphone access from an iframe
. The same code works normally when not shown in an iframe.
Upvotes: 1
Reputation: 1492
I couldn't find documentation backing this up, but from my own experience I can confirm that only after installing an SSL certificate on a website, chrome stopped blocking it from requesting microphone access.
Upvotes: 4