I use autorun, and on the screen I create an AVPlayerViewController with half the size of the main view. I use UITabBarViewController and UINavigationController. This screen moves from the first child ViewController to the UITabBarViewController. The code is as follows.
avPlayerVideoController = [[AVPlayerViewController alloc] init];
avPlayer = [AVPlayer playerWithURL:[NSURL URLWithString:videoURL]];
avPlayerVideoController.view.frame = CGRectMake( imgViewVideo.frame.origin.x, imgViewVideo.frame.origin.y, imgViewVideo.frame.size.width, imgViewVideo.frame.size.height);
avPlayerVideoController.delegate = self;
avPlayerVideoController.showsPlaybackControls = YES;
avPlayerVideoController.player = avPlayer;
[avPlayerVideoController.player play];
Now I want the video to be rotated in landscape mode when I click on this full-screen button with AVPlayerViewController. He just stays in portrait orientation, even I rotate my phone. And also there is no delegate method when clicking on the full screen button. Please, I need this badly. Explain in detail how I should achieve this. thank you