I have html5 audio like this in my page
<audio id="audioplayer" playsinline controls muted loop autoplay hidden>
<source src="audio/muzyka_meed_loop.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
Here I am adding a random number to audio src to prevent cache
<script>
$(document).ready(function(){
document.querySelector('#audioplayer source').setAttribute('src', 'audio/muzyka_meed_loop.mp3?rand=' + Math.random());
})
</script>
But now when I refresh the page the audio is not playing while there is autoplay on audio tag
Here is live page : live demo
What am I doing wrong?