Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hide the MPmoviePlayerController's control bar

How to hide the MPmoviePlayerController's control bar.

I just want to make the movie get a fullscreen and have nothing on it.

NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:dataPath ofType:@""]];
        moviePlayerController = [[MPMoviePlayerController alloc] initWithContentURL:url];
        [[NSNotificationCenter defaultCenter] addObserver:self
                                                 selector:@selector(moviePlaybackComplete:)
                                                     name:MPMoviePlayerPlaybackDidFinishNotification
                                                   object:moviePlayerController];  

        [self.view addSubview:moviePlayerController.view];
        [moviePlayerController.view setFrame:CGRectMake(0, 0, 1024, 768)];
        moviePlayerController.fullscreen = YES;
        if ([moviePlayerController respondsToSelector:@selector(setAllowsAirPlay:)])    
            //Allow airplay ifavailabe
        [moviePlayerController setAllowsAirPlay:YES];

        [moviePlayerController play];
like image 576
user1088940 Avatar asked Dec 10 '22 02:12

user1088940


1 Answers

moviePlayerController.controlStyle = MPMovieControlStyleNone;
like image 80
beryllium Avatar answered Dec 21 '22 04:12

beryllium