MPMovieplayerController doesn't play next URL

2019-02-27 18:20发布

问题:

I am developing an iOS app in which I am streaming .mp3 files using MPMoviePlayerController. When playing of one file completes I take next url and play the file. All works great in foreground but when I move the app to background the current song plays well but when it finishes, the method which plays the next song doesn't get executed.

I checked similar questions on stackoverflow but the solutions doesn't seem to work for me.

Any pointer in the right direction will be very helpful.

Thanks in advance!

EDIT :On testing the app on different devices I found that the functionality is working on iOS 5.1 but not in iOS 4.3. So I creted a sample app which plays a local file on finishing the previous one and that app does its job correctly in all versions of iOS even when in background.Its now have become more confusing for me.

回答1:

I couldn't do it using MPMoviePlayerController.

Finally used AudioStreamer.

My app is working fine now.

Thanks Matt!