Manish Kumar
Manish Kumar

Reputation: 10492

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

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.

Upvotes: 7

Views: 22721

Answers (3)

user3255670
user3255670

Reputation:

@Manish,

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

Jesse

Upvotes: -1

user3255670
user3255670

Reputation:

@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

Upvotes: 0

chiragchavda.ks
chiragchavda.ks

Reputation: 530

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

Upvotes: -3

Related Questions