Twitch 嵌入式剪辑错误 - 拒绝连接

问题描述

我正在尝试在网站上嵌入 twitch 剪辑和视频,感觉就像在这里撞墙一样。

我有一个文章部门,里面有一个嵌入的 twitch 剪辑。在我的 ftp 站点和本地主机上,嵌入的剪辑都不起作用。 我只能假设我对我的父母做错了什么,但我已经尝试了几乎所有的方法。 我收到了这个 twitch 连接错误 - 我遵循了 twitch API 但没有正确。

enter image description here

不确定是否有所不同,但 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 调用的人能否帮助纠正我似乎看不到的错误

解决方法

abcstreamer.co.za 不存在所以我无法为您调试

Twitch Embeds 要求网站通过 SSL。

如果您的嵌入是在您网站的 iframe 中,您可能需要多个 parent。站点构建器工具(例如 wix)会将 embed in 和 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-how-to-fix-my-embed-thread/26297/