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
Post a Comment