Some issue with MPMoviePlayerController using ipad in application

I am using MPMoviePlayerController in an iPad application. The video does not appear, but the sound comes, the same code works well for the 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 offer me

Thanks Miraaj

+4
source share
3 answers

You should add a movie view to an existing view similar to this in the view controller for the sample:

[self.view addSubview: IntroMovie.view]

+3
source

Is your iPad app a separate target from the iPhone app?

If so, don’t remember to add videos to resources copied to the iPad package?

If you haven’t done so, drag it into the “Copy Bundle Resources” build phase in the target application of the iPad application.

+1
source

In the new SDK, you need to use MPMoviePlayerViewController to represent the video, not just MPMoviePlayerController:

IPhone Dev Center

+1
source

Source: https://habr.com/ru/post/1305870/


All Articles