我正在使用自動佈局,並在屏幕上創建AVPlayerViewController與主視圖的一半大小。我正在使用UITabBarViewController和UINavigationController。該屏幕從UITabBarViewController的第一個子ViewController導航。代碼是這樣的..如何使用AVPlayerViewController以橫向方向旋轉屏幕?
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];
現在我希望視頻在橫向視圖旋轉,當我點擊即全屏按鈕帶有AVPlayerViewController。即使我旋轉手機,它仍然保持縱向。當全屏按鈕被點擊時,也沒有調用委託方法。請我非常需要這個。詳細解釋我應該如何實現這一點。謝謝
您是否找到解決方案? – karthikeyan
我也面臨同樣的問題,你找到一個解決方案? – FelipeOliveira