首页 > 解决方案 > Twitch Embedded Clips 错误 - 拒绝连接

问题描述

我正在尝试在网站上嵌入 twitch 剪辑和视频,感觉就像我的头撞到了墙上。

我有一个文章部门,里面有一个嵌入式抽搐剪辑。在我的 ftp 站点和 localhost 上,嵌入的剪辑都不起作用。我只能假设我对父母做错了什么,但我几乎尝试了一切。我收到此 twitch 连接错误 - 我已遵循 twitch API 但未正确。

在此处输入图像描述

不确定是否有区别,但 html 文件位于目录中 - abcstreamer.co.za/commingsoon/streamclips.html

这是我的本地托管代码:

<article class="stream stream-1 has-post-thumbnail">
                        <iframe 
                            src="https://clips.twitch.tv/embed?clip=EphemeralPlainSaladPipeHype-24G9rCNWcx09Wc42&parent=localhost:5500" 
                            allowfullscreen="true", 
                            autoplay=false,
                            height="100%" 
                            width="100%">
                        </iframe>
                </article>

以下是我的 ftp 站点代码:

<iframe 
                            src="https://clips.twitch.tv/embed?clip=EphemeralPlainSaladPipeHype-24G9rCNWcx09Wc42&parent=abcstreamer.co.za" 
                            allowfullscreen="true" 
                            autoplay="false",
                            height="100%" 
                            width="100%">
                        </iframe>

可能使用过 twitch API 调用的人可以帮助纠正我似乎看不到的错误。

标签: javascripthtmliframetwitchtwitch-api

解决方案


abcstreamer.co.za不存在所以我不能为你调试

Twitch 嵌入要求网站通过 SSL。

parent如果您的嵌入在您网站的 iframe 中,您可能需要多个。站点构建器工具(例如 wix)会将嵌入和 iframe 放入站点中,因此您需要声明两个或多个父级。

所以你可能需要

https://clips.twitch.tv/embed?clip=EphemeralPlainSaladPipeHype-24G9rCNWcx09Wc42&parent=abcstreamer.co.za&parent=www.abcstreamer.co.za

占www。如果您不重定向 www。到非 www。或相反亦然。这同样适用于将非 SSL 用户重定向到 SSL 版本

或者

https://clips.twitch.tv/embed?clip=EphemeralPlainSaladPipeHype-24G9rCNWcx09Wc42&parent=abcstreamer.co.za&parent=www.abcstreamer.co.za&parent=someotherdomain.com

如果someotherdomain.com处理站点构建器上的 iframe(如果有)

“超级线程”对确定您的父堆栈有进一步的建议https://discuss.dev.twitch.tv/t/the-great-big-im-using-wix-somewebsitemaking-tool-and-i-dont-know -如何修复我的嵌入线程/26297/


推荐阅读