Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://www.youtube.com') does not match the recipient window's

Hi everyone !!
In my database, I have a field called ‘link’ which contains video url of youtube like → https://www.youtube.com/embed/K4XUiZAzX4U

The video player is in a repeater…
I am not connecting the video player to the dataset but the repeater is connected

$w('#videoRepeater').onItemReady(($item, itemData, index) => {
        $item('#videoRepVideoPlayer').src = itemData.link;
});

But this error is coming

Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://www.youtube.com') does not match the recipient window's origin

Any idea why is this coming ??
Thanks !!!

I think VideoPlayer do not work in repeater.

And here it is, just 15 sec. of search after my apprehension…

https://www.wix.com/corvid/forum/community-discussion/adding-videos-to-repeaters

You should use more the search my friend :wink:

Hi Friend !!!
I found this article


  • All third-party apps

  • The Pro Gallery

  • Full-Width galleries

  • Wix Video

  • Wix Music

  • Horizontal and vertical menus

  • Flash elements

  • Anchors and anchor menus

  • Hover box

  • Repeaters

  • Box slideshow

  • The HTML component


Here, it says none about the video-player

Also, the the video player is working fine!! It is showing videos from the database with no problem !!!

I was asking why this error is coming…
Thanks !!!

@ajithkrr
Ok, then i have no idea, sorry.

@russian-dima No problem :grinning:

Hi @ajithkrr Did you ever find out what that error message was about? I’m getting the same error.

Failed to execute ‘postMessage’ on ‘DOMWindow’: The target origin provided (‘https://www.youtube.com’) does not match the recipient window’s origin

It seems like the error is being triggered by YouTube, but I can’t be sure. I read some StackOverflow posts that were all over the board, and none of them were specific to Wix.

Here’s my code that is calling the video:

Here’s the console:


Any insight would be appreciated from the Wix Experts. Thank you in advance.

I completed the promise with a .catch, and the error in the console magically disappears.

Unfortunately, it looks like you still get the error message in the console if the video is connected directly to a collection in Wix. Connect it by code, and it’s all good. Connect it with Wix’s database connection, and the error persists.

I have the same issue and it is not even a repeater. Video works ok but I get this message on the console.