Hi all,
I have a project where I need to add an ambient music file to the website, which is playing in a loop and automatically in the background of the home page.
Yeah, it’s JS generating a HTML audio element, adding its source and starts playing it.
Your published site does play music for me: https://web-audio-test.webflow.io. I’m not sure if there’s some browser setting that might refuse to autoplay the song, but it works great from here in Chrome.
You could try the HTML5 audio tag. Add the word “controls” inbetween audio and autoplay if you want to see audio controls on the page. Obviously replace the src link to the audio file in this example with your own audio file hosted somewhere online.
I tried adding this to my site and it didn’t work. Tried viewing it on Microsoft Edge and Chrome, only the text “Your browser does not support the audio element”.