title: UIWebView youtube iframe api autoplay/playsinline quit working in iOS7
body: <p>This code has worked really well to auto-play video inline in an iOS 6 uiwebview. However, I upgraded to iOS 7 and now my video will not auto-play. Sometimes video will auto-play and sometimes it won't. It will auto-play about 10% of the time. Most of the time I get a spinning wheel. If I remove &amp;playsinline=1 from the src tag it will auto-play fullscreen (not what I want). I spent a lot of time creating a custom player for this app and now it won't work correctly. Any help is greatly appreciated.</p>
  
  <pre><code>_youTubeWebView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 20, 320, 184)];
  _youTubeWebView.delegate = self;
  _youTubeWebView.scrollView.bounces = NO;
  _youTubeWebView.allowsInlineMediaPlayback = YES;
  _youTubeWebView.mediaPlaybackAllowsAirPlay = YES;
  _youTubeWebView.mediaPlaybackRequiresUserAction = NO;
  [self.view addSubview:_youTubeWebView];
  
   NSString* embedHTML = [NSString stringWithFormat:@"&lt;html&gt;&lt;body style='margin:0px;padding:0px;'&gt;&lt;script type='text/javascript' src='http://www.youtube.com/iframe_api'&gt;&lt;/script&gt;&lt;script type='text/javascript'&gt;function onYouTubeIframeAPIReady(){ytplayer=new YT.Player('playerId',{events:{onReady:onPlayerReady}})}function onPlayerReady(a){ a.target.playVideo(); }&lt;/script&gt;&lt;iframe id='playerId' type='text/html' width='%@' height='%@'src='http://www.youtube.com/embed/%@?enablejsapi=1&amp;rel=0&amp;playsinline=1&amp;controls=0&amp;showinfo=0' frameborder='0'&gt;&lt;/body&gt;&lt;/html&gt;", w, h, videoId];
   [_youTubeWebView loadHTMLString:embedHTML baseURL:nil];
  </code></pre>
  
  <p>Here's a link to a quick test file. <a href="http://s3.amazonaws.com/m21m-dev/videoPlayerTest.zip">videoPlayerTest.zip</a></p>