you can use -duration and -currentTime on your movie. Both will return
a QTTime like so:
QTTime duration = [movie duration];
QTTime currentTime = [movie currentTime];
The struct QTTime has the fields timeValue and timeScale, the first
one being a long long, the second one a long. So to get your
percentage:
float percentage = currentTime.timeValue / duration.timeValue; (am not
sure whether a cast to float for the longs will be necessary)
Disclaimer - New to Objective-C
I am trying to use the ProgressView / Cell class from the developer sample
code to create a progress bar for a QTMovie.
I want to get the status of the movie as a percent from currentTime /
Duration but do not understand QTTime. Code:
NSDictionary *myAtts = [theMovie movieAttributes];
NSValue *durationValue = [myAtts objectForKey:
QTMovieDurationAttribute];
NSValue *currentValue = [myAtts objectForKey:
QTMovieCurrentTimeAttribute];
How do I get a float value from an NSValue?