Twitch embed returning error in Twitter player card

Works fine as an embed on it’s own but when shared via Twitter or run through Twitter’s validator it’s broken and gives the following error instead of showing video playback:

Whoops this embed is misconfigured. (Developers: Please check your browser console for more information)

Console does show errors on my page when a stream is live however they seem to be from Twitch itself. See my paste at the end of this post. Domains in question were:

  • cdn-gl.imrworldwide[dot]com
  • s.amazon-adsystem[dot]com
  • sb.scorecardresearch[dot]com

My code was pulled directly from: Everything | Twitch Developers

In my embed I have been sure to include:

parent: ["mydomain.com", "twitter.com", "cards-dev.twitter.com"]

Console errors (When live)

[Error] Failed to load resource: Could not connect to the server. (P34D56F9D-5684-4C83-8EE1-5EA7DE9CF45D.js, line 0)
[Error] Failed to load resource: Could not connect to the server. (iui3, line 0)
[Error] Failed to load resource: Could not connect to the server. (b, line 0)
[Error] Failed to load resource: Could not connect to the server. (iu3, line 0)
[Warning] Moving to buffered region – 0.033 – 0 (player-core-base-83341606b3ec3a4af9ae.js, line 1)
[Error] Failed to load resource: Could not connect to the server. (p, line 0)
[Error] Failed to load resource: Could not connect to the server. (p, line 0)
[Error] Failed to load resource: Could not connect to the server. (p, line 0)
[Error] Failed to load resource: Could not connect to the server. (p, line 0)

Follow Twitters iFrame tree.

Which means you have to look at a Tweet and use network inspector to follow the iFrame stack to see what iFrames Twitter is using (today.

The method is outlined in the OP of The great big "I'm using WIX/SomeWebsiteMaking Tool and I don't know how to fix my embed" thread

Basically without a Tweet to look at I can’t see the iFrame stack to see what iFrames are in use

To update: now that I have a tweet to test since $streamerGuy went live

Mine is still working

I’m using the following:

<meta name="twitter:player" content="https://player.twitch.tv/?volume=0.34&muted&channel=cohhcarnage&parent=cards-dev.twitter.com&parent=twitter.com&parent=cards-frame.twitter.com&parent=tweetdeck.twitter.com" />

So I’m guessing you are missing the cards-frame.twitter.com also note that my domain isn’t in the list at all. Just Twitter ones, since Twitter takes the passed player meta tag and embeds that into Twitter site. It just uses your site to get the meta tags.

Yours, having checked view-source:https://hihellorachel.tv/live/ is just

<meta name="twitter:player" content="https://player.twitch.tv/?channel=hihellorachel&html5&muted=true&quality=mobile" />

So you have no parents at all, being passed to the embed that Twitter renders into Twitter.

The page/link (in theory) doesn’t need an Iframe/the stream on it at all, since Twitter looks for the meta tag. So if you do have an iFrame on there you just need the parents for your site, not Twitter’s as well

Mine is https://cohh.tv/

In the Twitter card validator tool the tweet with my test URL is loading an iframe from:

https://cards-dev.twitter.com/preview/html?authenticity_token=a3958539758188141e44717419e2837a2d49e1d4&url=https%3A%2F%2Fhihellorachel.tv%2Flive%2F&platform=Swift-12&authenticity_token=a3958539758188141e44717419e2837a2d49e1d4&authenticity_token=a3958539758188141e44717419e2837a2d49e1d4#xdm_e=https%3A%2F%2Fcards-dev.twitter.com&xdm_c=default258&xdm_p=1

I have added cards-frame.twitter.com as a parent to my page’s javascript and it had no effect.

This is the javascript from my page

<script type="text/javascript">
	var options = {
		channel: "hihellorachel",
		width: 1024, //'100%'
		height: 385, //385
		theme: "dark", //dark
		autoplay: "true",
		// Only needed if this page is going to be embedded on other websites
		parent: ["hihellorachel.tv", "www.hihellorachel.tv", "twitter.com", "cards-dev.twitter.com", "cards-frame.twitter.com"]
	};
  var player = new Twitch.Player("#twitch-embed", options);
  player.setVolume(0.5);
</script>


</body>
</html>

The Twitter card cannot handle/display a JS embed.
A JS embed only works when the viewer loads the page.

A Twitter card useds the <meta name="twitter:player tag to determine what to show in the “preview”/validator/twitter embed.

You need to fix <meta name="twitter:player" content="https://player.twitch.tv/?channel=hihellorachel&html5&muted=true&quality=mobile" /> not add Javascript to the page.

So you need to fix the meta tag to something like

<meta name="twitter:player" content="https://player.twitch.tv/?volume=0.34&muted&channel=hihellorachel&parent=cards-dev.twitter.com&parent=twitter.com&parent=cards-frame.twitter.com&parent=tweetdeck.twitter.com" />

Which I hinted at in my original reply.

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