Embed youtube to ios 9

I have inserted youtube video in ios 8 many times using the following code (I am deliberately replacing the video code with ----). Videos no longer play after ios 9 upgrade (go to YouTube help page title "Video Player Error Message".

Does anyone know what has changed in iOS 9 and how to fix it?

NSString *EmbedCode = @"<iframe width=\"560\" height=\"315\" src=\"https://www.youtube.com/embed/-------\" frameborder=\"0\" allowfullscreen></iframe>";
[[self webviewer] loadHTMLString:EmbedCode baseURL:nil];

      

+3


source to share


2 answers


In iOS9, it's important to switch everything to HTTPS.

So, I faced the same problems as you. Some videos play, some videos do not play.

For more details see App Transport Security Technote for full details

(Source: WWDC 2015 Session 703, "Privacy and Your Application", 30:18)



You can also ignore all transport security restrictions with a single key:

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
</dict>

      

With the addition of a key, everything works. But I think this is only a temporary solution. You don't know when the apple starts to reject it.

I have filed the issue with Google as well.

+1


source


Had the same issue but in the last few days it started working on iOS 9 without any security exceptions. I think Google has brought their servers up to the required security levels.



0


source







All Articles