We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now


Playing a sound onload

Medium Priority
Last Modified: 2013-11-18
I can't insert a sound in my page in none of the ways DW-Help describes,
can't although play it inside DW (properties window)- it gives me the
message that DW is unable to find Plug-ins to handle this media typ. It
doesn't neighter play .wav nor .mp3, although a normal mp3 cd is been played
on my pc without any problems.

B.T.W. I want a sound to be played on my homepage(Body onload= ....),
- continual I mean even once the user goes to another page,
- to be played in both PC and apple without need for a plugin
- and have a button "Stop playing sound" - Can't find it in behaviours panel.

Would be greatful for any help,
Watch Question


Before you do this, just consider the users with a slow connection.  Many people find it annoying browsing while music plays.  Even though you are including a STOP button, the way in which you are adding the sound means it will be downloaded before the user can get a chance to stop it.  This means that the rest of your page might not even appear before the sound has downloaded, meaning the page won't be very popular!

The most common reason the sound won't play is that a codec has been used to save the MP3 file that is not used by IE to play it back.  Not all MP3's are the same, bizarrely enough!  Try saving the file using a common codec, such as LAME.

My advice is to put the sound file inside a flash movie.  This way it will definitely play providing the user has the flash player (about 97% of the internet browsing population).  You could then have a starting page in the movie that says, "Music will play in XX seconds, click here to prevent this..."

...or something to that effect.


Thanks for the answer.  It is not me, my client wants a sound to be played in the page till the user tells: Stop!

Any way, lets say I put a flash movie with sound in the first page of the website. will the sound be continued playing also once the user navigates to another (pur HTML) page?
No, unfortunately not.  The sound is delivered from the page, so once the page changes, the sound will stop and then have to restart.  There are 2 ways around this, depending on where your skills lay.

1.  You will need a page that displays constantly, while the other content pages are displaying.  This constant page would hold the sound player.  You would use frames here; one side that holds the constant page, the rest that holds the other pages.  The downside is that frames look a bit untidy.

1b.  You could launch the sound page in a popup using javascript.  This is probably the best approach since the window size can be customized to your exact liking (i.e. the size of a STOP button).  The stop button would actually just simply close the window, which would kill the sound anyway.

2.  You can do the whole site in Flash.  Because flash can contain multiple "child" movies in the same window, you could have the music playing while the user navigated through the other child content movies.

For simplicity, I'd say that 1b is the best approach.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Jason C. LevineDon't talk to me.

Hey Rouchie,

Congratulations on making Guru!

Hey wow, I didn't even see that myself!!!

Thanks Jason - although I'm not making any progress on your position!   I can see you celebrating the 1m point mark by this time next year!
Jason C. LevineDon't talk to me.

Meh.  It took a whole year to get to 400k.  If the new site launches and people are allowed to cross post questions in multiple TA's, our little pool of points will go way down as the HTML, CSS, PHP, and ASP guys get their shot at these Q's.

Cross-post?  I wasn't aware of that.  Yes, sadly that would be right.  

We'll see anyway...
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.