I am creating a music application, much like the standard music app. Now, I am befuddled on how they were able to read and change the elapsed time of a song using a UISlider. How is it possible to read and change the elapsed time of a song?
Asked
Active
Viewed 757 times
0

Matthieu Brucher
- 21,634
- 7
- 38
- 62

Flafla2
- 691
- 2
- 11
- 21
-
After your last question (http://stackoverflow.com/questions/2274475/detecting-if-music-is-playing), did you have a look at the documentation for `MPMusicPlayerController`? – Ole Begemann Feb 16 '10 at 22:48
-
Well, I looked and found nothing... – Flafla2 Feb 16 '10 at 23:57
1 Answers
1
By calling beginGeneratingPlaybackNotifications
on the MPMusicPlayerController
and registering for MPMusicPlayerControllerPlaybackStateDidChangeNotification
notifications, you will receive periodic updates when the playback state has changed. In the handler for that notification you can then get the currentPlaybackTime
from the MPMusicPlayerController
.

Stefan Arentz
- 34,311
- 8
- 67
- 88