It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming JavaScript Forum

Playing Music

Playing Music

Postby perito on Mon Feb 11, 2008 2:38 pm

I want to add a speaker icon to my website, when the page loads, a music file (.mp3) starts playing, when the user clicks on the speaker it changes to another icon (mute speaker) and the sound stops
agian when the user click on the mute speaker, it changes back to the orginal speaker and the sound restarts.

How can I do this?
Should I use Flash or is it possible to be done in HTML or JAVASCRIPT?

thx
perito
 
Posts: 4
Joined: Mon Feb 11, 2008 2:31 pm

Postby leonard on Mon Feb 11, 2008 2:56 pm

As far as I know you cannot run mp3's with javascript.

You can transform the mp3 to flash and call the flash with:
Code: Select all
<embed src="./myTune.swf" width="0" height="0"> </embed>


If you find out another way to autorun music. feel free to post it here.
Theres probably a way using java-applets, but that's definitely not recommended ;-)

cheers!
- leonard
:%s/^M//
There are 10 kinds of people:
Those who understand binary and those who don't.
User avatar
leonard
100+ Club
 
Posts: 147
Joined: Tue Dec 18, 2007 7:11 am
Location: Switzerland


Who is online

Users browsing this forum: No registered users and 4 guests