记住用户上次播放的位置,然后下次播放时从历史时刻开始

发布于:2021-12-02 10:41:47

记住用户上次播放的位置,然后下次播放时从历史时刻开始...?


获取 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;
????}
}







相关资源:java视频上传播放

相关推荐

最新更新

猜你喜欢