无法单击MPMoviePlayerViewController上的控件

时间:2016-06-18 15:52:43

标签: ios objective-c mpmovieplayercontroller

我正在我的MPMoviePlayerViewController上播放一个网址。我无法点击播放器的任何控件。

这是我的实施:

  NSURL *streamUrl   = [NSURL URLWithString:movieUrl];
    MPMoviePlayerViewController *mpvc = [[MPMoviePlayerViewController alloc] initWithContentURL:streamUrl];
    [[mpvc view] setFrame:self.view.bounds];
    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(movieFinishedCallback:)
                                                 name:MPMoviePlayerPlaybackDidFinishNotification
                                               object:nil];

    mpvc.moviePlayer.movieSourceType = MPMovieSourceTypeStreaming;
    [mpvc.moviePlayer setControlStyle:MPMovieControlStyleFullscreen];
    [mpvc.moviePlayer setShouldAutoplay:YES];
    [mpvc.moviePlayer setFullscreen:NO animated:YES];
    [mpvc setModalTransitionStyle:UIModalTransitionStyleCoverVertical];
    [mpvc.moviePlayer setScalingMode:MPMovieScalingModeNone];
    [mpvc.moviePlayer setUseApplicationAudioSession:NO];
    [self presentMoviePlayerViewControllerAnimated:mpvc];

MPMoviePlayerViewController

1 个答案:

答案 0 :(得分:1)

通过使用performSelectorOnMainThread

调用我的方法来修复它