1. 程式人生 > >前端視訊轉碼flv->swf

前端視訊轉碼flv->swf

在專案中本來是要用<video>標籤插入視訊,但此標籤不支援flv格式,上網也是搜了很多,試了很久才成功(其他格式不是很清楚你們可以嘗試看看)

所用技術 flach (Flvplayer.swf),ckplayer.js,jq

//連結:http://www.zgtyjs.org/education/v/video.jsp

<html>
<div class="left">
                <object class="obj"
                    codebase=" http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"
                    width
="80%" height="650px" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"> <param name="quality" value="high"> <param name="allowFullScreen" value="true"> <param name="movie" value="/education_online/education/v/swf/Flvplayer.swf"> <param class
="vo1" name="FlashVars" value="vcastr_file=http://video.moe.gov.cn/tiweiyisi/xiaoyuanzuqiu/xyzqttzq_001.flv&IsContinue=1"> <embed class="vo2" id="vo2" src="/education_online/education/v/swf/Flvplayer.swf" flashvars="vcastr_file=http://video.moe.gov.cn/tiweiyisi/xiaoyuanzuqiu/xyzqttzq_001.flv&IsContinue=1" width
="100%" height="650px" pluginspage="http://www.macromedia.com/go/getflashplayer" quality="high" allowfullscreen="true" type="application/x-shockwave-flash"> </embed> </object> </div>
</div>
<html>
<script>
/*

相關部分程式碼,append裡的程式碼不可少寫,這是為了每次點選視訊選集時重新載入

*/
  

$(".left .obj").append('<param name="quality" value="high">'+
'<param name="allowFullScreen" value="true"><param name="movie" value="/education_online/education/v/swf/Flvplayer.swf">'+
'<param class="vo1" name="FlashVars" value="vcastr_file='+dataList[ooid].url+'&IsContinue=1">'+
'<embed class="vo2" id="vo2" src="/education_online/education/v/swf/Flvplayer.swf" flashvars="vcastr_file='+dataList[ooid].url+'&IsContinue=1" width="100%" height="650px" pluginspage="http://www.macromedia.com/go/getflashplayer" quality="high" allowfullscreen="true" type="application/x-shockwave-flash"></embed>')
})



</script>