Html: Autoplay in Audio isn't work?

Hi! :wave:t2:

Is audio structure with Autoplay below effective? Because I tried several different forums but couldn’t

<audio controls autoplay>
<source src="URL" type="audio/mp3">
</audio>

Moving on to reality it would look like this:

1 Like

Hi :blob_wave:

There are two things, I think:

  • Discourse doesn’t allow the “autoplay” attribute in audio and video tags.

  • Autoplay isn’t allowed at least in Chromium-based browsers like Chrome or Edge unless muted. I don’t know the behavior in other browsers. So even if the attribute was kept, it wouldn’t work in many cases.

You can see what tags and attributes are allowed in Discourse here: discourse/app/assets/javascripts/pretty-text/addon/allow-lister.js at main · discourse/discourse · GitHub

4 Likes