YouTube html5player 无法在 iPad safari 上播放;协议和端口异常

YouTube html5player won't play on iPad safari; protocol and port exception

我只在 iPads 的 safari 上发生了一个奇怪的错误。我在页面中添加了一个 youtube iframe 元素,如下所示。

<iframe width="560" height="315" src="http://www.youtube.com/embed/dDAB35SYIr0?rel=0" frameborder="0" allowfullscreen></iframe>

如您所见,我说来源是http,我的站点也是http。现在在 iPad Safari 上我收到此控制台错误消息

Blocked a frame with origin "https://www.youtube.com" from accessing a frame with origin "http://example.com". The frame requesting access has a protocol of "https", the frame being accessed has a protocol of "http". Protocols must match.

我认为这很奇怪有两个原因 1.我特意说一下"use http" 2. 它适用于其他设备

现在,如果我将协议更改为 https(现在我也在 https 站点上)并尝试这样做,我就会收到此错误

Blocked a frame with origin "https://www.youtube.com" from accessing a frame with origin "https://www.example.com". Protocols, domains, and ports must match.

所有错误都引用 html5player.js 文件。

我该如何解决这个问题? 感谢您的帮助

好的,看来 IPad 上的 webkit 有一个错误,一个奇怪的错误。我在这里阅读 -> https://tmpworldwide.github.io/bugs/ios-tappy-bug.html

我会引用一点

Applying the :active pseudo-class to a universal selector (*) and including a property of -webkit-tap-highlight-color seems to be the culprit.

*:active { -webkit-tap-highlight-color: tomato; }

Now, here is the strange part. The bug is only triggered when the above CSS block is present and there is an input element present on the page with a type attribute value of "search". I know, crazy, right? Another oddity here is that when you apply focus to the search input, type something in, and then attempt to play video, it will then work.

目前的解决办法是将input type="search"改为input type="text"。