Reputation: 8810
which one is better and what is the difference between them, AVAudioPlayer or MPMusicPlayerController.
Please share your ideas. Thank you, Madan Mohan.
Upvotes: 1
Views: 1911
Reputation: 13546
AVAudioPlayer is able to play one song at a time. It cannot access iPod Library means you cannot play songs which are present in user's iPod's Library. But biggest advantage I see is AVAudioPlayer can play songs when your app is in background.
MPMusicPlayerController is used to play songs from a playlist you pick using MPMediaPickerController from iPod Library which is a plus point. It accesses many properties of song which AVAudioPlayer cannot. It cannot play music in background.
Upvotes: 1
Reputation: 1949
AVAudioPlayer is more lightweight and suited for playing single songs at a time
MPMusicPlayerController requires more resources because it has more features and is designed to play playlists containing several songs
Upvotes: 0