4

I use MPMoviePlayerController to play videos. And I want to set it's current play time for a specific value. But setting it does not move the play head to the actual value. For example if i set the current play back time to 660 seconds (11 mins) it moves the play head to 650 seconds (10 mins 50 seconds). The code i used to do 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've tried all the solutions I could find in the internet, like setting the initial playback time and some other solutions, but had no luck. Is there anyone who came across the same issue and found a solution?

Prabo
  • 164
  • 1
  • 2
  • 12
  • Have you checked this similar question? http://stackoverflow.com/questions/7364147/why-does-mpmovieplayercontroller-setcurrentplaybacktime-goes-to-the-wrong-time – alasker Mar 13 '16 at 02:54

0 Answers0