I am trying to create UIViewControllerwith some shortcuts and a movie in the middle of the screen. I use for a movie AVPlayerViewController, but whenever I click on its full-screen button, I get a few warnings about restrictions, even if I create code AVPlayerViewControllerfrom the code, use CGRectto determine its boundaries or insert it into the ContainerView using the storyboard.
This is the code I use when I do not rely on the storyboard:
NSString *path = [[NSBundle mainBundle] pathForResource:@"video_1" ofType:@"3gp"];
NSURL *movieURL = [NSURL fileURLWithPath:path];
AVPlayer *player = [AVPlayer playerWithURL:movieURL];
AVPlayerViewController *playerViewController = [AVPlayerViewController new];
playerViewController.player = player;
[self addChildViewController:playerViewController];
[self.view addSubview:playerViewController.view];
playerViewController.view.frame = CGRectMake(100, 100, 640, 480);
[player play];
Does anyone know how to fix restriction problems?
thanks
source
share