在頁面中使用Flowplayer播放器

來源:互聯網
上載者:User

1.下載Flowplayer播放器,地址:http://flowplayer.org/download/index.html。

 

2.下載安裝包解壓後可以找到以下幾個主要檔案:

flowplayer-3.2.7.swf:用於播放器主體的flash檔案

flowplayer.controls-3.2.5.swf:控制條檔案,是個可選的外掛程式

flowplayer-3.2.6.min.js:播放器的api檔案,也用來裝載整個播放器

 

3.在頁面調用播放器前引入播放器的api指令檔flowplayer-3.1.1.min.js,如下:

<script src="path/to/the/flowplayer-3.1.1.min.js"></script>

 

4.通過一個連結(<a>標籤)指向視頻檔案的連結,並設定視頻檔案長寬,同時應為它指定一個id。該連結的位置即是視頻顯示的位置。如下:

<a href="/hygg/resources/flash/a.flv" id="player"></a>


5.調用api為上一步設定的連結位置裝載播放器,如下:

flowplayer("player","path/to/the/flowplayer-3.1.1.swf");

上面代碼中第一個參數是上一步中設定的連結id,第二個參數是播放器主體的flash檔案路徑。使用flowplayer()方法裝載播放器時,可以指定非常多的參數來配置或個人化你的播放器。常用的例如:

 

<script>flowplayer("player","/hygg/resources/flash/flowplayer-3.2.7.swf",{

clip:{

autoPlay:false,//是否自動播放,預設true

//autoBuffering:true//是否自動緩衝視頻,預設true

}

});

</script>

 

參考:http://css9.net/t/38/

官網參考:http://flowplayer.org/documentation/configuration/


 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.