我需要在应用程序启动时播放视频
我的代码非常适合 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---
}
}