我有这个非常奇怪的问题。我使用以下代码在视图控制器中创建了一个MPMoviePlayerController
:
player = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"vid96" ofType:@"mov"]]];
player.fullscreen = YES;
player.controlStyle = MPMovieControlStyleFullscreen;
player.view.frame = CGRectMake(0, 0, 320, 480);
[self.view addSubview:player.view];
现在,如果用户点击下一个/上一个按钮,MPMoviePlayerController
的视图就会消失。这是MPMoviePlayerController
的正常行为吗?有办法阻止这个吗?我真的不需要下一个/上一个按钮,所以如果有办法禁用或隐藏它们也可以。
尝试
[player setControlStyle:MPMovieControlModeHidden];
我有一个类似的问题。事实证明,MPMoviePlayerViewController.view上方的层次结构中还有另一个UIView。
修复了这个问题,视频停止了消失。