title: iOS7 Embedded YouTube Video Issue on iPad Only - Need to press play multiple times
body: <p>I'm in the process of updating an iPad app to be compatible with iOS7. The app plays YouTube video clips which are embedded within UIWebViews which in turn are embedded within tableview cells. When the web view loads, it shows the standard preview image of the video with the red play button. If you click the play button the standard YouTube activity indicator appears and then the play and full screen buttons appear in a bar at the bottom of the view. However the video does not start and the activity indicator continues to show. In all previous version of iOS my code would start playing the video at this point.</p>
  
  <p>I've found that if I press play using the play button that appears in the bottom toolbar twice, the video does start to play. Also if I use the full screen button to go to full screen mode I still need to press the play button twice before the video will begin playing.</p>
  
  <p>Here's the code -</p>
  
  <pre><code>NSString *embedHTML = @"&lt;!doctype html&gt;\
  &lt;html&gt;\
  &lt;style&gt;body{padding:0;margin:0;}&lt;/style&gt;\
  &lt;iframe width=\"165\" height=\"100\" src=\"http://www.youtube.com/embed/82HguWNEhZU?rel=0\" frameborder=\"0\" &amp;showinfo=0 allowfullscreen&gt;&lt;/iframe&gt;\
  &lt;/html&gt;";
  [webView loadHTMLString:embedHTML baseURL:nil];
  </code></pre>
  
  <p>I've also tried the following but get the same result -</p>
  
  <pre><code>NSSString *embedHTML = @"\
  &lt;html&gt;&lt;head&gt;\
  &lt;style type=\"text/css\"&gt;\
  body {\
  background-color: transparent;\
  color: white;\
  }\
  &lt;/style&gt;\
  &lt;/head&gt;&lt;body style=\"margin:0\"&gt;\
  &lt;embed id=\"yt\" src=\"http://www.youtube.com/v/82HguWNEhZU\" type=\"application/x-shockwave-flash\" \
  width=\"165\" height=\"100\"&gt;&lt;/embed&gt;\
  &lt;/body&gt;&lt;/html&gt;";
  [webView loadHTMLString:embedHTML baseURL:nil];
  </code></pre>
  
  <p>Interestingly, I use the same code on the iPhone and it works as expected. The only difference being that on the iPhone it automatically jumps to full screen mode.</p>
  
  <p>Is anyone else having the same issue or know a way around this?</p>
  
  <p>Any help would be much appreciated</p>
  
  <p>Thanks</p>
  
  <p>Jon</p>