1

I'm getting an error called Uncaught (in promise) DOMException: play() failed because the user didn't interact with the document first. Does anyone know how to fix this?

const audioCls = new Audio("/assets/audio/a4.mp3");
setInterval(() => {
  audioCls.play();
}, 1000);

1 Answers1

0

Clicking the document fixed the issue :)