AVAudioPlayer和MPMusicPlayerController的区别

本文对比了AVAudioPlayer与MPMusicPlayerController两个iOS音频播放组件的特点。AVAudioPlayer可以播放单一歌曲,并能在应用置于后台时继续播放;而MPMusicPlayerController则可以从iPod资料库中选取播放列表进行播放,提供更多歌曲属性信息,但无法在后台播放音乐。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

  1. 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.

  2. 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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值