2
votes

I used iframe API like this

<iframe id="youtubePlayer" type="text/html" width="100%" height="auto" src="http://www.youtube.com/embed/someid?enablejsapi=1&origin=http://myurl.com" frameborder="0"></iframe>

Notice that I have changed src to http and added origin, but still I got the following error:

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

The problem only occurs in Safari. I did some debug and it seems like a Sf() only gets called in Safari in www-embed.js.

Thanks!

1
Did you try using https instead of http?noogui
@noogui My site is using http and just for this to move my whole site to https is too much of a overhead. Also one thing I don't understand is that why iframe is trying to access my site(parent) and why that only happens in Safari.ydydyd
Your error says you need to use httpsnoogui
@noogui Yes but I am looking for an answer why youtube iframe is trying to access my site.ydydyd

1 Answers

2
votes

It looks like a Safari implementation on iFrame has defect. On Safari, YouTube iFrame API official page is giving the same error messages. So currently there is no way to circumvent this situation, until Safari fixes this.