سلام . من کد رو مینویسم اما خطا میدهد.
خطای مرورگر: .Uncaught (in promise) DOMException: play() failed because the user didn't interact with the document first
const audio = document.querySelector('audio');
audio.play();
setTimeout(() => {
audio.pause()
}, 2000);
<div class="player">
<div class="imgBx">
<img src="https://m.media-amazon.com/images/I/61jNfu1D+HL._UF894,1000_QL80_.jpg" alt="Luka Chuppi">
</div>
<audio src="http://dl.yekmusic.com/Song/Adele%20%7C%20Hello%20(320).mp3?_=3"></audio>
</div>