Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 519
  • Last Modified:

Playing a sound onload

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,
Sherry
0
Shareece
Asked:
Shareece
  • 4
  • 2
1 Solution
 
RouchieCommented:
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.
0
 
ShareeceAuthor Commented:
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?
thanks
0
 
RouchieCommented:
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.
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Jason C. LevineNo oneCommented:
Hey Rouchie,

Congratulations on making Guru!
0
 
RouchieCommented:
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!
0
 
Jason C. LevineNo oneCommented:
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.
0
 
RouchieCommented:
Cross-post?  I wasn't aware of that.  Yes, sadly that would be right.  

We'll see anyway...
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now