タイトル/スプラッシュ画面用の小さなムービーを読み込もうとしています。ただし、呼び出してpresentMoviePlayerViewControllerAnimated
も何も起こりません。コードのブロックが実行されていることを確認しましたが、ユーザーが認識できるものは何もありません。
iPad を対象としているため、3.2 を想定しています。
どんな助けでも大歓迎です。
- (void)viewDidLoad {
[super viewDidLoad];
NSString *path = [[NSBundle mainBundle] pathForResource:@"Intro" ofType:@"m4v" inDirectory:nil];
NSURL *fileURL = [NSURL fileURLWithPath:path];
MPMoviePlayerViewController *playerView = [[MPMoviePlayerViewController alloc] initWithContentURL:fileURL];
[[NSNotificationCenter defaultCenter] addObserver:self selector: @selector(playbackDidFinish:) name:MPMoviePlayerPlaybackDidFinishNotification object:playerView.moviePlayer];
[self presentMoviePlayerViewControllerAnimated:playerView];
[playerView release];
}
- (void)playbackDidFinish:(NSNotification*)aNotification {
MPMoviePlayerController *player = [aNotification object];
[[NSNotificationCenter defaultCenter] removeObserver:self
name:MPMoviePlayerPlaybackDidFinishNotification
object:player];
[player stop];
[self dismissMoviePlayerViewControllerAnimated];
}