2

I need my webpage to play an audio clip without the user interact with the page, I know is poor UX and shouldn't be done that way, but that's what my clients are asking for.

I also know browsers have blocked this feature, so I would appreciate if someone can give me an advice of how to 'hack' this rule (something with events for example)

  • [Set the `autoplay` boolean attribute on the `audio` element.](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/audio) – Scott Marcus May 27 '20 at 20:04
  • 1
    There is no ultimate cross-browser solution, but this thread might get you somewhere. [How to make audio autoplay on chrome](https://stackoverflow.com/questions/50490304/how-to-make-audio-autoplay-on-chrome) – Emiel Zuurbier May 27 '20 at 20:06

1 Answers1

2

Chrome and Firefox disabled autoplay features, and it's not currently possible AFAIK:

https://hacks.mozilla.org/2019/02/firefox-66-to-block-automatically-playing-audible-video-and-audio/

anthumchris
  • 8,245
  • 2
  • 28
  • 53