I'm having problems resizing to keep the aspect ratio with large videos. I'm using this demo code: https://codeconvey.com/fullscreen-html5-responsive-video-background/
My problem is that I can get centering the video to work correctly, and the video resizes keeping the aspect ratio if the window is larger than the video, but a 1920x1080 video is not resizing down to fit the height or width of the browser on smaller screens (say, a laptop at 1440px wide). It seems that the video never scales down from it's original size.
It's as if the body doesn't understand that the viewport is smaller than 1920x1080 because, I suspect, it's defining 100% width based on the video element width. If I drop in a 1280x720p video into this code the resizing works flawlessly as the video always resizes up to fill the browser screen.
I did try wrapping the video in a container element, but didn't see an improvement, changing the relative/fixed/absolute positions in any combination as well as defining width height for html, body, container div, anything.
I don't want to rely on javascript if possible. I also want to use a 1080p video for quality purposes. Scaling up a 720p video does not work for my needs on this specific project.
What I need: responsive background video that covers the entire browser window, using a 1080p video, at the smallest size the video can be to fit the screen while keeping the video's aspect ratio. (The video must scale down on smaller screens)
width: 100%
on the video itself? – SpyderScript