BACK TO BLOG
Bugs & Fixes

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

ArtiveLabAuthor
| July 5, 2022 1 views
Revolution Slider: Failed to execute ‘postMessage’ on ‘DOMWindow’: The target origin provided (‘https://www.youtube.com’) does not match the recipient window’s origin (https://yourdomain.com) - Fixed
[vc_row][vc_column][vc_column_text]While trying to make a video from youtube autoplay as the page loads this error popped up 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://yourdomain.com')
I found the following solutions.
  • You need to have ssl (https) enabled. and add at the end of your url ";origin=https://yourdomain.com;"
    "https://www.youtube.com/embed/" + videoCode + "?version=3&enablejsapi=1&html5=1&rel=0&controls=0&showinfo=0&autoplay=1&mute=1;origin=https://your-domain.com;"
  • The second solution was to add the &mute=1 attribute on the url's attributes. (this one worked for me) This happens because we are not allowed to autoplay videos with sound on our websites. You have to force the mute option in order for the autoplay to work properly.
[/vc_column_text][/vc_column][/vc_row][vc_row][vc_column width="1/3"][vc_single_image image="1535" img_size="medium" alignment="center" onclick="link_image"][/vc_column][vc_column width="2/3"][vc_column_text]I got this issue with Revolution Slider on WordPress. It seems that even though the Revolution slider has an option that says "mute" on/off, it does not add that value to the final link printed out on the iframe.[/vc_column_text][/vc_column][/vc_row]

ArtiveLab

Author

The ArtiveLab team creates content about web development, design, and technology.

Sign in