html - YouTube 视频作为网页背景

标签 html css video youtube background

我需要 youtube 视频作为我的网页背景。 这是我的代码

<section class="about-section">

           <div class="video-background">
<div class="video-foreground">
  <iframe src="https://www.youtube.com/embed/UY9V5S9MEgk?controls=0&showinfo=0&rel=0&autoplay=1&loop=1&playlist=W0LHTWG-UmQ" frameborder="0" allowfullscreen></iframe>
</div> </div> </section>

这工作正常。我的问题是我需要使用以下 YouTube 视频作为我的背景,但它不起作用。 我尝试了这两个网址,但不起作用

https://youtu.be/UY9V5S9MEgk

这些是我尝试过的网址

https://www.youtube.com/watch?v=UY9V5S9MEgk

最佳答案

复制 YouTube 视频的嵌入代码并将其替换为当前的代码

<iframe width="854" height="480" src="https://www.youtube.com/embed/UY9V5S9MEgk?controls=0&showinfo=0&rel=0&autoplay=1&loop=1&playlist=W0LHTWG-UmQ" frameborder="0" allowfullscreen></iframe>

关于html - YouTube 视频作为网页背景,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43691980/

相关文章:

Jquery 隐藏和显示图像 - 切换功能

html - 当用户调整窗口大小时,表格会缩小。页脚插入它的内容而不重叠它

iphone - 使用 UIImagePickerController 选择电影时避免视频压缩?

android - 自定义视频录制方向

html - 响应式布局教程?

javascript - 文档标题消失

html - 为什么我删除这些元素时会出现空白?

twitter-bootstrap - 向图标字体添加深度/尺寸?

c++ - 使用 Qt5 从网络摄像头录制视频

php - 使用 &amp;amp;amp;amp;amp;在查询字符串中