Playing audio w/ Html Component (doesn't work on Chrome)

Hi,

Some time ago I was trying to figure out how to play an audio file from a URL using the Html Component. Turns out I found out and it was quite easy. This is the post with the solution https://www.wix.com/code/home/forum/questions-answers/playing-audio-dynamically-solved

Since then I have made more complex things with the audios for the website. The problem is that now out of the blue it’s just not working anymore.

So I’ve found out that it’s an issue with Chrome policy on Autoplay. Basically autoplay is now allowed only if:

Another issue that makes no sense for me is that even when I click the Text that sends a message to the Html Component to play the audio it just won’t play. It shows the following error on the developer console: ‘’ DOMException: play() failed because the user didn’t interact wit te document first. ‘’ But a user clicking a Text on the page shoud fall under the first exception mentioned above for autoplay to be allowed.

The audios play just fine on FireFox, but not on I.E. I’m not sure if it’s because of the same policy that Chrome has now adopted.

Can anyone please point me in the right direction on how to deal with this ? I’m sure many more people have been impacted by this change. Chrome is the most used browser out there so it’s a big deal if your website doesn’t work properly on it. Personally I have a language learning website and it’s imperative that the audio autoplay when the user is learning or reviewing words and phrases.

Any guidance is appreciated!

2 Likes