如何将上传到优酷的视频加载到网页中?

得用js

<div class="right">
   <h2><a href="">more</a>video</h2>
   <div class="flash">

       <iframe  width=100% height="100%" src='http://player.youku.com/embed/XMzg5Njc5MTk4OA==' frameborder=0  allowfullscreen></iframe>

   </div>
</div>
<script>
    window.onload=function(){
        $(".mbody iframe").css({width:"30%",height:"auto"});
        var _src=$(".mbody iframe").attr("src").split("&")[0].replace("preview","player").replace("https","http");
        $(".mbody iframe").attr("src",_src);
    }
</script>

在网页中显示如下

猜你喜欢

转载自blog.csdn.net/qq_40270754/article/details/84852195