Bideo.js – Easy Background HTML5 Videos
rishabhp.github.io
rishabhp.github.io
Using `object-fit: cover` will make the video resize maintaining its aspect ratio and filling its entire box.
See https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit for more info.
I did try to work around slow network speed (can see in the network_speed_optim branch on github but with the current APIs it's a tough problem to crack.
The current implementation is basic but works well. Suggestions welcome so that I can improve it.
.bg-video {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
min-width: 100%;
min-height: 100%;
width: auto;
height: auto;
z-index: -1
/* don't set a background color or image on body */
}
I mean, why do you need JavaScript?This explains it what problem does it try to solve.
Which is good in most ways, but also means that people are converting videos into hugely bandwidth-wasting GIFs instead. I'd rather videos be "tap for sound" and autoplay at this point.
[1] or some other opt-in user option
[2] e.g. https://github.com/easylist/easylist/blob/master/fanboy-addo...