【发布时间】:2021-12-25 19:27:24
【问题描述】:
我收到一个名为 Uncaught (in promise) DOMException: play() failed because the user didn't interact with the document first. 的错误
有谁知道如何解决这个问题?
const audioCls = new Audio("/assets/audio/a4.mp3");
setInterval(() => {
audioCls.play();
}, 1000);
【问题讨论】:
标签: javascript audio