How do I play and mute sound using javascript?

I have embeded sound using Javascript, I can play, pause, and stop it but I also want to foward and rewind it, and I also want to show the counter/timer.

Is there anyway I can do all these…I need this very immediately!!

Can anyone help?

Thank You!!

***my code below…


[SIZE=2]


<table>
<tr>
<td valign="bottom" class="pod-holder">
<a href="#"><img src="hom_000_files/player_rew.gif" alt="Previous" width="29" height="29" border="0"></a>
<img src=play.jpg id=img1 onclick="callf()" style="cursor:hand">
<img src="hom_000_files/player_stop.gif" alt="Stop" width="29" height="29" border="0" onClick="document.mySound.stop()" style="cursor:hand">
<a href="#"><img src="hom_000_files/player_ff.gif" alt="Next" width="29" height="29" border="0"></a>
</td>
</tr>
</table>

<OBJECT id="mySound" CLASSID="CLSID:05589FA1-C356-11CE-BF01-00AA0055595A" WIDTH=0 HEIGHT=0>
  <PARAM NAME="Version" VALUE="1">
  <PARAM NAME="EnableContextMenu" VALUE="-1">
  <PARAM NAME="ShowDisplay" VALUE="0">
  <PARAM NAME="rate" VALUE="1">
  <PARAM NAME="ShowControls" VALUE="0">
  <PARAM NAME="ShowPositionControls" VALUE="0">
  <PARAM NAME="ShowSelectionControls" VALUE="0">
  <PARAM NAME="EnablePositionControls" VALUE="0">
  <PARAM NAME="EnableSelectionControls" VALUE="0">
  <PARAM NAME="ShowTracker" VALUE="0">
  <PARAM NAME="EnableTracker" VALUE="0">
  <PARAM NAME="AllowHideDisplay" VALUE="0">
  <PARAM NAME="AllowHideControls" VALUE="0">
  <PARAM NAME="AutoStart" VALUE="0">
  <PARAM NAME="PlayCount" VALUE="1">
  <PARAM NAME="Appearance" VALUE="0">
  <PARAM NAME="BorderStyle" VALUE="0">
  <PARAM NAME="FileName" VALUE="four51_pageflex.mp3">
  <PARAM NAME="DisplayMode" VALUE="0">
  <PARAM NAME="AllowChangeDisplayMode" VALUE="-1">
</OBJECT>
<br>
<script language="JavaScript">

    function changeStuff() {

        if (mySound.CurrentState == 0) {
            mySound.Rate = 1;
            mySound.Volume = 0.0;
            mySound.SelectionStart = 0.0;
            mySound.SelectionEnd = 1.0;
            mySound.Run();
            }

        else if (mySound.CurrentState == 1) {

            mySound.Rate = 1;
            mySound.Volume = 0.0;
            mySound.SelectionStart = 0.0;
            mySound.SelectionEnd = 1.0;
            mySound.Run();
            }

        else if (mySound.CurrentState == 0) {
            mySound.Stop();
            }
    }
    function pauseMe() {
        mySound.Pause();
    }
    var flag=false;
        function callf(){

            if(flag==false)
            {
                changeStuff();
                flag=true;
                img1.src="pause.jpg"
            }
            
                else if(flag==true)
            {
                pauseMe();
                flag=false;
                img1.src="play.jpg"
            }
            
    }
</script>

[/SIZE]

can anyone help???

u still haven’t found the solution after 6 months? try this as a solution:
http://www.wimpyplayer.com/products/mp3/javascript_mp3_player.html

uses a little flash too i believe.

hehe… i somehow managed the other projects but this one is pretty critical.

Can’t i fwd and rew on the same track using only javascript??

Is there a particular reason that you couldn’t just embed it using quicktime or shudder windows media player? and use their controls?

ya the client wants teh player to be customised…the looks shud go with the site… :stare: