Slider Revolution - YouTube Video Will Not Play

Hi there,

I suggest that you add the video as a Layer of the slider and not the background of it. To do so please kindly follow the article below:

https://www.themepunch.com/revslider-doc/video-layers/

That should do the trick. Thank you.

Thanks - that gets the video onto the page but does not play video as soon as that element rotates into view. I need this to autoplay essentially as a background image - how can I do that? I’ve already setup the video to autoplay via the settings but that appears to just get completely ignored.

Appreciate the help, please let me know!

Hey there,

I’ve replicated this in my test site in Pantheon so it looks like this issue is on their end. Please contact them to fix this error.

www-widgetapi.js:121 Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://www.youtube.com') does not match the recipient window's origin ('https://dev-catch-happiness.pantheonsite.io').

It works in my other test sites that are not in Pantheon.

Thanks.

Thanks Christian! Just for my own reference, where did you find that error? I can’t find that anywhere in the console, network tab, etc.

Hi there,

It’s available in browser developer console. I can see it as well and looks like their host has some sort of ORIGIN configuration that prevents inclusion of external source, especially for embed codes.

I’m on chrome’s console, that clearly tells that youtube is being blocked, or not totally blocked but granted with limited functionality.

Thanks!

Hi - can you explain this further? I’m still unable to replicate the issue you are mentioning here on any of my environments, I’m really not sure how you’re getting to “chrome’s console, that clearly tells that youtube is being blocked…”. Regardless, I did pass this on to Pantheon support and they are also unable to replicate. I’ve attached a screenshot of my console, there is no such error (nor any errors or even warnings at all being reported).

You won’t see the error when you’re in incognito mode so you need to use the normal window.

Here’s proof that it doesn’t work in Pantheon only but works in my other test site.

Thanks.

Still confused on where you’re seeing this error, here’s my (clean) console log on a fresh load of the homepage in a regular chrome window, both logged in and logged out (only logged out attached). Can you please explain to me how you are getting this error on my URL? Because I cannot replicate it. And further, when the error does not happen, the video still does not play.

In your example, I’m seeing a mis-match of https vs. http and have seen articles pointing to that causing the error in question. However, I’ve reviewed this on my environment and the embed code is correctly pulling in the URL via https, so that isn’t the issue, and the error message you provided earlier shows https for both YouTube and my dev environment.

Hey There,

I am another staff checking in. I have viewed your page and I can see the error:

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

And yes they are both using https. The problem is that Pantheon site does not allow iframes that has a different url. Could you please request further assistance from Pantheon and asked them if they allow iframes which has different sources?

Please let us know how it goes.

Thank you @RueNel - I still don’t understand how you are generating this error message though. I cannot replicate this anywhere and have provided screenshots of the site loading without this error (another screenshot attached). Further, when this error is not present, the YouTube video still does not play, so this doesn’t even explain the problem.

In addition, I’ve embedded another YouTube video on the page (with ?autoplay=1) and the video loads without issue and begins playing immediately, so the problem is most definitely not with Pantheon being unable to load an iframe with a different URL.

https://dev-catch-happiness.pantheonsite.io/test-youtube/

Hi there,

I can see the error too, the error is because your site is unable to contact youtube through API, it’s different from adding ?autoplay=1 with normal embeds. https://developers.google.com/youtube/iframe_api_reference

The communication between your site and youtube site is not allowed for some reason. I checked the source code and noticed that in your slider, the ORIGIN URL is https://appserver-baddabcb.c.pantheon-dmz instead of https://dev-catch-happiness.pantheonsite.io, that could be the reason.

https://www.youtube.com/embed/_LEGmdl8GUA?version=3&enablejsapi=1&html5=1&hd=1&wmode=opaque&showinfo=0&rel=0&VQ=HD720;;origin=https://appserver-baddabcb.c.pantheon-dmz.internal;&controls=0

Would you mind providing your login credentials in a secure note? Maybe I’m able to see more what’s within your slider.

Thanks.

Thank you - please find credentials in a secure note here. The slider is called ‘test’

Hi,

I also tried the same video and the same youtube arguments in my test site and it did work.

Something in your site is preventing it from working.

Can you try testing for a plugin conflict. You can do this by deactivating all third party plugins, and seeing if the problem remains. If it’s fixed, you’ll know a plugin caused the problem, and you can narrow down which one by reactivating them one at a time.

Let us know how it goes!

That still doesn’t change anything: https://youtube-catch-happiness.pantheonsite.io/test-youtube/

I found the problem and fixed it - the code that generates the url is using $_SERVER['SERVER_NAME'] rather than $_SERVER['HTTP_HOST'] to generate the URL. This is not a safe way to generate the URL as some environments do not have a SERVER_NAME that you can permanently hook into. For example, Pantheon is setup using containers and the container the site is on can and does change.

I implemented a fix for this by setting the following in wp-config:
$_SERVER['SERVER_NAME'] = $_SERVER['HTTP_HOST'];

This is just a workaround though - I would really like to have the source updated to use HTTP_HOST instead of SERVER_NAME if at all possible. I’m assuming this is outside of your control since it’s Slider Revolution and not X, but I’m not sure exactly what level of control you have over this within the theme.

Hi there,

The SERVER_NAME is more reliable than HTTP_HOST, but yes, dependent to host configuration. But, it’s host responsibility to configure and provide proper information to the application running from its own environment.

Maybe your definition of safe is about usability and availability, but with safe as security, it’s safer to use SERVER_NAME since your host can enforce it regardless of who’s sending the request. While HTTP_HOST is something sent over the header, which the remote end could craft a value for HTTP_POST that isn’t your domain. Both are vulnerable, but at least the first one is host controlled.

Thanks for sharing.

Thanks Rad - understand your reasoning here. I would still like this updated to HTTP_HOST if at all possible, however.

Hello There,

No problem. We’re just glad that you were able to figure that out. We can submit this to the issue tracker of the Revolution Slider plugin so the developers of this plugin will be made aware of it.

Thank you.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.