Add object-fit support to FxControl and calculateStyle functions
Hi, this PR allows changing a way the video is shown using object-fit CSS property. It is useful when watching on 16:9 display a video that is encoded in 4:3 with black bars at the top and bottom, because the actual video is 16:9. Then when cover is selected in a drop down for object-fit, the black bars disappear and movie is scaled to fill horizontally, so the black bars overflow at the bottom and at the top, leaving only the 16:9 part of the actual content effectively full screen.
Hello again! Seems useful. ~~Can you link me a video/website where it can be tested? I've noticed the cover option doesn't have much impact on Youtube~~.
edit: Found some videos.
Yes, it doesn't do much on YT, only none changes something visually, and makes the video it's actual size in encoded px. YT seams to have some funky HTML and CSS layout for videos and video tag is not the size of it's parent element in DOM. My addition works best as a quick fix on other sites, where video DOM element is the same size as the parent element, especially on fullscreen, when parent has 100vh and 100vw size. Changing object-fit in those situation is easier than eye-balling the required number for scale-x and scale-y.
I've mulled it over, and I do have a few concerns. (Thank you for the PR by the way!)
- It's a slightly niche feature, and the people that need, probably won't know this is the right tool for the job. It would take an advanced user to make use of this.
- The transform effects, albeit inconvenient, might also help the described issue.
Sure, I use use my own built fork, so if you don't want to merge it that's fine.