How to handle “Uncaught (in promise) DOMException: play() failed because the user didn't interact with the document first.” with Chrome 85? I'm trying to use autoplay (with a jquery plugin).
HTML code:
<audio loop id="scrollaudio" src="sound/stranger.mp3"></audio>
JavaScript code:
<script> $(function() { var first = new AudioFade('#scrollaudio', 100, 3300, 700).init();
document.querySelector('button').addEventListener('click', function() { { var context = new AudioContext(); // Setup all nodes ... });
How can i fix this in a way that the user interact with the page first? Thanks to all.