Closed Samback closed 11 years ago
Because this class is for remote media only, so it can't play local mp3 media.
So, it's no way how to put my mp3 files there? Maybe I could feed it using something like this
NSString filepath = [[NSBundle mainBundle]pathForResource:@"point1sec" ofType:@"mp3"]; if ([[NSFileManager defaultManager]fileExistsAtPath:filepath]) { isInEmptySound = YES; AVPlayerItem playerItem = [AVPlayerItem playerItemWithURL:[NSURL fileURLWithPath:filepath]]; audioPlayer = [AVQueuePlayer queuePlayerWithItems:[NSArray arrayWithObject:playerItem]]; } ?
Yes, use AVQueuePlayer or AVAudioPlayer directly is what you need to do. Apple AVAudioFramework supports local media file flawlessly, not like remote media playback. HysteriaPlayer only focused on remote media to do things such as pre-buffer, bad network suspend-restart etc..
Short Answer: If you want to play local media file, use AVAudioPlayer or AVQueuePlayer.
Thanks!
Thanks for response.
:dancers:
It is not clear for me how can I just feed player with mp3 array that lay on my app folder. For example mp3Array = @[@"1.mp3", @"2.mp3", @"3.mp3"]; I have try also mp3Array = @[ [[NSBundle mainBundle]pathForResource:@"1" ofType:@"mp3"], [[NSBundle mainBundle]pathForResource:@"2" ofType:@"mp3"], [[NSBundle mainBundle]pathForResource:@"3" ofType:@"mp3"]];