2

I have made a custom player that plays mp3 media files from a directory on the phone(sdcard, root and so on).

I want to encapsulate my mp3 files into my application, I've tried copying the files into my project root folder, I've created a new directory and copied them there, but after I build my .zip file on the build.phonegap site and I download the .apk file I have only:

assets/www/ and some .js files/index.html . My .mp3 files are nowhere to be found in the www folder.

If I go one level back I have a startup.zip file and if I open it I can find my files, but there are inexistent in the www folder.

Can someone tell me what structure do I have to respect, or how I have to build my app so that my .mp3 files are included in the www folder, so I can access them in my app.

doglover1337
  • 146
  • 4
  • 18

1 Answers1

0

I had a similar problem on android. I wrote this little function.

function getAudioFileName(audioFileName){
    if(isAndroid()){
        //LOG("It is android so changing fileName");
        return "/android_asset/www/" + audioFileName;
    }
    //LOG("Not android so leaving fileName");
    return audioFileName;
}

all of my sound files are in a sound directory under www. It is important to set the permissions to read write otherwise it doesn't get copied over.

Leo
  • 1,495
  • 23
  • 41