I am building a simple & basic video app using the media player framework.
How do I hide the player control overlay in SDK4, xcode so that the user does not have access to play, pause, ff, rw, etc.?
The codes I have implemented simply do not work and either give errors or do nothing at all.
I am stumped and have not been able to find support via research. I also need to take care of a memory leak l开发者_开发问答ater.I've tried:
-(IBAction)playMovie:(id)sender
{
NSString *filepath = [[NSBundle mainBundle] pathForResource:@"1960" ofType:@"m4v"];
NSURL *fileURL = [NSURL fileURLWithPath:filepath];
MPMoviePlayerController *moviePlayerController = [[MPMoviePlayerController alloc] initWithContentURL:fileURL];
[self.view addSubview:moviePlayerController.view];
moviePlayerController.fullscreen = YES;
moviePlayerController.scalingMode = MPMovieScalingModeAspectFill;
[moviePlayerController play];
}
NSString *filepath = [[NSBundle mainBundle] pathForResource:@"Video1" ofType:@"mp4"];
NSURL *fileURL = [NSURL fileURLWithPath:filepath];
moviePlayerController = [[MPMoviePlayerController alloc] initWithContentURL:fileURL];
[moviePlayerController.view setFrame:CGRectMake(38, 100, 250, 163)];
moviePlayerController.controlStyle=MPMovieControlStyleNone;
try
yourPlayer.controlStyle = MPMovieControlStyleNone;
and change yourPlayer to your name of the player.
精彩评论