objective c - How to handle AVPlayer when device changes orientation? -


my app supports portrait orientation. have used avplayerviewcontroller in 1 screen. app has uinavigationviewcontroller , uitabbarviewcontroller. when device rotated landscape mode during video play, having hard time change frame?

how can achieve this? should change frame of avplayerview?

nsnumber *val = [nsnumber numberwithint:uiinterfaceorientationlandscapeleft]; [[uidevice currentdevice] setvalue:val forkey:@"orientation"]; 

or ask visible view controller :

- (uiinterfaceorientation)preferredinterfaceorientationforpresentation {     return self.currentviewcontroller.preferredinterfaceorientationforpresentation; }  - (bool)shouldautorotate {     return self.currentviewcontroller.shouldautorotate; } 

Comments

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -