While a song is being played, I tried to get currentPlaybackTime.
NSLog(@"Playback: %f", appDelegate.appMusicPlayer.currentPlaybackTime);
I always got "Playback: nan". The application gets the currentPlaybackTime correctly when running (not debugging). The LLDB debugger also gives the correct currentPlaybackTime.
Does anyone know what going on with this property?
I would have commented on this but since I don't have enough reputation to do so... According to this solution (I know, it's for MPMoviePlayerController but since both conform to the MPMediaPlayback Protocol this may be useful):
https://stackoverflow.com/a/10652551/3374794
You'll probably have to wait 1ms (1/1000 s) for the player to (?load?) the item.
MPMediaPlayBack Protocol Reference
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