Hi,
I'm trying to get a video to play in my app. I've googled this and followed quite a few tutorial, to no success. I'm just met with a blank dark screen. Here is my code:
moviePlayer is a variable I declared in my .h file.
Is there something wrong with my code? The video is a screen recording from Quicktime X with the resolution set to match that of the iPad.
I'm trying to get a video to play in my app. I've googled this and followed quite a few tutorial, to no success. I'm just met with a blank dark screen. Here is my code:
Code:
NSString *resourcePath = [[NSBundle mainBundle] pathForResource:@"recording5" ofType:@"mov"];
self.moviePlayer = [[MPMoviePlayerController alloc]initWithContentURL:[NSURL URLWithString:resourcePath]];
[self.moviePlayer.view setFrame:self.view.bounds];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayBackDidFinish) name:MPMoviePlayerPlaybackDidFinishNotification object:self.moviePlayer];
self.moviePlayer.controlStyle = MPMovieControlModeDefault;
self.moviePlayer.shouldAutoplay = YES;
[self.view addSubview:moviePlayer.view];
[self.moviePlayer setFullscreen:YES animated:YES];
moviePlayer is a variable I declared in my .h file.
Is there something wrong with my code? The video is a screen recording from Quicktime X with the resolution set to match that of the iPad.
Last edited: