添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

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,

it works without any problem:

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!

As a workaround to this problem, I installed a self-signed SSL certificate to the remote server allowing me to use https. This way, microphone has become allowed to use in Chrome. Kerem Sep 5, 2017 at 12:58 I could experience that with an Angular app, while using ng serve via http, an error 'not-allowed' was fired. Switching to SSL with the '--ssl' option fixed it. bfredo123 Jan 7 at 14: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

Reference: https://sites.google.com/a/chromium.org/dev/Home/chromium-security/deprecating-permissions-in-cross-origin-iframes

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.