3
這是我使用MPMoviePlayerController加載視頻的代碼,我的問題是我可以聽到視頻的聲音,但看不到視頻。任何人都可以給我解決方案!如何在iphone中使用MPMoviePlayerController播放視頻?
注:此消息「非零客戶端計數AddRunningClient起動裝置」是顯示屏,而我在控制檯
運行我的應用程序現在我正在IOS4.1 SDK
- (void)viewDidLoad {
[super viewDidLoad];
NSString *mediaPath = [[[NSBundle mainBundle]resourcePath] stringByAppendingPathComponent:@"understandingoilcost_1500kbps.mov"];
MPMoviePlayerController *moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:mediaPath]];
moviePlayer.scalingMode = MPMovieScalingModeAspectFit;
[moviePlayer play];
}
請幫助我出去了!
謝謝。
hai thanx快速回復我試過你的代碼,但NSLog(@「loadView」)連續不斷地在控制檯中打印。還有[self addSubView:[moviePlayer view]];是不支持在我的SDK – Sri 2010-10-13 11:10:42
請參閱我的答案的編輯版本...我錯過了這裏面的UIViewController而不是UIView。 – DarkDust 2010-10-13 11:13:02
hai謝謝,但在控制檯2010-10-13 17:23:12.585視頻[1714:207] loadView 2010-10-13 17:23:12.592視頻[1714:207] loadView 2010-10-13 17: 23:12.601視頻[1714:207] loadView將連續顯示,無需啓動應用程序 – Sri 2010-10-13 11:54:17