Github Pages 在一个站点上显示嵌入的 YouTube 视频,但在另一个站点上不显示,是否有解决此问题的方法?
Github Pages displays embedded YouTube video on one site but not the other, is there a fix for this?
我在 Github 个成功嵌入 YouTube 视频的网页上托管了一个网站。我正在为 public 版本构建第二个站点,并希望在其中包含一个嵌入式视频。嵌入在本地工作,所以我知道我的代码不是问题,但 Github 拒绝在第二个站点上显示视频。下面有更多详细信息,包括具体代码。
嵌入了 Youtube 的网站:https://greattimeband.github.io
新站点(进行中):https://gr8time.github.io
旧站点在左下角显示两个视频,嵌入且功能齐全。第二个站点不显示视频(就在顶部轮播下方),但似乎将该元素识别为存在。这里可能有一些变数:
站点 #1 是使用 Webflow 构建的,可能有一些我不知道的固有样式或容器。我在 css 中搜索了任何线索,但似乎找不到任何线索。此嵌入还直接指向特定视频,而不是调用 "most recent upload"
正在使用 Bootstrap 构建站点 #2。该嵌入还调用了我频道上最近上传的内容,而不是特定视频(因此该网站应在每次上传新内容时自行更新)。
这些因素中的任何一个都可能有所贡献,但我想知道为什么 Github 对第一个示例没有问题,而对第二个示例却没有。我了解 Github 页面可能根本不允许嵌入视频,这使得第一个示例更加有趣。想知道双方是否有解释,我在第一个站点上的无意成功是否可以复制(不使用 Webflow)。
站点 #1 嵌入代码(有效):
<div class="video-div-block">
<div class="video-row w-row">
<div class="column-5 w-col w-col-4">
<h2 class="heading-2 video">Video</h2>
<div style="padding-top:56.17021276595745%" class="w-video w-embed">
<iframe width="560" height="315"
src="https://www.youtube.com/embed/4PSGaDSS8A4" frameborder="0"
allow="autoplay; encrypted-media" allowfullscreen></iframe>
</div>
<div style="padding-top:56.17021276595745%" class="video w-video w-embed">
<iframe width="560" height="315"
src="https://www.youtube.com/embed/cV4NthqdXRM" frameborder="0"
allow="autoplay; encrypted-media" allowfullscreen></iframe>
</div>
</div>
</div>
站点 #2 嵌入代码(有效但不显示):
<div class="video-container">
<iframe src="http://www.youtube.com/embed/videoseries?
list=UUJhHaq56JKvZlAQ32OH71nQ&index=0" frameborder="0"
allowfullscreen>
</iframe>
</div>
第二个例子可以正常显示并在本地拉取正确的视频,但是Github拒绝显示内容。非常感谢任何帮助!
请将 iframe src http 更改为 https,例如:
<iframe src="https://www.youtube.com/embed/videoseries?
list=UUJhHaq56JKvZlAQ32OH71nQ&index=0" frameborder="0"
allowfullscreen>
我在 Github 个成功嵌入 YouTube 视频的网页上托管了一个网站。我正在为 public 版本构建第二个站点,并希望在其中包含一个嵌入式视频。嵌入在本地工作,所以我知道我的代码不是问题,但 Github 拒绝在第二个站点上显示视频。下面有更多详细信息,包括具体代码。
嵌入了 Youtube 的网站:https://greattimeband.github.io 新站点(进行中):https://gr8time.github.io
旧站点在左下角显示两个视频,嵌入且功能齐全。第二个站点不显示视频(就在顶部轮播下方),但似乎将该元素识别为存在。这里可能有一些变数:
站点 #1 是使用 Webflow 构建的,可能有一些我不知道的固有样式或容器。我在 css 中搜索了任何线索,但似乎找不到任何线索。此嵌入还直接指向特定视频,而不是调用 "most recent upload"
正在使用 Bootstrap 构建站点 #2。该嵌入还调用了我频道上最近上传的内容,而不是特定视频(因此该网站应在每次上传新内容时自行更新)。
这些因素中的任何一个都可能有所贡献,但我想知道为什么 Github 对第一个示例没有问题,而对第二个示例却没有。我了解 Github 页面可能根本不允许嵌入视频,这使得第一个示例更加有趣。想知道双方是否有解释,我在第一个站点上的无意成功是否可以复制(不使用 Webflow)。
站点 #1 嵌入代码(有效):
<div class="video-div-block">
<div class="video-row w-row">
<div class="column-5 w-col w-col-4">
<h2 class="heading-2 video">Video</h2>
<div style="padding-top:56.17021276595745%" class="w-video w-embed">
<iframe width="560" height="315"
src="https://www.youtube.com/embed/4PSGaDSS8A4" frameborder="0"
allow="autoplay; encrypted-media" allowfullscreen></iframe>
</div>
<div style="padding-top:56.17021276595745%" class="video w-video w-embed">
<iframe width="560" height="315"
src="https://www.youtube.com/embed/cV4NthqdXRM" frameborder="0"
allow="autoplay; encrypted-media" allowfullscreen></iframe>
</div>
</div>
</div>
站点 #2 嵌入代码(有效但不显示):
<div class="video-container">
<iframe src="http://www.youtube.com/embed/videoseries?
list=UUJhHaq56JKvZlAQ32OH71nQ&index=0" frameborder="0"
allowfullscreen>
</iframe>
</div>
第二个例子可以正常显示并在本地拉取正确的视频,但是Github拒绝显示内容。非常感谢任何帮助!
请将 iframe src http 更改为 https,例如:
<iframe src="https://www.youtube.com/embed/videoseries?
list=UUJhHaq56JKvZlAQ32OH71nQ&index=0" frameborder="0"
allowfullscreen>