当我尝试在用户与页面交互之前运行 Audio.play() 时,它会引发错误:
Uncaught (in promise) DOMException: play() failed because the user didn't interact with the document first
我怎样才能捕捉到异常,这样我就不会乱扔控制台日志?我想尝试以编程方式加载音频并清除错误,但默认的 JavaScript try/catch 没有成功应用。
暮色呼如
相关分类