title: How to detect if UIWebview is currently using the built-in media player?
body: <p>I have a <code>UIWebView</code> on screen, which automatically redraws when the device is rotated. I don't want it to redraw if the user has invoked a video from the web before rotating because redrawing cancels the video playback (although audio continues).</p>
  
  <p>None of the following helped:</p>
  
  <ul>
  <li><code>UIWebView</code> is not hidden by <code>MPMoviePlayer</code> instance</li>
  <li>Media playback does not invoke <code>viewWillAppear</code>, <code>viewDidAppear</code>, <code>viewWillDisappear</code>, or <code>viewDidDisappear</code>.</li>
  <li><code>self.view.window</code> doesn't change, doesn't get any new subviews</li>
  <li><code>UIWebview</code> does not get any additional subviews</li>
  <li>the <code>UIWebView</code> does not get any new subviews or change any <code>isBlahBlah</code> properties</li>
  <li><code>[UIApplication sharedApplication]</code> only has 1 window, and that window only has 1 view (my main view). </li>
  <li>I tried the notification center thing (<a href="https://stackoverflow.com/questions/6404480/notified-when-media-player-opens-from-uiwebview">Notified when media player opens from UIWebView?</a>) and did not receive notifications.</li>
  </ul>
  
  <p>For reference, the video path I am testing with is <a href="http://trailers.apple.com/movies/fox/prometheus/prometheus-tlr1_r320i.mov" rel="nofollow noreferrer">http://trailers.apple.com/movies/fox/prometheus/prometheus-tlr1_r320i.mov</a></p>
  
  <p>So basically my app has no way to detect that a video is currently playing. It seems like I should be able to detect, but searching around I couldn't find one. I don't need to interfere with the playback - just knowing it is playing would be fine.</p>