Reputation: 3321
Using an MPMusicPlayerController
is there a way to query the tracks length?
Using .currentPlaybackTime I can figure out how far I am into the track but I have no way of knowing how long the track is.
My [MPMediaItem valueForProperty:MPMediaItemPropertyAssetURL]
returns null for some tracks so using the AVAsset won't work for me.
Upvotes: 4
Views: 2652
Reputation: 22405
Easy just use
NSNumber *duration=[item valueForProperty:MPMediaItemPropertyPlaybackDuration];
Upvotes: 14