Jump to content

Help with Javascript/Firefox


Guest lazyFlakes

Recommended Posts

Guest lazyFlakes

Hi all

I'm hoping someone can help me with my little script.

All I want is to play a small mp3 track when a single button is clicked/toggled.

 

I know this is probably really basic stuff but I just can't get it to work in Firefox (3.5.7). Works in IE though.

I have installed the WMP pluggin for FF now it' saying

"music.Play is not a function".

 

[edit]Never mind. I figured it out. I just need to use the control object in FF. The code below now works :)

var sounds=0;
function musicPlayer ()
{
var music=document.getElementById ("player");
if (sounds==1)
{
if (music.controls) music.controls.stop ();
else music.Stop ();
sounds=0;
}
else 
{
if (music.controls) music.controls.play ();
else music.Play ();
sounds=1;
}
}

Edited by lazyFlakes
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...