Note that there are some explanatory texts on larger screens.

plurals
  1. POChange Orientation back to Portrait
    primarykey
    data
    text
    <p>When using my app users can click and watch videos displayed in a list. Once they click on that video they can change the orientation to either portrait or landscape. The list page is only portrait.</p> <p>The error I am facing is when the user watch's a video in landscape and exits the page in landscape my list page become all messed up.</p> <p>I need a way to turn the orientation back to portrait every time the user presses done on the video and returns back to the list. </p> <p>On the list page I do have</p> <pre><code>- (BOOL)shouldAutorotate{ return YES; } </code></pre> <p>And I even tried to call <code>shouldAutorotate</code> method in the viewDidAppear but that doesn't work. I know that <code>shouldAutorotate</code> is not being called after the page is loaded so is there a way to check the orientation then flip it or just make it portrait no matter what?</p> <p>I still need landscape so I am not going to remove it from my plist file.</p> <p>Any help would be great. Thanks</p> <p>EDIT</p> <p>Here is how I call my video player</p> <pre><code> MPMoviePlayerViewController *player=[[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL URLWithString:[[main_data objectAtIndex:indexPath.row] objectForKey:@"url"]]]; UIView * playerView = [player view]; [playerView setFrame: CGRectMake(0, 0, 480, 320)]; CGAffineTransform landscapeTransform; landscapeTransform = CGAffineTransformMakeRotation(90*M_PI/180.0f); landscapeTransform = CGAffineTransformTranslate(landscapeTransform, 80, 80); [playerView setTransform: landscapeTransform]; [self presentMoviePlayerViewControllerAnimated:player]; return; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload