Page 1 of 1

Streaming music

Posted: Sun Jun 22, 2025 11:28 am
by kether
Hello everyone,

Here's my problem: I'd like to play music continuously on my website, without it cutting out and restarting every time you change pages. How can I do this?
Thanks in advance.

Re: Streaming music

Posted: Sun Jun 22, 2025 11:55 am
by Pablo
There is no standard solution for this in HTML. The browser will reload the entire page (including the audio) when you change the page.
The only way to prevent this is if you load the page content via AJAX. This will require custom coding and may become complicated if you use lots of scripts because these need to be reinitialize each time.

Re: Streaming music

Posted: Sun Jun 22, 2025 3:33 pm
by Bluesman
Hi kether, maybe you can use the technique with a "carousel" in full page and connect the slides as pages to the menu. I did it with an old site but with a video background that looped continousely.

Check: https://www.chevere.ec/templates/sainam/

Am away out from now but if interesting I know Pablo have a template or tutorial for this.

Re: Streaming music

Posted: Mon Jun 23, 2025 10:18 am
by kether
Hello,
Thank you for your replies. This is too complicated for me, so I'll just leave it as is. I thought there was some kind of script I could put in my pages to solve this problem...
Thanks again.

Re: Streaming music

Posted: Mon Jun 23, 2025 10:27 am
by Pablo
Unfortunately, it is not that simple. Even if you have a generic ajax scripts then you still need to take all other scripts on the page into account.

Re: Streaming music

Posted: Tue Jun 24, 2025 8:13 pm
by BaconFries
As already mentioned it could possibly be done using Ajax (custom coding) Another thing you would need to take into account is that the many modern browsers disable audio playback this is because due to audio being played without any user interaction (stop/pause) is annoying so you would need a way to control this for there benefit.

Re: Streaming music

Posted: Wed Jun 25, 2025 4:31 am
by AliGW
I have no idea what sort of website this is, but if I arrived on a website and music started playing with no way for me to mute it, I'd leave the website immediately. If you want to take control of my audio whilst I'm visiting, what else do you want to try to control?

Please consider making the background music an option (opt in, not opt out).

Re: Streaming music

Posted: Wed Jun 25, 2025 2:50 pm
by kether
Hello everyone and thank you for your respective contributions... I have already given up on the idea of ​​putting music on.

Re: Streaming music

Posted: Wed Jun 25, 2025 5:07 pm
by KingSparta