2011-05-16 45 views
0

我正在構建一個簡單的&基本視頻應用程序使用媒體播放器框架。在mediaplayer框架隱藏控制覆蓋,sdk4 iphone xcode

如何隱藏SDK4中的播放器控件疊加層,xcode,以便用戶無權訪問play,pause,ff,rw等?

我已經實現的代碼根本不起作用,要麼給出錯誤,要麼什麼也不做。
我很困惑,一直未能通過研究找到支持。之後我還需要處理內存泄漏。

我已經試過:

-(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]; 
} 

回答

0

嘗試

yourPlayer.controlStyle = MPMovieControlStyleNone;

,改變yourPlayer你的球員的名字。

4
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;