Results 1 to 2 of 2

Thread: music on page with stop button

  1. #1
    Join Date
    Jul 2007
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default music on page with stop button

    hi, i'm trying to have music autoplay on a page with a button to stop or pause it. is there a way to make this work with the code below? if not, can someone recommend another piece of code that would work that uses a linked piece of text to stop the music? i'm not interested in having an embed player come up on the page.
    thanks much!
    ps- please save the autoplay music debate, this is what the client has asked for


    Code:
    <html>
    <head>
    <script type="text/javascript"><!--
    function play(what){
    document.getElementById('music1').innerHTML="<embed type='application/x-mplayer2' id='music2' pluginspage='http://www.microsoft.com/Windows/MediaPlayer/' src='"+what+"' name='MediaPlayer1' width='0' height='0' controltype='2' showcontrols='1' showstatusbar='1' AutoStart='true' loop='false' ></embed>";
    }
    function stopsong(){
    document.getElementById('music1').innerHTML="";
    }
    //-->
    </script>
    </head>
    
    <body>
    
    <div id="music">music <a href="mp3/somefile.mp3" class="blue" onclick="play(this.href);return false">ON</a> / <a href="#" class="blue" onclick="stopsong();return false">OFF</a></div><span id="music1"></span>
       </div>
    </body>
    </html>

  2. #2
    Join Date
    Jul 2007
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    sorry, this has already been answered here....

    http://www.dynamicdrive.com/forums/s...ay+stop+button

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •