I am using MPMoviePlayerController in Ipad application. Video is not showing but audio comes, same code working well for Iphone
NSBundle *bundle = [NSBundle mainBundle];
NSString *moviePath = [bundle pathForResource:@"video" ofType:@"mp4"];
movieURL = [NSURL fileURLWithPath:moviePath];
MPMoviePlayerController *IntroMovie = [[MPMoviePlayerController alloc] initWithContentURL:movieURL];
[IntroMovie play];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(moviePlaybackDidFinish:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:nil];
Please suggest me
Thanks 开发者_JAVA百科Miraaj
You must add the movie view to an existing view like this within view controller for sample:
[self.view addSubview:IntroMovie.view]
Is your iPad application a separate target from the iPhone application?
If so, did you remember to add the video to the resources copied into the iPad-application bundle?
If you didn't, drag it into the “Copy Bundle Resources” build phase within the iPad-application target.
In the new SDK you need to use a MPMoviePlayerViewController to present the video, not just a MPMoviePlayerController:
iPhone Dev Center
精彩评论