I’ve ready through all of the topics I could get my hands on about custom code for background music, but I haven’t been able to get it to work. This is for a personal wedding site, so we can forego any debate on whether it’s a good idea or not (I wouldn’t include background music on any kind of site looking to generate business.)
This is the current code I’m running, but the music is spotty. It only plays some of the time.
This is the code one of the topics suggested I use, but I was unsuccessful.
You, my friend, are about to start navigating into the dark waters of “autoplaying” media in a browser. I have dealt with it for several times now and it does drive me crazy to this day…Here’s a nice read: Autoplay policy in Chrome - Chrome Developers
TL;DR: You need the user to trigger the audio to play. Audios can`t be played automatically until the users asks for it to be played. (Ex: By clicking on a button or etc).
There are a few tricks to try to go around it, but very few actually worked when I tried.
Thanks Jeandcc for the response. This ask is not common and I agree that I wouldn’t recommend it for business use. This site is for nostalgic purposes.
As far as the background music goes, after fairly extensive research it appears that this may not be possible in Chrome currently. All solutions on Stackoverflow are no longer working with current versions of Chrome. I tried 5 different solutions with embeds, iframes, javascript, etc…with no luck. I can’t find a current answer, unfortunately you may have to rely on the user to press play or abandon the feature.
In our real estate business, we produce websites with lots of home photos. We use Mass Image Compressor - which you can download here… to massively reduce file sizes. We then upload the compressed files to SmugMug with whom we have an account. From SmugMug, we take an embed code for the photo gallery and on our Webflow site for that property, we use an embed block to display the photos. An example here.
I was often helped on the forum and I also want to tell you, I leave a link to my project, in which I inserted music on the site. She works pretty well. The main thing is to click on the music icon, but in web flow you can customize this icon yourself. make it attractive so that the user sees it and decides to click and then the music will turn on. Clicking again. the music will pause, but that’s not all, I am attaching a script that you just need to copy and paste. It will allow you to continue playing music when moving to other pages. It’s fine.
you need to get a direct link with the ending .mp3 just drop it in the hosting, the directory is the easiest way`
for some reason I can’t insert the code here on the forum. I will attach a piece of code in the page settings, where the rest of the code is, you need to work on it. It makes the music continue when you go to other pages