Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you get an iphone MPMoviePlayer video's total time?

I just want to figure out how to get a video's total time in seconds. Is there video metadata that loads or something?

like image 731
angelfilm entertainment Avatar asked Dec 14 '22 03:12

angelfilm entertainment


1 Answers

MPMoviePlayerController has a property duration (iOS 3.2+):

The duration of the movie, measured in seconds. (read-only)

@property (nonatomic, readonly) NSTimeInterval duration

If the duration of the movie is not known, the value in this property is 0.0. If the duration is subsequently determined, this property is updated and a MPMovieDurationAvailableNotification notification is posted.

like image 144
JOM Avatar answered Jan 16 '23 16:01

JOM