Intrinsic Ratio Method
$allVideos.each(function(){
var aspectRatio = $(this).height() / $(this).width();
$(this).wrap('
')
.parent('.fluid-width-video-wrapper')
.css('padding-top', (aspectRatio * 100)+"%");
$(this).removeAttr('height').removeAttr('width');
});
* code is only slightly simplified. srsly.
http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/