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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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.
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
setting a Cron job to Email users from database monthly 2 120
Rotating Adobe pdf document 4 339
Something related to Search engine 8 112
Semi-transparent PNG 5 204
For those who don't know, Adobe Dreamweaver is a popular commercial web editor that enables you to design, build and manage complex websites. The editor is a WYSIWYG (What You See Is What You Get) web editor, which means that you can create your web…
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…

752 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