views:

267

answers:

5

I want to play an audio file whenever my page gets loaded onto the client browser. And if a user presses a pause button on the web page then the sound gets paused until he leaves the sound and can resume as well. ?

+2  A: 

The easy musicplayer for flash is a easy-to-set up MP3 player solution that does what you need. It provides "play" and "pause" buttons.

Pekka
+1  A: 

I found this web site helpful for setting up a sound file from within a page. In my case, I only wanted it to play if they clicked something. I would agree with others here who suggested that.

This web site http://www.phon.ucl.ac.uk/home/mark/audio/play.htm

One problem I have is when I have a number of web pages open and one of them starts making a sound, it is very difficult to find the page to get it to shut up. It is better to have the user launch the sound.

Joel Provost
thx i would prob do that to play music on user's wish. But how can i pause a music
Shantanu Gupta
+1  A: 

Until HTML 5, flash is going to be your best solution, this is mostly because it's an intrusion to have a page commandeer control of the user's speakers, and thus why people have recommended not doing this at all or making it so that the user must explicitly click something.

Here's a page with some freebie flash player options: http://www.premiumbeat.com/flash%5Fresources/free%5Fflash%5Fmusic%5Fplayer/

marr75
Can you plz provide me a link to some example to make ur point more clearer.. Didn't get u how to embed flash for playing sound
Shantanu Gupta
@Shantanu Gupta see my answer.
gmcalab
+2  A: 

Here's some examples. But as some said before, its not the best idea to have sound. But if yo do at least have a toggle to mute, turn the volume down or disable it totally.

gmcalab
A: 

I guess achieving the same with jquery plugins won't be less exciting!

The jquery mediaplayer does the same. Using this jquery plugin, you can play your media player files without the need of windows media player. The limitation is that this works only with the media player type of files.

Further, since mp3 files are highly used in web pages, we could use the bssound jquery plugin to embed mp3 file in our web page.

sangam