Playing a sound onload

Posted on 2006-11-03
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,
Question by:Shareece
  • 4
  • 2
LVL 25

Expert Comment

ID: 17867284
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.

Author Comment

ID: 17867982
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?
LVL 25

Accepted Solution

Rouchie earned 500 total points
ID: 17879499
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.
Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

LVL 70

Expert Comment

by:Jason C. Levine
ID: 17882468
Hey Rouchie,

Congratulations on making Guru!
LVL 25

Expert Comment

ID: 17882514
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!
LVL 70

Expert Comment

by:Jason C. Levine
ID: 17882660
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.
LVL 25

Expert Comment

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

We'll see anyway...

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
DW UserID Session from Login 1 111
Adobe Photoshop CC 2015 action script help 2 215
Video Not Showing 8 99
Need icon art 9 110
I made this because I wanted to get e-mail with a attached csv file so I'd would be able to import user input into a MS Excel template, but I also wanted to register/save all inputs from each day in a file on the server. 1st - It creates a temp C…
Before we dive into the marketing strategies involved with creating an effective homepage, it’s crucial that EE members know what a homepage is. In essence, a homepage is the introductory, or default page, of a website that typically highlights the …
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question