文章源地址:http://386502324.blog.163.com/blog/static/11346937720151095733692/
在
ios8.4之前,MPMoviePlayerController只要在prepareToPlay之
前,setInitialPlaybackTime:即可实现继续播放的功能,但是ios8.4开始,发现设置后,视频还是会从头开始播放。打印发现,设
置无效。我们可以选择在其代理中完成设置。亲测有效,下面是修正方法。
1:设置全局变量 bool playTimeSetter = NO;初始值。
2:在下面的通知接收方法中,
- (void)playerPlaybackStateDidChange:(NSNotification *)aNotification {
if (state == MPMoviePlaybackStatePlaying)
{
if (!self.playTimeSetter) {
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.35){
[playerController_ setCurrentPlaybackTime:initialPlaybackTime_];
self.playTimeSetter = YES;
}
}
}
}
3:重新运行,done。
iOS8.4后MPMoviePlayerController继续播放的bug以及修复方法
原文:http://www.cnblogs.com/xukunhenchouchang/p/4950513.html