如何在全屏模式下关闭 MPMoviePlayerController 上的后退和下一步按钮?

发布于 2024-10-04 19:30:38 字数 197 浏览 3 评论 0原文

我的 iPad 应用程序中有一个 MPMoviePlayerController。当有视频要观看时,用户点击它,然后可以全屏显示。但是,如果用户在全屏模式下按“NEXT”按钮,电影就会变成空白,并且无法再次播放视频!

无论如何,我不需要后退和下一步按钮。我如何摆脱它们,或者对其进行排序,以免它使我的应用程序崩溃?

谢谢!

:-乔

I have an MPMoviePlayerController in my iPad app. When there's a video to view, the user taps on it, then can go full screen. However, if the user presses the NEXT button in full screen mode, the movie goes blank and the video can't be played again!

I don't need the back and next buttons anyway. How do I get rid of them, or sort this so it doesn't crash my app?

Thanks!

:-Joe

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

诗化ㄋ丶相逢 2024-10-11 19:30:38

您可以尝试将其 controlStyle 设置为 MPMovieControlStyleEmbedded - 这将为您提供嵌入式样式的控件,这些控件只是一个滑动条、一个播放/暂停按钮和一个全屏切换。

You could try setting its controlStyle to MPMovieControlStyleEmbedded—that'll give you the embedded-style controls, which're just a scrubber bar, a play/pause button, and a fullscreen toggle.

揽清风入怀 2024-10-11 19:30:38

刚刚在 iOS 7 中遇到了这个问题。搜索按钮确实会触发 MPMoviePlaybackStateStopped 类型的 MPMoviePlayerPlaybackStateDidChangeNotification。因此,如果您想保留标准 UI 控件而不创建自定义控件,则可以侦听这种情况并进行适当处理。

Just ran into this in iOS 7. The seek buttons do fire the MPMoviePlayerPlaybackStateDidChangeNotification of type MPMoviePlaybackStateStopped. So you can listen for this case and handle it appropriately if you want to keep the standard UI controls without creating custom ones.

浅笑依然 2024-10-11 19:30:38

这是不好的办法...
只需 foreach 播放器视图的所有子视图并按索引关闭所需的按钮

[self listSubviewsOfView:playerVC.view andLevel: 0];



- (void)listSubviewsOfView:(UIView *)view andLevel: (NSInteger)level {

    NSArray *subviews = [view subviews];
    if ([subviews count] == 0) return;
    for (UIView *subview in subviews) {
       NSString *str = NSStringFromClass([subview class]);
       if(subview.hidden == NO){
          if([str isEqualToString:@"MPKnockoutButton"] && (level== 15 || level== 17) ){
               subview.hidden = YES;
          }
      }
     [self listSubviewsOfView:subview andLevel:level];
   }
}

This is bad way...
Just foreach all subviews of player view and turn off needed button by index

[self listSubviewsOfView:playerVC.view andLevel: 0];



- (void)listSubviewsOfView:(UIView *)view andLevel: (NSInteger)level {

    NSArray *subviews = [view subviews];
    if ([subviews count] == 0) return;
    for (UIView *subview in subviews) {
       NSString *str = NSStringFromClass([subview class]);
       if(subview.hidden == NO){
          if([str isEqualToString:@"MPKnockoutButton"] && (level== 15 || level== 17) ){
               subview.hidden = YES;
          }
      }
     [self listSubviewsOfView:subview andLevel:level];
   }
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文