I am developing a music app, where the music continues playing even when the app goes into background and uses beginReceivingRemoteControlEvents
so that the user can control the status of the playback by clicking the home button twice on his iPhone/iPad.
I went through the "Music App" Sample developed by Apple where it uses MPMusicPlayerController
where it fetches songs from iPod Library, but it stops the song as soon as the app goes to background and does not support beginReceivingRemoteControlEvents
.
I checked a few articles where it says use AVPlayer, but it doesnt support fetching music from iPod Library so I am stuck in how to play the music when the app goes into background and it is controlled via remoteEvents.