1. 程式人生 > >如何將上傳到優酷的視訊載入到網頁中?

如何將上傳到優酷的視訊載入到網頁中?

得用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>

在網頁中顯示如下