How to get Duration from AVPlayer (Not AVAudioPlayer)?
self.player.currentItem.asset.duration
Got it!
headers
#import <AVFoundation/AVPlayer.h>
#import <AVFoundation/AVPlayerItem.h>
#import <AVFoundation/AVAsset.h>
code
CMTime duration = self.player.currentItem.asset.duration;
float seconds = CMTimeGetSeconds(duration);
NSLog(@"duration: %.2f", seconds);
frameworks
AVFoundation
CoreMedia