Results 1 to 2 of 2

Thread: adding mp3 to entire site

  1. #1
    Join Date
    Jul 2006
    Location
    Antwerp, Belgium (Europe)
    Posts
    927
    Thanks
    121
    Thanked 2 Times in 2 Posts

    Default adding mp3 to entire site

    Hey all, I added a mp3 sound to my index, with this code:
    Code:
    <script>
    <!--
    var musicsrc="bajofondo.mp3"
    if (navigator.appName=="Microsoft Internet Explorer")
    document.write('<bgsound src='+'"'+musicsrc+'"'+' loop="infinite">')
    else 
    document.write('<embed src=\"'+musicsrc+'\" hidden="true" border="0" width="20" height="20" autostart="true" loop="true">')
    //-->
    </script>
    I have two problems:

    1/ Problem is that, when I click on a link to go to another page, the music stops. And when I place this code in every page, the music starts over again every time I go to another page. How can I keep the music going during the whole visit of the site, please ?

    2/ How can add a 'stop/pause' image ?

  2. #2
    Join Date
    Jul 2006
    Posts
    497
    Thanks
    8
    Thanked 70 Times in 70 Posts

    Default

    Why only in IE? Firefox (and probably Opera, Safari, etc.) can play music too.

    To play the song across pages, I believe you need to let the user download the song file and play it in a standalone media player. When you play it on a page, it's dependent on that page's presence in the browser.

    I have no idea about the buttons.
    -- Chris
    informal JavaScript student of Douglas Crockford
    I like wikis - a lot.

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
  •