3 ms·
Interesting solution but can't it be achieved with the object-fit CSS property? Using `object-fit: cover` will make the video resize maintaining its aspect rat
by bpedro 10y ago
Interesting solution but can't it be achieved with the object-fit CSS property?
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 https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit for more info.
- addedlovely 10y agoCame here to say the same: http://caniuse.com/#feat=object-fit http://caniuse.com/#feat=object-fit
- binarydreams 10y agoInteresting! It works pretty well except that there's no IE support. So the resizing logic included in the library is useful for projects that need IE10+ support.
- bpedro 10y agoYou can always use a polyfill like this one: https://github.com/jonathantneal/fitie https://github.com/jonathantneal/fitie