Blocked a frame with origin "https://www.youtube.com" from accessing a frame with origin "file://"
Asked Answered
R

3

7

I have a URL for youtube :

<iframe class="embed-responsive-item" ng-src="https://www.youtube.com/embed/s7gJ74ARN84" allowfullscreen=""></iframe>

If i use this in my local html file it plays well. But when i paste the same in a phonegap ios app html page and run that in ios simulator it shows below error just as i click the video:

Blocked a frame with origin "https://www.youtube.com" from accessing a frame with origin "file://".  

The frame requesting access has a protocol of "https", the frame being accessed has a protocol of "file". Protocols must match.

Solution:

It was not working in simulator but working in mobile and that was my ultimate goal.

Ruggiero answered 18/5, 2015 at 11:42 Comment(1)
Were you able to fix it ?Irritability
H
0

@Manish, since you have already dealt with the CORS issue, the error your a getting says:

The frame requesting access has a protocol of "https", the frame being accessed has a protocol of "file". Protocols must match.

Since it is not CORS, have you gotten rid of the iframe? If that works, perhaps what you need is a hidden <div>.

Jesse

Hackle answered 19/5, 2015 at 3:55 Comment(1)
i didn't get your point can u pls give example reference to my youtube videoRuggiero
H
-1

@Manish,

it appears you have the CORS problem. You can can add to your config.xml <access origin="*"/>.

Jesse

Hackle answered 19/5, 2015 at 3:27 Comment(1)
this does not seem to help (at least in iOS 9.3, cordova 6.4.0, cordova-plugin-whitelist 1.3.0)Imagination
R
-3

Hey this just a very Small Problem

your link is this => "https://www.youtube.com/embed/s7gJ74ARN84"

But you just have to change it to

this link "//www.youtube.com/embed/s7gJ74ARN84"

Remember when you try to load secure content in your site just remove protocol from link

Repugn answered 21/5, 2015 at 5:2 Comment(6)
tried this <iframe width="854" height="510" src="//www.youtube.com/embed/bAQq2mENhR4" frameborder="0" allowfullscreen></iframe> and got this error Failed to load resource: The requested URL was not found on this server. file://www.youtube.com/embed/bAQq2mENhR4Ruggiero
in jsfiddle even <iframe width="854" height="510" src="http://www.youtube.com/embed/bAQq2mENhR4" frameborder="0" allowfullscreen></iframe> working fineRuggiero
try this link it seem to be useful #7586143 + developers.google.com/youtube/iframe_api_referenceRepugn
Problem was that in IOS simulator it was not running but in mobile its running and that is my ultimate target :)Ruggiero
Glad you worked it out...if you changed any settings please post the solutionRepugn
Doesn't that occur because it automatically matches the protocol? So //url.com would befile://url.com if the original page is file://index.htmlPhilharmonic

© 2022 - 2024 — McMap. All rights reserved.