在iOS7中,MPMoviePlayer重复模式属性不起作用

时间:2015-07-03 12:17:00

标签: iphone ios7 mpmovieplayer

在iOS8中,相同的代码工作正常。但是在完成视频后的iOS7中没有重复。我使用了下面的代码

@(currentPage: com.avaje.ebean.PagedList[Computer])

<ul>
  @for(computer <- currentPage.getList){
    <li>@computer.name</li>
  }
</ul>

1 个答案:

答案 0 :(得分:0)

我正在使用此代码在ios7和ios8中重复工作。

        videoPlayer = [[MPMoviePlayerController alloc]init];
        [videoPlayer setContentURL:[NSURL fileURLWithPath:vidUrl]];

        [[NSNotificationCenter defaultCenter] addObserver:self
                                                 selector:@selector(moviePlayBackDidFinish:)
                                                     name:MPMoviePlayerPlaybackDidFinishNotification
                                                   object:videoPlayer];


        videoPlayer.controlStyle = MPMovieControlStyleNone;
        videoPlayer.shouldAutoplay = YES;
        videoPlayer.repeatMode = MPMovieRepeatModeNone;

        videoPlayer.view.frame = videoPreview.bounds;
        videoPlayer.scalingMode=MPMovieScalingModeFill;
        [videoPreview insertSubview:videoPlayer.view belowSubview:btnPlayPreview];

        [videoPlayer setFullscreen:NO animated:NO];


- (void) moviePlayBackDidFinish:(NSNotification*)notification
{
    NSLog(@"NOTIFICATION :%@", notification);

    NSLog(@">>> Movieplaydidfinish");
    MPMoviePlayerController *player = [notification object];
    [player play];

}