开发者

How can i hide MPMoviePlayer controls?

开发者 https://www.devze.com 2022-12-10 11:41 出处:网络
i want put a movie at my application startingbut i want hide the movie controls like (stop , play , next and ... ) here is my code :

i want put a movie at my application starting but i want hide the movie controls like (stop , play , next and ... ) here is my code :

#import <MediaPlayer/MediaPlayer.h>



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


You could do IntroMovie.controlStyle = MPMovieControlStyleNone;

Since .movieControlMode was deprecated.


Ok, i figured it out.

Code:

IntroMovie.movieControlMode = MPMovieControlModeHidden;


In Objective-C

moviePlayer.controlStyle = MPMovieControlStyleNone;

In Swift

 moviePlayer.controlStyle = MPMovieControlStyle.None
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号