浮动Youtube iframe嵌入

我已经看到jQuery脚本计算旧样式(对象/嵌入)的100%/可调整大小的youtube嵌入的高度。 任何人都知道如何使用新的iframe嵌入来解决它?
<iframe 
  title="YouTube video player" 
  class="youtube-player" 
  type="text/html" 
  width="640"
  height="390" 
  src="http://www.youtube.com/embed/-p3atsZRPLc?rel=0" 
  frameborder="0" 
  allowFullScreen 
></iframe>
    
已邀请:
使用旧样式嵌入和此脚本结束:
<script type="text/javascript"> 
        //<![CDATA[
          var $origVideo = $(".youtube, .youtube embed");
          var aspectRatio = $origVideo.attr("height") / $origVideo.attr("width");

          $(window).resize(function() {
            var wrapWidth = $("#video").width();
            $origVideo
                .width(wrapWidth)
                .height(wrapWidth * aspectRatio);
          }).trigger("resize");
        //]]>
</script>
    

要回复问题请先登录注册