0

I can not play audio on autoplay in the new version chrome br! Help me guys

const myAudio = new Audio('transient.mp3');
    myAudio.loop = true;
    myAudio.addEventListener('ended', function () {
        this.currentTime = 0;
        this.play();
    }, false);
    myAudio.play();
  • try Solution #2: https://stackoverflow.com/questions/50490304/how-to-make-audio-autoplay-on-chrome?noredirect=1&lq=1 – channasmcs Aug 26 '19 at 06:21

1 Answers1

0

Because the user will need to have interacted with the domain before music can play. See https://developers.google.com/web/updates/2017/09/autoplay-policy-changes

Spangle
  • 762
  • 1
  • 5
  • 14