当前位置: 移动技术网 > IT编程>网页制作>Html5 > Uncaught (in promise) DOMException: play() failed because the user didn't interact with the document first.

Uncaught (in promise) DOMException: play() failed because the user didn't interact with the document first.

2018年12月03日  | 移动技术网IT编程  | 我要评论

幕后玩家迅雷下载,韩国女主播不雅,安东尼罗宾讲座

最近在开发一个网站时,有个需要是 如果有新预警信息要在网页中播放提示音。页面打开会请求是否有新信息,有则播放提示音。在chrome的最新浏览器中,播放会报错,控制台显示uncaught (in promise) domexception: play() failed because the user didn't interact with the document first.搜索发现chrome 66为了避免标签产生随机噪音禁止没有交互前使用js进行播放。最后解决方案为 在chrome地址栏输入chrome://flags/。设置autoplay policy为no user gesture is required。目前想到的解决方案只有这个了,如果有大神有更好的方案欢迎评论。

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网