small medium large xlarge

769674209l_pragsmall
24 Jul 2016, 11:29
Kenneth Lindsey Calamay (3 posts)

Hi I’m on chapter 9 and I’m kinda stuck. Anyone experiencing this error from their local?

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

Generic-user-small
05 Aug 2016, 11:12
Shawn O'Neill (1 post)

I get the same thing but as far as I can tell it hasn’t stopped anything from working. Just looks ugly in the console.

769674209l_pragsmall
13 Aug 2016, 12:38
Kenneth Lindsey Calamay (3 posts)

Aha! Thanks for that information. So I guess from my country, some youtube videos cannot be played when embedded.

An error occured. Please try again later. (Playback ID: ) Learn More

Generic-user-small
23 Mar 2018, 22:26
Leo deCandia (1 post)

according to this stackoverflow post, this error message is deceptive. The problem has to do with http/https iframe/hosting-page incompatibility. Namely, if the iframe is https, then it expects the hosting page to be https. Unless you want to run https in phoenix development mode, you can change your javascript link to explicitly refer to http and not https (the default). Youtube seems to open an iframe with a scheme (http/https) corresponding to that of the url of the link used to load the iframe API.

To fix the problem in development mode, change line 9 of player.js from

youtubeScriptTag.src = "//www.youtube.com/iframe_api"

to

youtubeScriptTag.src = "http://www.youtube.com/iframe_api"

In a real world situation, you’d want the server to set a Javascript variable on that page indicating the connection scheme, so that it would work in both development and production.

You must be logged in to comment