WMP、Real 的方法、事件和屬性都很多,這裏只列出一些常用同時又是最基本與重要的方法及屬性。學習製作網頁播放器必須首先熟練掌控她們!
|
她們真的非常重要。一個網頁播放器,不管如何變化多端,都是這些方法、事件和屬性衍生的功能延伸,如快進、快退,左、右聲道,截取片段,重複、循環、隨機播放,拖放,點播,進度條滾動,時間正序、倒序及上一首、下一首、第一首、末一首等等。這裏需要説明的是,上面 Windows Media Player 的方法屬性是針對 WMP 6.4 以上版本而言,6.4 以下版本的某些地方如全屏等是不同而有區別的。
簡單的網頁播放器譜樂在前面的專題中已列舉了許多實例。即在 HTML 代碼中插入:
<object classid = "clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6">
<param name = "url" value = "http://aboutplayer.com/aboutplayer.asx">// 參數 url 定義播放媒體的路徑。 <param name = ……>// 還有很多這樣的參數,都具有重要的功用!
……
</object>
上面是播放音頻的代碼,播放視頻的只需在<object ……>中插入 width = "205" height = "100" 確定視頻區域的寬、高即可,寬高比有 4:3、16:9 兩種模式。
若再插入 type = "application/x-oleobject" 的代碼,即可播放 SWF 等 Flash 類和 jpg、gif、png、bmp 等圖片類媒體。
上述綜合代碼就是:
<object classid = "clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6" width = "205" height = "100" type = "application/x-oleobject">
<param name = "url" value = "http://aboutplayer.com/aboutplayer.asx"> <param name = ……>
……
</object>
這裏 "clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6" 是 WMP 6.4 以上版本控件,6.4 以下版本控件代碼是 "clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95"。兩者在參數等方面的定義上是有許多差異的!
|
|
windows Media Player 9.0網頁播放器 (mp3.wma.wmv.asf) 以下圖片為一般播mp3.wma文件時調用windows自帶播放器windows Midia Player9.0所顯示外觀,非9.0版所顯示的面板外觀可能不同! |
|
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
代碼簡介: width(播放器面板寬度) height(播放器面板高度) autostart(自動播放,“=1”或“=true”即是功能有效,“=0”即是手動播放) loop(循環播放,“=2”即是循環播放兩次,“=-1”或“=true”即是無限次循環播放) 可變值:false 或 0(手動開啓);true 或 1(自動開啓) |
|
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
(無文件信息顯示) |
|
銀灰面板 <embed src="鏈接地址" width="300" height="45" loop="-1" autostart="true"></EMBED>
|
|
灰白麪板 <embed style="FILTER: Gray()" src="鏈接地址" width="300" height="45" loop="-1" autostart="true"></EMBED>
|
|
棕色面板 <embed style="FILTER: invert()" src="鏈接地址" width=300 height=45 loop="-1" autostart="true"></EMBED>
|
|
黑色面板 <embed style="FILTER: xray()" src="鏈接地址" width=300 height=45 loop="-1" autostart="true"></EMBED>
|
|
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
(帶顯示文件播放信息) |
|
<embed src="鏈接地址" width=300 height=69 type=application/x-mplayer2 loop="-1" showcnotallow="1" ShowDisplay="0" ShowStatusBar="1" autostart="1"></EMBED>
|
|
灰白色面板 <embed style="FILTER: Gray()" src="鏈接地址" width=300 height=69 type=application/x-mplayer2 loop="-1" showcnotallow="1" ShowDisplay="0" ShowStatusBar="1" autostart="1"></EMBED>
|
|
<embed style="FILTER: invert()" src="鏈接地址" width=300 height=69 type=application/x-mplayer2 loop="-1" showcnotallow="1" ShowDisplay="0" ShowStatusBar="1" autostart="1"></EMBED>
|
|
<embed style="FILTER: xray()" src="鏈接地址" width=300 height=69 type=application/x-mplayer2 loop="-1" showcnotallow="1" ShowDisplay="0" ShowStatusBar="1" autostart="1"></EMBED>
|
|
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
(顯示文件標籤信息) |
|
<embed src="鏈接地址" loop="-1" width=300 height=140 balance="true" showpositinotallow="true" showtracker="true" showaudiocnotallow="true" showcnotallow="true" showstatusbar="true" showdisplay="true" displaysize="0" volume="100" autosize="true" autostart="true" animatinotallow="true" transparentatstart="true"></EMBED>
|
|
<embed style="FILTER: Gray()" src="鏈接地址" loop="-1" width=300 height=140 balance="true" showpositinotallow="true" showtracker="true" showaudiocnotallow="true" showcnotallow="true" showstatusbar="true" showdisplay="true" displaysize="0" volume="100" autosize="true" autostart="true" animatinotallow="true" transparentatstart="true"></EMBED>
|
|
<embed style="FILTER: invert()" src="鏈接地址" loop="-1" width=300 height=140 balance="true" showpositinotallow="true" showtracker="true" showaudiocnotallow="true" showcnotallow="true" showstatusbar="true" showdisplay="true" displaysize="0" volume="100" autosize="true" autostart="true" animatinotallow="true" transparentatstart="true"></EMBED>
|
|
<embed style="FILTER: xray()" src="鏈接地址" loop="-1" width=300 height=140 balance="true" showpositinotallow="true" showtracker="true" showaudiocnotallow="true" showcnotallow="true" showstatusbar="true" showdisplay="true" displaysize="0" volume="100" autosize="true" autostart="true" animatinotallow="true" transparentatstart="true"></EMBED>
|
|
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
(有圖像的 media 播放器) |
|
|
|
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
以下三種加特效面板修改播放面板尺寸時,須將兩組播放尺寸數值修改為一致才能正確顯示。 如下例:width: 300px; HEIGHT: 300px" width="300" height="300" |
|
|
|
光暈特效。 ----------------- opacity(不透明度)、finishopacity(平滑度)、style(風格類型) style(風格類型): “1”(強光偏左)、“2”(強光居中)、 “3”(方形發散強光)“4”(透明) |
|
<embed style="filter:Alpha(opacity=10,finishOpacity=100,style=2); WIDTH: 300px; HEIGHT: 300px" src="鏈接地址" width="300" height="300" type="audio/mpeg" volume="100" loop="true" autostart="true" showstatusbar="1"></EMBED>
|
|
波浪扭曲: lightstrength(亮度)、strength(波幅)、freq(波頻) ----------------------------------------------------------------------- <embed style="FILTER: wave(add=0,lightstrength=10,strength=8,freq=20,phrase=30); WIDTH: 300px; HEIGHT: 300px" src="鏈接地址" width="300" height="300" volume="0" loop="true" autostart="true" showstatusbar="1"></EMBED>
|
|
邊緣霧化
|
|
|
|
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
RealPlayer網頁播放面板 (rm.rmvb.ram) |
|
音頻播放器(無信息顯示)
>
|
|
音頻播放器(顯示播放數據)
|
|
調整高度可變化面板 顯示播放數據 <embed src="鏈接地址" width="300" height="60" autostart="true" loop="true"></EMBED>
顯示播放數據及文件信息 <embed src="鏈接地址" width="300" height="90" autostart="true" loop="true"></EMBED>
|
|
視頻播放器 面板分為上下兩部分,所以上下分別需要輸入鏈接、調整高寬度。
|