为什么 YouTube 视频不能在 iOS 10 beta 5 中内联播放?

Why don't YouTube videos play inline in iOS 10 beta 5?

我发现在最新的 iOS 10 beta 5 中,YouTube 视频无法在设备上内联播放(我的 iPhone 6),但可以在模拟器上播放。

我相信这是从早期的 iOS 测试版改变而来的新行为。

视频可以播放,但全屏显示。例如,使用 YouTube 帮助程序库,调用

[self.playerView loadWithVideoId:@"M7lc1UVf-VE" playerVars:@{ @"playsinline" : @(1) }];

关于如何让视频再次内联播放有什么想法吗?

好吧,我最终不得不通过 youtube 提交一个错误,你可以找到 here. The problem is that, according to the official webkit blog。他们弃用了 return 由 playsinline 编辑的 'webkit-playsinline' 嵌入到 iframe 中的属性。相反,在 beta 2 之后,他们现在正在使用 youtube 尚未添加的 'playsinline'。没有这个 属性 在 iF​​rame 中被 youtube return 编辑。他们最好的你可以期望的是查看器最初将全屏显示并允许用户在播放时 return 到其正常的内联大小。这是博客的摘录。

A note about the playsinline attribute: this attribute has recently been added to the HTML specification, and WebKit has adopted this new attribute by unprefixing its legacy webkit-playsinline attribute. This legacy attribute has been supported since iPhoneOS 4.0, and accordance with our updated unprefixing policy, we’re pleased to have been able to unprefix webkit-playsinline. Unfortunately, this change did not make the cut-off for iOS 10 Developer Seed 2. If you would like to experiment with this new policy with iOS Developer Seed 2, the prefixed attribute will work, but we would encourage you to transition to the unprefixed attribute when support for it is available in a future seed.

编辑:此问题已于 2016 年 8 月 25 日修复!万岁!

这是 WebKit 源中的相关更改:https://trac.webkit.org/changeset/203752/trunk/Source/WebCore/html/MediaElementSession.cpp