Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to execute 'postMessage' on 'DOMWindow' #29

Open
mardonedias opened this issue Sep 8, 2017 · 8 comments
Open

Failed to execute 'postMessage' on 'DOMWindow' #29

mardonedias opened this issue Sep 8, 2017 · 8 comments

Comments

@mardonedias
Copy link

vue-youtube-embed version 2.1.2

The video loads normally, but the console displays the following message:
Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://www.youtube.com') does not match the recipient window's origin ('http://ibutapp-mardonedias.c9users.io:8081').]

Thank you very much in advance.

@kaorun343
Copy link
Owner

Could you try the way that described in this page?
brandly/angular-youtube-embed#116
If that way solves this issue, I'll update this library.

@Christilut
Copy link

Christilut commented Oct 9, 2017

Same problem here

Setting this seems to fix it:

      this$1.player = new YouTube.Player(this$1.elementId, {
        height: playerHeight,
        width: playerWidth,
        playerVars: playerVars,
        videoId: videoId,
        host: 'https://www.youtube.com',

@rafalowski
Copy link

The problem is target and origin must be https

kaorun343 added a commit that referenced this issue Jun 15, 2018
@insane-kaos
Copy link

insane-kaos commented Jun 25, 2018

I have the same problem. How could I solve it ?, the video loads perfectly but in the console it presents the following message (Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://www.youtube.com') does not match the recipient window's origin ( 'http://localhost:8080')).

I already added (host: 'https://www.youtube.com',) in the file (vue-youtube-embed.js) but it still does not work, please excuse my ignorance and my bad English,

@sandy2609
Copy link

My website is configured without the www and the youtube link was with www that's why i was getting this error.
Try to make it similar, I removed www from my youtube, and it works.

@terrymun
Copy link

terrymun commented Sep 7, 2018

@Christilut A little late to the party, but after scouring the web for solution yours is the only one that worked. Sadly the host property does not seem to be in the official documentation: I will make a PR to their @types/youtube library for that.

@snaix93
Copy link

snaix93 commented May 23, 2019

 this$1.player = new YouTube.Player(this$1.elementId, {
        height: playerHeight,
        width: playerWidth,
        playerVars: playerVars,
        videoId: videoId,
        host: 'https://www.youtube.com',

Where to add this settings? I am using Vue.js in combination with Laravel

@kaorun343 kaorun343 reopened this May 28, 2019
@Alex-Golovin
Copy link

Have the same issue both in production (with SSL) and locally.
Can't fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants