我如何在文档准备就绪MVC5应用程序上播放音频
This Code not working its generate an error when i play audio on button click its working but its gives error on document ready event
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能无法做到。 Web浏览器明确阻止了此行为,因为用户不会期望它并发现它很烦人。
请参阅Google的 Chrome博客文章,Mozilla的 firefox文档和苹果的<a href =“ https://webkit.org/blog/77734/auto-play-play-play-play-play-play-play-play-play-play-play-play-play-play-play--策略 - 更改-macos/“ rel =“ nofollow noreferrer”> webkit/safari博客文章关于这些规则。
如果您将在对Web浏览器控制的公司环境中部署应用程序,则可以在计算机上配置浏览器以允许您的网站自动播放。有关详细信息,请参见上面的链接。
You probably can't do it. Web browsers explicitly block this behavior because users don't expect it and find it annoying.
See Google's Chrome blog post, Mozilla's Firefox documentation, and Apple's WebKit/Safari blog post about these rules.
If you will be deploying your app in a corporate environment where you have control over the web browsers, you can probably configure the browsers on the computers to allow autoplay for your site. See the links above for details.