Hey guys,
I'm trying to make a MPMoviePlayerController that updates a progressview according to how far it is in the movie.
Code:
- (void) movieDurationFound:(NSNotification*)notification {
MPMoviePlayerController *moviePlayerObj = [notification object];
NSLog(@"%f", [moviePlayerObj duration]);
ViewController *radio = [[ViewController alloc]init];
float progressTime = [moviePlayerObj currentPlaybackTime] / [moviePlayerObj duration];
[view setProgressOnMovie:progressTime];
NSLog(@"%f", progressTime);
[NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(updateTime) userInfo:nil repeats:YES];
}
- (void) updateTime{
ViewController *view = [[ViewController alloc]init];
float progressTime = [moviePlayer currentPlaybackTime] / [moviePlayer duration];
NSLog(@"%f", progressTime);
[view setProgressOnMovie:progressTime];
}
That code calls this function:
Code:
- (void)setProgressOnMovie:(float)progressTime{
[progress setProgress:progressTime];
}
Absolutely nothing happens. (they are in separate classes) I also tried making progress (the UIProgressView) a property and editing it straight from the other class but no luck. Any thoughts?