paulirish / lite-youtube-embed

A faster youtube embed.
https://paulirish.github.io/lite-youtube-embed/
Other
5.68k stars 260 forks source link

Use as background video #84

Closed mad-gav closed 2 years ago

mad-gav commented 3 years ago

Can this plugin be used for youtube videos that are used in backgrounds?

Garbee commented 3 years ago

Background are generally not interactive. This plugin explicitly requires a user interaction to initiate the video load.

I'd say for backgrounds the usage of the embed will very much depend greatly between apps and pages. Meaning a more thoughtful hands-on coding approach should be used.

paulirish commented 2 years ago

for full bleed background video you'd probably just want the normal iframe...

<iframe allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen src="https://www.youtube-nocookie.com/embed/ogfYd705cRs?autoplay=1"></iframe>

... and some CSS to style how you want it. using lite-youtube-embed doesnt make a lot of sense for this usecase