Our iOS app presenting a YouTube video within a WKWebView is no longer playing inline on loading. The video now starts in Full Screen and the whilst the user can manually make it inline, the previous behaviour was for it to start playing inline. This changed sometime between iOS 10 beta 2 and beta 5, and this happens on a device running iOS 10 beta 5 (an iPhone 6), but works fine as before on an iOS simulator (launched from XCode 8 beta 5). The official YouTube helper app, shows this incorrect behaviour: https://github.com/youtube/youtube-ios-player-helper The problem may well lie in how the YouTube script creates their <video> element, and how they are using webkit-playsonline & playsonline. Another developer has raised this with Google (https://code.google.com/p/gdata-issues/issues/detail?id=8487) and myself on SO (http://stackoverflow.com/questions/38879065/why-dont-youtube-videos-play-inline-in-ios-10-beta-5/38885359#38885359), but no response. We appreciate it may be on YouTube to fix this, but with no quick response we're worried that iOS 10 will be released and it will have significant impact on the UI, and I imagine a lot of apps will be affected by this. I am hoping this can be resolved by either the Webkit or the YouTube team.
playsinline is the future. webkit-playsinline is deprecated.
https://trac.webkit.org/changeset/203752/trunk/Source/WebCore/html/MediaElementSession.cpp is the change which changes the policy.
https://webkit.org/blog/6784/new-video-policies-for-ios/
Thanks. Do you have any contacts in YouTube you could let know about this?
Yes, we will discuss this with them.
Thank you - it appears to have just been resolved.