I am playing audio in iphone app but problem is that it works fine on simulator but it is not working on device here is my code it just closes the app when this code runs.
NSString*thePath=[[NSBundle mainBundle] pathForResource:fileName ofType:@"MP3"];
NSURL*url=[NSURL fileURLWithPath:thePath];
//NSURL *url = [NSURL URLWithString:@"http://celeritas-solutions.com/pah_brd_v1/productivo/1.mp3"];
mp = [[MPMoviePlayerViewController alloc] initWithContentURL:url];
[[mp moviePlayer] prepareToPlay];
[[mp moviePlayer] setUseApplicationAudioSession:NO];
[[mp moviePlayer] setShouldAutoplay:YES];
[[mp moviePlayer] setControlStyle:2];
[[mp moviePlayer] setRepeatMode:MPMovieRepeatModeOne];
[self presentMoviePlayerViewControllerAnimated:mp];
Here is the video code this also works on simulator but not on iphone
NSString*thePath=[[NSBundle mainBundle] pathForResource:fileName ofType:@"MP4"];
NSURL*url=[NSURL fileURLWithPath:thePath];
//NSURL *url = [NSURL URLWithString:@"http://celeritas-solutions.com/pah_brd_v1/productivo/1.mp4"];
mp = [[MPMoviePlayerViewController alloc] initWithContentURL:url];
[[mp moviePlayer] prepareToPlay];
[[mp moviePlayer] setUseApplicationAudioSession:NO];
[[mp moviePlayer] setShouldAutoplay:YES];
[[mp moviePlayer] setControlStyle:2];
[[mp moviePlayer] setRepeatMode:MPMovieRepeatModeOne];
[self presentMoviePlayerViewControllerAnimated:mp];