vue-youtube-embed icon indicating copy to clipboard operation
vue-youtube-embed copied to clipboard

Failed to execute 'postMessage' on 'DOMWindow'

Open mardonedias opened this issue 7 years ago • 8 comments

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.

mardonedias avatar Sep 08 '17 23:09 mardonedias

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

kaorun343 avatar Sep 09 '17 13:09 kaorun343

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',

Christilut avatar Oct 09 '17 08:10 Christilut

The problem is target and origin must be https

rafalowski avatar Jan 07 '18 08:01 rafalowski

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,

insane-kaos avatar Jun 25 '18 07:06 insane-kaos

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.

sandy2609 avatar Aug 27 '18 11:08 sandy2609

@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.

terrymun avatar Sep 07 '18 12:09 terrymun

 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

larstton avatar May 23 '19 11:05 larstton

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

Alex-Golovin avatar Dec 27 '19 16:12 Alex-Golovin