title: Autorotating video played from HTML5 <video> in UIWebView
body: <p>My app, for some reasons, only supports portrait orientation.<br>
  However, in some cases I need to display videos from a UIWebView (with <code>video</code> tag) and it would be nice if the user can view it either in portrait or landscape.</p>
  
  <p>The controller is configured like this:</p>
  
  <pre><code>- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
      return UIInterfaceOrientationIsPortrait(toInterfaceOrientation);
  }
  </code></pre>
  
  <p><em>Result</em>: the video is played only in portrait mode (ok, quite expected).</p>
  
  <p>I tried:<br>
  - setting this to support all orientations when the user starts a video<br>
  - when the video stops, back to "portrait only"</p>
  
  <pre><code>- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
      // autorotationEnabled is toggled when a video is played / stopped
      return autorotationEnabled ? YES : UIInterfaceOrientationIsPortrait(toInterfaceOrientation);
  }
  </code></pre>
  
  <p><em>Result</em>: landscape mode is available (great!) but if the user taps 'Done' while playing in landscape, the previous view will appear in landscape mode once the player is dismissed (not so great).</p>
  
  <p>Does anybody have an idea on how to prevent the controller from being displayed in landscape mode when the player is dismissed?<br>
  (using the private method setInterfaceOrientation of UIDevice is not an option)</p>