There are lots of solutions for maintaining aspect ratio when resizing videos based on the width of the parent div. Most of them depend on the fact that "padding-top" and "padding-bottom" are calculated based on width rather than height.
I'm trying to do something similar, but I want to resize my video based on the height of the parent div.
To do this I need to create a div that keeps an aspect ratio regardless of height. This may be sort of a lame way to do it, but I decided to use an image to do this because I can set the height of the image with the appropriate aspect ratio to 100% and let the height sort itself out.
I am very close to making this work. As of now, I have been able to make the inner div do exactly what I want it to do, except that it will not redraw on window resize. However, if I resize the window then reload, it works. Any ideas?
Here's the demo (it's not a codepen issue I've done it locally as well)