ios - 无法单击我的 MPMoviePlayerViewController 上的控件

标签 ios objective-c mpmovieplayercontroller

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

这是我的实现:

  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

最佳答案

通过使用 performSelectorOnMainThread 调用我的方法修复了它

关于ios - 无法单击我的 MPMoviePlayerViewController 上的控件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37898874/

相关文章:

objective-c - 如何在 nsobject 类中调用 UIAlertView?

ios - 表格 View 中的嵌套 Collection View 更好或多个 Collection View

iphone - 以编程方式播放 iPhone 缓存中的视频

iphone - 工具栏上带有自定义按钮的 MPMoviePlayerController

ios - 假期关闭后将应用上传到应用商店

ios - 将 charAtIndex 分配给 stringWithCharacters 会给出无效的转换警告和错误的访问错误

objective-c - 什么是 "non-weak zeroing reference"

ios - 在字典扩展中找不到成员 'init'

objective-c - 在 Objective C 中显示华氏温度格式

ios - 无法使用 MPMoviePlayerController 从视频中获取多个图像。操作系统状态 -12433