MPMoviePlayerController口吃

时间:2009-08-08 22:16:19

标签: iphone video media-player

代码:

   NSString *path = [[NSBundle mainBundle] pathForResource:@"sample" ofType:@"m4v"];

   MPMoviePlayerController *video = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:path]]; 

   [video setBackgroundColor:[UIColor blackColor]];
   video.scalingMode = MPMovieScalingModeAspectFill; 

   [[ NSNotificationCenter defaultCenter ] addObserver: self selector: @selector(movieFinishedCallback:) name: MPMoviePlayerPlaybackDidFinishNotification object: aVideo ];

   [video play];

....movieFinishedCallback...

   [video release];

结果:

电影从第10帧开始,然后重置为第0帧,从而产生口吃效果......

任何想法?

1 个答案:

答案 0 :(得分:0)

试试这段代码:

movieplayer.initialPlaybackTime = -1;

为我工作!也许这不是同一个问题,但似乎它可能会有所帮助。

祝你好运。