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.
AVAudioPlayer和MPMusicPlayerController的区别
最新推荐文章于 2025-12-24 13:01:24 发布
本文对比了AVAudioPlayer与MPMusicPlayerController两个iOS音频播放组件的特点。AVAudioPlayer可以播放单一歌曲,并能在应用置于后台时继续播放;而MPMusicPlayerController则可以从iPod资料库中选取播放列表进行播放,提供更多歌曲属性信息,但无法在后台播放音乐。
180

被折叠的 条评论
为什么被折叠?



