I have a countdown timer for someone’s birthday. It displays the number of days, hours etc till the birthday, and on or after the birthday it says Happy Birthday and should play a song. The countdown works fine but the song doesn’t play, giving the following console error:
Uncaught (in promise) DOMException: play() failed because the user didn’t interact with the document first.
I understand the issue - I hate sites that automatically play vids or music - but is there a way to get the song to play, without saying something like “click here!”?
I’ve put my code here - and yes I realise the song won’t play on Codepen 'cos the mp3’s missing.