title: How to play local mp3 file on iOS Phonegap
body: <p>I'm trying to play some local mp3 files with my iPhone in my PhoneGap app. The sound files are located in assets/www/cssScript/sound/.. 
  I tested on my iPhone when I used it as a developer device connected to my computer, then everything worked perfectly. However, when I tested after downloading the app on another iPhone it did not work, which I think is very strange. Is the way Im doing it in my code correct? Are there any other ways to do this? All help will be deeply appreciated.  </p>
  
  <p>To play the sound I use this code</p>
  
  <pre><code>function playAudioBuy(sound) {
         // sound is for example click.mp3
  
         var path = window.location.pathname;
  
      var phoneGapPath = path.substring(0, path.lastIndexOf('/') + 1);
      var path2 = phoneGapPath + 'cssScript/sound/' + sound; 
  
  var my_media = new Media(path2,
      // success callback
      function () {
          console.log("playAudio():Audio Success");
      },
      // error callback
      function (err) {
          for(var i in err){
              console.log("playAudio():Audio Error: " + err.message + " error code " + err.code);
          }
      }
  );
  // Play audio
  my_media.play();
  }
  </code></pre>