頁面播放器,全部JS,調用 SWFObject方法

來源:互聯網
上載者:User

之前在頁面上面放視頻,總是用:

<object classid="clsid:05589FA1-C356-11CE-BF01-00AA0055595A" id="ActiveMovie1" width="239" height="250">
<param name="Appearance" value="0">
<param name="AutoStart" value="0">
<param name="AllowChangeDisplayMode" value="-1">
<param name="AllowHideDisplay" value="0">
<param name="AllowHideControls" value="-1">
<param name="AutoRewind" value="-1">
<param name="Balance" value="0">
<param name="CurrentPosition" value="0">
<param name="DisplayBackColor" value="0">
<param name="DisplayForeColor" value="red">
<param name="DisplayMode" value="0">
<param name="Enabled" value="-1">
<param name="EnableContextMenu" value="0">
<param name="EnablePositionControls" value="0">
<param name="EnableSelectionControls" value="0">
<param name="EnableTracker" value="0">
<param name="Filename" value="cf1d2ab2-995d-4f8e-b356-cf1fa0cfa903.wmv" valuetype="ref">

</object>

這個是可以應用,但是相容性不好,外觀也不好看~

下面介紹個好的東西,保證你用過一次就覺得這個不錯~試試吧,把代碼直接考出去命名.html

<html>
<head>

<script type="text/javascript" src="swfobject.js"></script>

</head>
<body>

<h3>single file, with preview image:</h3>

<p id="player1"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.</p>
<script type="text/javascript">
 var s1 = new SWFObject("flvplayer.swf","single","300","170","7");
 s1.addParam("allowfullscreen","true");
 s1.addVariable("file","video.flv");
 s1.addVariable("image","preview.jpg");
 s1.addVariable("width","300");
 s1.addVariable("height","170");
 s1.write("player1");
</script>

<h3>playlist file, with different colors:</h3>

<p id="player2"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.</p>
<script type="text/javascript">
 var s2 = new SWFObject("flvplayer.swf","playlist","300","312","7");
 s2.addParam("allowfullscreen","true");
 s2.addVariable("file","playlist.xml");
 s2.addVariable("displayheight","200");
 s2.addVariable("backcolor","0x000000");
 s2.addVariable("frontcolor","0xCCCCCC");
 s2.addVariable("lightcolor","0x557722");
 s2.addVariable("width","300");
 s2.addVariable("height","312");
 s2.write("player2");
</script>

<p><a href="http://www.jeroenwijering.com/extras/wizard.html">online configuration wizard</a></p>

</body>
</html>

 

還有幾個附件,可以上網找一下~我不知道怎麼傳,就沒有傳~

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.