javascript - 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 调用的人可以帮助纠正我似乎看不到的错误。
解决方案
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/
推荐阅读
- java - 如何将正则表达式扩展为实际值
- openstreetmap - Overpass Turbo 中的连接属性
- docker - Jenkins docker_login ansible playbook:权限被拒绝
- mysql - 在具有多个模式的 mysql 中更新时软删除
- kubernetes - 自动缩放开启时,Kafka 将协调器标记为死亡
- python - 通过 dict.key 访问 dict
- android - 基于属性exist(key)的Firebase查询
- javascript - react-native 使用变量值读取常量值
- angular - Angular/Ngrx 存储错误:无法读取 isFiltered 处未定义的属性“白名单”
- regex - Postgresql 如何匹配“[\s\S]*?”之类的内容?在正则表达式中