Twitch transformer will not work after new Twitch requirements
FabioRosado opened this issue ยท 6 comments
Hello,
I've been working with the Twitch API for a month on another project and from time to time I go over to the forums and see if there are any new relevant topics. It seems that Twitch has changed their requirements on embedding videos and that is currently breaking a lot of embedding codes.
The change that Twitch has done is that it now requires you to pass a &parent=<url>
parameter to the twitch embedder url, this parent url has to be repeated for every domain that you use. So if you are using netlify and a custom domain you will probably have to add two parents: &parent=awesome-site.netlify.app&parent=awesome-site.io
. I'm saying probably since I haven't tested this out yet.
So on our Twitch Transformer we have to pickup our site url somehow and add it to the getTwitchIFrameSrc function
Reference:
So this means that we won't be able to have Twitch support on preview domains? ๐ค
After reading the reply on Twitter, I was wondering if it might be possible to add the site url as a config option? ๐ค Might be a bit silly to have it for a single service but I'm trying to figure out how to make it work again
@FabioRosado Yeah I'm leaning towards a config option too, but then again it should be possible to set it dynamically somehow.
Don't see how that would be possible atm, since your gatsby website is already built (taking environment variables into account) before it's deployed to the dynamic subdomain.
It also might be worth mention that on the forums and docs Twitch mentions that you should be able to use localhost
as a parent for testing purposes, but I was unable to make the iframe show the video. I'm assuming the reason might be because of the port on the url but when I add the port the iframe just says that the embed was misconfigured. Not sure if this will make testing a pain.
๐ This issue has been resolved in version 3.0.0 ๐
The release is available on:
npm package (@latest dist-tag)
- GitHub release
Your semantic-release bot ๐ฆ๐