Last active
August 29, 2015 14:03
-
-
Save TiernanKennedy/7fd2274d7c89dcaae567 to your computer and use it in GitHub Desktop.
Get Duration of all items in AVPlayer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float count = 0.0; | |
for (AVPlayerItem *playerItem in self.player.items) { | |
CMTime duration = playerItem.asset.duration; | |
float durationSeconds = CMTimeGetSeconds(duration); | |
count = count + durationSeconds; | |
} | |
NSLog(@"total player duration: %.2f", count); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment