按下下一个/上一个按钮时视图消失
我有这个非常奇怪的问题。我使用以下代码在视图控制器中创建一个 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 的正常行为吗?有办法阻止这种情况吗?我真的不需要下一个/上一个按钮,所以如果有办法禁用或隐藏它们也可以。
I have this very strange problem. I create an MPMoviePlayerController
in my view controller with the following code:
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];
Now if the user taps on the next/previous buttons, the MPMoviePlayerController
's view simply disappears. Is this the normal behavior of MPMoviePlayerController
? Is there a way to stop this? I don't really need the next/previous buttons, so if there's a way to disable or hide them that would be OK too.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试
[player setControlStyle:MPMovieControlModeHidden];
try
[player setControlStyle:MPMovieControlModeHidden];
我有类似的问题。事实证明,MPMoviePlayerViewController.view 之上的层次结构中还有另一个 UIView。
修复了这个问题,视频就不再消失了。
I had a similar issue. It turns out that there was another UIView in the hierarchy above the MPMoviePlayerViewController.view.
Fixed that and the video stopped disappearing.