I am wanting to update an app that plays a video embedded in the app so that it can be played via airPlay to a new Apple TV. I have this:
When I run the app, I see the airPlay icon and a list of my iPad and Apple TV, but when I select one, only audio. Any ideas?
Code:
- (IBAction)history {NSBundle *bundle = [NSBundle mainBundle];
NSString *moviePath = [bundle pathForResource:@"restorationvoice" ofType:@"m4v"];
NSURL *movieURL = [[NSURL fileURLWithPath:moviePath] retain];
MPMoviePlayerController *theMovie = [[MPMoviePlayerController alloc] initWithContentURL:movieURL];
theMovie.scalingMode = MPMovieScalingModeAspectFill;
theMovie.allowsAirPlay = YES;
[theMovie play];
MPMoviePlayerViewController *moviePlayer = [[MPMoviePlayerViewController alloc] initWithContentURL:movieURL];
[self presentMoviePlayerViewControllerAnimated:moviePlayer];
}