How can I loop music on my website? Using Microsoft Frontpage, I have uploaded to my site, consisiting of 17 pages, a soundtrack to each and every page but obviously every time I switch pages the track restarts. I would like to loop so that the track plays continuously whilst you are visiting the website switching pages or not. Thanks.

Dani AI

Generated

Following and replies from , , and , here is a concise, modern take that keeps the original question in mind while addressing browser behavior, accessibility and practical implementation.

If the goal is "continuous" playback as the visitor navigates, the underlying requirement is to avoid full page reloads for the audio player. Three workable patterns:

  • Keep a single audio element in a persistent part of the UI (header or a small frame/iframe) while loading page content into a separate region.
  • Convert the site to load content dynamically (single‑page app or AJAX navigation) so the audio element stays in the DOM.
  • If those are impossible, provide an obvious, user-initiated player on each page (so play is started by the user and not blocked by browsers).

A minimal HTML5 example for a user-controlled looped player:

<audio id="bg" controls loop preload="none">
  <source src="music.mp3" type="audio/mpeg">
  Your browser does not support the audio element.
</audio>

A simple persistent layout can place that element outside the content iframe so navigation does not reload the player.

Design and legal notes: do not rely on autoplay (modern browsers commonly block audible autoplay — see MDN's autoplay guidance). Always surface controls (play/pause/mute), provide keyboard access and labels for screen readers, and avoid forcing audio on users. Check licensing for any music used; Creative Commons and commercial licenses differ and must be respected.

For implementation details and accessibility best practices consult the HTML audio documentation and WAI guidance:

Troubleshooting: if playback restarts, confirm the player element is not reloaded; on mobile devices backgrounding or power saving can pause audio; use compressed files and preload="none" to reduce bandwidth impact.

Recommended Answers

All 10 Replies

Member Avatar for Member #114696

I dont know what fromtpage really do(i dont use it). Tell me what code is it generating. Is it inserting an object or using something like <BGSOUND SRC="helloo.wav">

I would say these easiest way to do this is just a small flash document that has basically got a sound loop on it and an off button. There are many tutorials for this online.

Sorry vishesh for ignoring your post but this way just seems easier.;)

Member Avatar for Member #114696

But he's asking it to do with frontpage, and probably he doesn't know how to insert it and i suppose fronpage doesnt integrate well with flash.

But he's asking it to do with frontpage, and probably he doesn't know how to insert it and i suppose fronpage doesnt integrate well with flash.

Yes very true, sorry. I didn't read the question properly. Anyway, yes in frontpage I am pretty sure there is a feature to add music. We need to know how you are trying to go about it.

Thank you guys for trying to help me but I've decided not to go ahead with the music as I have been advised that music on websites is not generally appreciated. Regards.

I'm actually quite suprised I didn't say that myself. I am glad we could kind of help... I think. ;)

Member Avatar for Member #114696

Thank you guys for trying to help me but I've decided not to go ahead with the music as I have been advised that music on websites is not generally appreciated. Regards.

That's very well said music on website is not appreciated. Its annoying, its good that you got to know it somehow.

vishesh

there is plenty of mps players that can be installed onto a webpage, just search for mp3 player code

I think he wants background music and so what you are thinking of is not the best solution. But anyway this is really a solved topic.

You just caused the whole cube farm to prarie-dog with that music! Thanks a lot! :P

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.