http://stackoverflow.com/questions/3161635/entering-background-on-ios4-to-play-audio
It says to add a key/value pair to info.plist, which I've done, and
also to add the following line of code.
[[AVAudioSession sharedInstance]
setCategory:AVAudioSessionCategoryPlayback error:nil];
I'm supposed to put that near where the audio is called. Where might
I put that code in PhoneGap?
Thanks,
Joel
Code looks like this now.
if ([resourceURL isFileURL]) {
[[AVAudioSession sharedInstance]
setCategory:AVAudioSessionCategoryPlayback error:nil];
audioFile.player = [[ AVAudioPlayer alloc ]
initWithContentsOfURL:resourceURL error:&error];
} else {
NSData* data = [NSData dataWithContentsOfURL:resourceURL];
audioFile.player = [[ AVAudioPlayer alloc ] initWithData:data error:&error];
}
Joel
http://www.joeldare.com/wiki/play_an_mp3_audio_stream_in_phonegap
Thanks,
Joel