Community X.

Connect with other creators, share ideas, give feedback and get the latest product updates.

Mar 22
Edited: Mar 22

[bug] youtube player causing errors, editor X

Hi, I am using the video player to switch between a list of youtube videos that I set in an array beforehand.

when I change the src (replacing the video), I often get the following errors in the console:


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


This occurs randomly (not every time i change the src), the code doesn't seem to break and the videos are changing, yet the console is getting filled with errors -which obviously doesn't look good and means that something is broken in here.

Example page link(open the debugger, and click the button to switch between videos to see the error):

https://hurryappnet.editorx.io/website-9


the code:


let a = ["https://www.youtube.com/watch?v=m7qfi801Cm0","https://www.youtube.com/watch?v=SzQpj5GRvVs","https://www.youtube.com/watch?v=mIZ-uCl9QGY","https://www.youtube.com/watch?v=u12_XEW8j0s",
"https://www.youtube.com/watch?v=1KoT5e4jHL0","https://www.youtube.com/watch?v=hYMWa-XLkeU","https://www.youtube.com/watch?v=fjC85W3iOoY","https://www.youtube.com/watch?v=sKPAnR1Me2c","https://www.youtube.com/watch?v=y4qilNcRgfE","https://www.youtube.com/watch?v=ZF1X4Io3PpQ",];
let i = 0;

$w.onReady(function () {
    $w("#button1").onClick(() => {
            $w("#videoPlayer1").src = a[i];
            i++;
    })
});

screen shot of the errors (doesn't happen every time):



please let me know if you have any solutions, or is it just a bug that needs to be fixed on wix's end? thanks

0 answers0 replies

Editor X

Design your boldest creations.