I'm playing music with an AVPlayer
. Now at a certain time a NSTimer
fires and I'dlike to fade over to another track. So I start fading out my AVPlayer and create a new AVPlayer instance to play the next song.
When on foreground this works as expected. But when my app is on background. The playing track fades out but the new AVPlayer
instance does not start playing. Is it just not possible to create a new AVPlayer instance on background? or how can I make it play? Or is there another way to overlap two tracks?
I could do the playback with AVQeueuPalyer
, but then I can't let tracks overlap. Any suggestions?
-- EDIT --
If it was not clear, I am able to play background audio as long as I want. Just creating a new AVPlayer instance in background does not work.
The correct way to do what I wanted seems to be AVMutableComposition. With that I don't need multiple AVPlayers and a few other benefits. For more details: I summarized it in a blogpost: http://www.postblog.me/2012/03/playing-multiple-overlapping-audio-tracks-in-background/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With