matthojo / videojs-Background

Allows for videos to be displayed as a full background to any element.
MIT License
77 stars 41 forks source link

When resizing the browser vertically the player may never recover its original size #22

Open J-Novation opened 7 years ago

J-Novation commented 7 years ago

Hi!

First of all, thanks for the wonderful project which allows to build websites with video.js with amazing results!

One thing that its not working for me: when resizing the browser vertically, the player object size is not correct in some circumstances.

I'll try to explain more in detail: I'm loading a 16:9 aspect ratio video in a video.js and sending the video to the background. Even in a 5:4 monitor, it loads correctly, showing the video in the entire browser (cropping on the edges, of course). If I change the browser size horizontally, from 5:4 (1.25) to 16:9 (1.77) and even to 5:2 (2.50) aspect ratios, forward and backward (and scaling to 1:4 also, resizing the window), it scales perfectly, filling completely the web browser window.

When I do this vertically, increasing or reducing the aspect ratio from 16:9 (1.77) to 5:4 (1.25) its also okey. But, at last, when I change the browser window reducing the vertical size, changing the A/R from 16:9 to 16:7 (more or less), for example, when I recover the 16:9 size it is okey, but if I change the A/R to 5:4 the bottom on the browser is in blank and not covered with the video object.

In short, reducing vertically a 16:9 video to a smaller vertical size, preserving the horizontal size, it prevents the video from adjusting to bigger browser vertical sizes than 16:9.

I've tried looking at the updateSize function, responsible for this, but I cannot detect what's happening! For me it seems that the browser is ignoring some operations in this function :-(

Thanks in advance for your help!

Best regards,

Javier