Youtube Fails on device, works on Simulator
<p>I'm using following code to display youtube videos:</p>

<pre><code>webViewVideo.hidden = false

webViewVideo.allowsInlineMediaPlayback = true
webViewVideo.mediaPlaybackRequiresUserAction = false

let youtubeIfarme = "&lt;html&gt;&lt;body&gt;&lt;iframe src=\"http://www.youtube.com/embed/\(youtubeId)?playsinline=1\" width=\"\(CGRectGetWidth(loadedView.frame) - CGFloat(16))\" height=\"\(CGRectGetHeight(webViewVideo.frame))\" frameborder=\"0\" allowfullscreen&gt;&lt;/iframe&gt;&lt;/body&gt;&lt;/html&gt;"

webViewVideo.loadHTMLString(youtubeIfarme, baseURL: NSBundle.mainBundle().bundleURL)
</code></pre>

<p>Which code works perfectly fine on simulator, however on real device it fails to load. I defined following as app transport security:</p>

<p><a href="http://prntscr.com/ah4xod" rel="nofollow">transport security</a></p>

<p>Strange thing is that I downloaded <a href="https://developers.google.com/youtube/v3/guides/ios_youtube_helper" rel="nofollow">iOS Helper library</a> but the result is the same. Moreover delegate methods are never called. On their github page they have a lot of opened issues so I guess that won't be my best choice to use.</p>

<p>Any help will be highly appreciated.</p>

<p>EDIT</p>

<p>I managed to debug how my html page looks inside UIWebView on simulator(by connecting it through Safari Develop):</p>

<pre><code>&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;iframe src="http://www.youtube.com/embed/KIiUqfxFttM?playsinline=1" width="359.0" height="350.0" frameborder="0" allowfullscreen=""&gt;&lt;/iframe&gt;&lt;/body&gt;&lt;/html&gt;
</code></pre>