0

I don't understand the difference between video element and iframe. I want to set the header with a video from youtube as background.

Why this is not working:

<header>
    <video src="https://www.youtube.com/watch?v=FBIwiK7U9l0"></video>
</header>

2 Answers2

2

You're linking a page and not a video.
On YouTube you can click on share and then embed it.
You'll have a workable iframe

<iframe width="560" height="315" src="https://www.youtube.com/embed/FBIwiK7U9l0" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen>
</iframe>
TechEdd_YT
  • 95
  • 5
1

You can use iFrame:

<iframe width="560" height="315" src="https://www.youtube.com/embed/FBIwiK7U9l0"></iframe>
KetZoomer
  • 2,701
  • 3
  • 15
  • 43