現在我想知道關於MPMoviePlaybackController的3.X和4之間的區別以及需要設置視圖並使其在子視圖控制器中充分工作的需要。但是,儘管下面的代碼看起來是正確的(對我來說),但我仍然只是在電影期間得到一個空白屏幕。我知道它作爲moviePlayBackDidFinish成功播放。如何在iOS4上顯示來自AppDelegate的視頻
我現在需要將它添加到模態或類似的位置嗎?
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:filePath]];
player.fullscreen = YES;
player.controlStyle = MPMovieControlStyleNone;
[[player view] setFrame:window.bounds];
[window addSubview: [player view]];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(moviePlayBackDidFinish:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:player];
}
我試過了,沒有設置全屏和控制樣式 – 2010-07-19 15:52:10