Reputation: 29
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>
Upvotes: 0
Views: 353
Reputation: 2915
You can use iFrame:
<iframe width="560" height="315" src="https://www.youtube.com/embed/FBIwiK7U9l0"></iframe>
Upvotes: 1
Reputation: 105
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>
Upvotes: 2