【问题标题】:How can i hide MPMoviePlayer controls?如何隐藏 MPMoviePlayer 控件?
【发布时间】:2009-11-02 10:34:23
【问题描述】:

我想在我的应用程序开始时放一部电影,但我想隐藏电影控件,例如(停止、播放、下一个和...)这是我的代码:

#import <MediaPlayer/MediaPlayer.h>



-(void)viewDidLoad
{
     NSBundle *bundle = [NSBundle mainBundle];
     NSString *moviePath = [bundle pathForResource:@"myvideo" ofType:@"mp4"];
     NSURL *movieURL = [[NSURL fileURLWithPath:moviePath] retain];
     MPMoviePlayerController *IntroMovie = [[MPMoviePlayerController alloc] initWithContentURL:movieURL];
     [IntroMovie play];
}

【问题讨论】:

    标签: mpmovieplayer


    【解决方案1】:

    你可以做IntroMovie.controlStyle = MPMovieControlStyleNone;

    因为 .movi​​eControlMode 已被弃用。

    【讨论】:

      【解决方案2】:

      好的,我想通了。

      代码:

      IntroMovie.movieControlMode = MPMovieControlModeHidden;
      

      【讨论】:

        【解决方案3】:

        在 Objective-C 中

        moviePlayer.controlStyle = MPMovieControlStyleNone;
        

        在 Swift 中

         moviePlayer.controlStyle = MPMovieControlStyle.None
        

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 2014-09-18
          • 2021-11-08
          • 2018-12-29
          • 2011-08-07
          • 1970-01-01
          • 1970-01-01
          • 2011-12-10
          相关资源
          最近更新 更多