记住用户上次播放的位置,然后下次播放时从历史时刻开始...
获取 MPMovieDurationAvailableNotification 这个消息后 修改播放的位置
1。
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(durationAvailable:)
name:MPMovieDurationAvailableNotification
object:nil];
2。
- (void) durationAvailable:(NSNotification*)notification
{
NSLog(@"durationAvailable notification ------ ");
//[[NSNotificationCenter defaultCenter]removeObserver:self name:MPMovieDurationAvailableNotification object:nil];
NSTimeInterval dur = moviePlayer.duration;
NSLog(@"duration:%f",dur);
if (playTime > 0.0 && playTime < dur) {
moviePlayer.currentPlaybackTime = playTime;
}
}