I am using MPMoviePlayerController to play videos. And I want to set the current playback time for a specific value. But setting it does not move the playback head to the actual value. For example, if I set the current playback time to 660 seconds (11 minutes), it moves the playback head up to 650 seconds (10 minutes 50 seconds). The code I used for this is as follows
- (void) addMoviePlayer {
_player = [[MPMoviePlayerController alloc] initWithContentURL: url];
[_player.view setFrame: CGRectMake(250, 79, 480, 270)];
[self.view addSubview:_player.view];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(playbackStateChanged:) name:MPMoviePlayerPlaybackStateDidChangeNotification object:_player];
_player.shouldAutoplay = NO;
[_player prepareToPlay];
}
-(void)changePlayTime
{
[_player pause];
[_player setCurrentPlaybackTime:660];
[_player play];
}
I tried all the solutions that I could find on the Internet, for example, set the initial playback time and some other solutions, but no luck. Is there anyone who ran into one problem and found a solution?