アプリケーションの起動時にビデオを再生する必要がある
私のコードは Iphone Ipad Simulator で完全に動作します
しかし、デバイス上では物理的に Ipad ではありません
どうしたの??
- (void)viewDidLoad
{
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
NSURL* url = [[NSBundle mainBundle] URLForResource:@"Intro3" withExtension:@"mp4"];
m_player = [[MPMoviePlayerController alloc] initWithContentURL:url];
[m_player.backgroundView setBackgroundColor:[UIColor blackColor]];
[m_player.view setBackgroundColor:[UIColor blackColor]];
[m_player setControlStyle:MPMovieControlStyleNone];
[[m_player view] setFrame:[self.view bounds]];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayBackDidFinish:) name:MPMoviePlayerPlaybackDidFinishNotification object:nil];
[m_player play];
[self.view addSubview:[m_player view]];
}
else{
---play video in iphone---
}
}