0
タイトル/スプラッシュ画面用の小さなムービーを読み込もうとしています。しかし、presentMoviePlayerViewControllerAnimated
と呼ぶと何も起こりません。コードブロックが実行されていることを確認しましたが、ユーザーには何も認識されません。MPMoviePlayerViewControllerが表示されない
私は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];
}