简体   繁体   中英

How to play mp3 url & document Directory mp3 file To MPMusicPlayerController

Hello I am new in iOS development. I am working on music player app. I want my player to display on notification tab as well. For this I need to use MPMusicPlayerController , because this can't be achieved with AVAudioPlayer .

The problem that I am facing that all tutorials of MPMusicPlayerController are playing songs from music library of the iPhone, but I need to play mp3 with url or the mp3 file in document directory.

You've more or less answered your own question. AVAudioPlayer can play URL based assets, but is much lower level than MPMusicPlayerController and it won't work with the notification page.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM