title: Detecting UIWebView finish to play youtube video on iPad
body: <p>I'm using <code>UIWebView</code> to play YouTube videos in an iPad.</p>
  
  <p>How can I detect when a YouTube video is finished playing? 
  I see the play icon in the status bar and I tried to use <code>MPMusicPlayerController</code> notifications to detect <code>playbackStateDidChange</code>, but it didn't work.</p>
  
  <p>Any ideas how to detect this event? Again, I'm talking about iPad not iPhone.</p>
  
  <p>Thanks in advance.</p>
  
  <p><strong>Update:</strong> </p>
  
  <p>If you use zero solution to detect the end of playing and also want the Youtube video to start automatically set the <code>UIWebView</code> to :</p>
  
  <pre><code>self.webView.mediaPlaybackRequiresUserAction = NO ;
  </code></pre>
  
  <p>I just want to clarify about the YouTube frame API:</p>
  
  <blockquote>
    <p>"Important: This is an experimental feature, which means that it might
    change unexpectedly" (08/05/2012)</p>
  </blockquote>