advertisement

Article:
  Build a Simple MP3 Player for Your Site
Subject:   Batmo MP3 Player
Date:   2009-01-11 09:00:15
From:   George Crozer
Hi I am developing a band website and would like to use your Batmo Mp3 player to showcase songs. I have followed the instructions in both the Feb 23 2005 and May 31 2006 tutorials and cannot get the player to work. I have uploaded the external javascript in a separate BatmoAudioPop.js file to my server. The link to external javascript <script src="BatmoAudioPop.js" type="text/javascript"></script> is between the head tags of the page. finally the information Vocoder Example (http://www.my_site/mymusic_folder/my_song.mp3) is between the body tags on the page.
I am running OS x with the latest update and my Java script is enabled. the Mp3 is also uploaded. When i click the link on the published page Im taken to a to the new blank page to play the Mp3 the link to javascript is not initiating . Please Help.
Full Threads Oldest First

Showing messages 1 through 4 of 4.

  • David Battino photo Batmo MP3 Player
    2009-01-11 15:50:27  David Battino | O'Reilly Blogger [Reply | View]

    George: Do your song titles contain apostrophes or quotes? That's the most frequent reason the script breaks. You need to "escape" apostrophes and quotes by preceding them with a backslash. Send me a link to your test page and I'll take a look.
    • Batmo MP3 Player
      2009-01-13 00:40:35  George Crozer [Reply | View]

      Hi David
      thanks for getting back to me!
      the link to my test page is http://www.theredfords.gcrozer.com/batmotest.html

      Kind regards
      George
      • David Battino photo Batmo MP3 Player
        2009-01-13 01:10:40  David Battino | O'Reilly Blogger [Reply | View]

        Hi George.

        I see the problem: The closing bracket for the if (visitorOS != "Windows") section should be on the next line. In your version of the script, it's commented out. Try using the version of the script in the zip file; it looks like the one printed here may have been formatted such that the bracket got absorbed.
        • Batmo MP3 Player
          2009-01-14 15:55:03  George Crozer [Reply | View]

          Hi David
          Thank you for sorting that out. the great thing about this non flash player is that it works on the iphone as well (the wimpy player is great too but yours is rock solid)
          i'll ask the next question on behalf of the other person out here who doesn't understand much about scripts!!
          I would like to include a playlist like you detail further in the tutorial! would say to create a page with all the individual URLs listed and save with .m3u extensions. This i can do ok but!!
          Is the list in the body or the head?
          There must be a link required somewhere?

          Is there a link change necessary to the name of player (/my_mp3s/mysong.mp3)

          Is there anything else to add to the javascript

          I shall try the pictures next that looks good too!!