With this solution there is no need to calculate height or width, the only value needed is the ratio (set via padding).
That’s an interesting approach. I think you should have no problem implementing this solution with it as long as the UA can style the element you want to stretch within the box.
The horizontal scrollbar has nothing to do with the video, it is because of the markup that is displayed within <pre></pre> (it does not wrap). Use Firebug to remove this element and you should see that scrollbar disappear.