-1

I have this code to autoplay an audio but everytime I refresh the website it stop playing. I'm using PHP ,Xampp based website sorry I'm new at this.

<audio controls autoplay><source src="kuizzeraudiobg.mp3" type="audio/mp3" loop="true" autostart="true"></audio>
Chris Haas
  • 53,986
  • 12
  • 141
  • 274
Syndi521
  • 11
  • 1
  • 1
    According to [this thread](https://stackoverflow.com/q/50490304/231316), auto play might be disabled by default in most browsers, something I personally agree with. – Chris Haas Aug 01 '21 at 13:42
  • how do I enable auto play or is it not possible? – Syndi521 Aug 01 '21 at 13:48
  • is there an alternate way to enable autoplay? – Syndi521 Aug 01 '21 at 13:59
  • 1
    I would read the [Chrome blog post](https://developer.chrome.com/blog/autoplay/) on this. FF and Safari probably have similar policies. This is a moving target, probably, so don’t be surprised if it changes in the near future, too. – Chris Haas Aug 01 '21 at 14:34
  • 3
    Also, your question doesn’t have anything to do with PHP or a database, please don’t tag it as such. The tags should focus solely on the question, not ancillary things that the rest of your application might do. – Chris Haas Aug 01 '21 at 14:36

1 Answers1

0

Autoplay is blocked by default on modern web browsers. here is the official MDN web doc guide for autoplay restrictions in browsers