通用媒体播放器(5.5更新)
比较简单的控件应用,just for your reference (其实有一半原因是为dg244做的呵呵)
IE only, IE6 test passed
自动识别媒体类型(其实是通过后缀名来分辨的),调用realplayer或Windows Media Player来播放,有感兴趣的可以试试把swf也加进来,反正都是object
*-*-*-*-* 俺就素传说中那华丽滴分割线 *-*-*-*-*-*-**-*-*-
2006.5.5 更新
增加了flash 播放功能
HTML MPC
#playerDIV {
background-image: url(http://www.blueidea.com/articleimg/usericon/hutia.gif);
width:600px;
height:450px;
}
var rmID="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA";
var wmID="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95";
var swfID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000";
var thePlayer;
function doPlay(fPath){
if(!fPath)fPath=document.getElementById("txtURL").value;
if(fPath==""||fPath==null)return(false);
fType=fPath.substring(fPath.lastIndexOf(".")+1).toLowerCase();
if(thePlayer){
document.getElementById("theTurePlayerID").outerHTML="";
}
thePlayer=document.createElement("object");
thePlayer.width="100%";
thePlayer.height="100%";
thePlayer.style.display="none";
thePlayer.id="theTurePlayerID";
document.getElementById("playerDIV").appendChild(thePlayer);
switch(fType){
case "rm":case "rmvb":
thePlayer.classid=rmID;
with(thePlayer){
_ExtentX=12118;_ExtentY=8573;
AUTOSTART=-1;SHUFFLE=0;PREFETCH=0;
NOLABELS=0;CONTROLS="Imagewindow";
LOOP=0;NUMLOOP=0;CENTER=0;
MAINTAINASPECT=0;BACKGROUNDCOLOR="#000000";
}
thePlayer.Source=fPath;
thePlayer.DoPlay();
break;
case "swf":
thePlayer.classid=swfID;
thePlayer.movie=fPath;
break;
default:
thePlayer.classid=wmID;
thePlayer.fileName=fPath;
thePlayer.Play();
}
setTimeout("thePlayer.style.display='';",1000);
}
吉祥三宝 (MP3)
不得不爱 (RM)
Flash
[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]