ankit yadav
ankit yadav

Reputation: 363

How can we make the NSTimer to run in background for my audio player in iOS

I am making a audio player in iOS and i have made the audio player,and i am updating the duration of currently playing song using NSTimer,but the thing is that if my app goes in background the timer stops .

Is there any way by which i can run my NSTimer in background ,in order to update the currently playing song current duration. How apple is running their Audio player in background?

MPMediaPlayer and AVQueuePlayer progress slider, with time left and time elapsed.

Upvotes: 0

Views: 314

Answers (1)

TheEye
TheEye

Reputation: 9346

If your app is in the background, nobody will see the update anyway.

Just make sure you start the timer again when the app is coming into the foreground, and you'll be fine.

Upvotes: 3

Related Questions