下面是一段播放电影的代码
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<HEAD>
<script language="JScript">
document.onkeydown = function()
{
if(event.keyCode != 27)
{
event.keyCode = 0;
event.returnValue = false;
}
}
function PlayerError()
{
if(window.opener == undefined)history.back(-1);
else self.close();
}
</script>
<title>在线播放-</title>
</HEAD>
<body>
<table align="center" cellspacing="0" cellpadding="0" width="100%" border="0">
<tr>
<td align="center" valign="middle">
<object id="WebPlayer" width="1024" height="768" classid="CLSID:AA899B43-24BD-4B6B-BBD0-45557D8D11E0" VIEWASTEXT>
<param name="_Version" value="65536">
<param name="_ExtentX" value="10583">
<param name="_ExtentY" value="10583">
<param name="_StockProps" value="0">
</object>
</td>
</tr>
</table>
<script>
var filmid;
var serverip;
var userid;
filmid = 6198;///////////这个是电影的编号
serverip = "221.12.90.163:80";/////////这个是电影的地址
userid = "8";//////////////////////这个不知道是什么
</script>
<script language="JScript">
if (typeof(userid)=="undefined"){
window.opener.alert("请求资源失败1");
self.close();
}else if (typeof(filmid) == "undefined"){
window.opener.alert("请求资源失败2");
self.close();
}else if(typeof(serverip) == "undefined"){
window.opener.alert("远程服务器反回错误3");
self.close();
}else if(filmid>0){
x = CheckPlayer();
}else{
window.opener.alert("该服务器未找到此影片信息.");
self.close();
}
function PlayerInit(szServerHost)
{
WebPlayer.ServerMode = "2";
WebPlayer.UserName = "!Guest";
WebPlayer.UserID = userid;
WebPlayer.PlayMode = "1"; //SendType
WebPlayer.PlayModeValue = filmid; //MultiIP_Addr
WebPlayer.ChannelID = filmid;
WebPlayer.AuthenHost = serverip;
WebPlayer.ServerHost = "1.1.1.1"; //IpAddr
WebPlayer.Session = ""; //"";
WebPlayer.ProtocolType = "1";
WebPlayer.EmbedMode = "1";
WebPlayer.ProgName = "";
WebPlayer.ContorlWidth = 322;
WebPlayer.ContorlHeight = 320;
WebPlayer.Start();
}
function RestorePlayerWindow(iWidth, iHeight)
{
window.resizeTo(iWidth, iHeight);
availWidth = screen.Width;
availHeight = screen.availHeight;
iTmpPix = availWidth - iWidth;
iWinLeft = iTmpPix / 2;
iTmpPix = availHeight - iHeight;
iWinHeight = iTmpPix / 2;
window.moveTo(iWinLeft, iWinHeight);
}
function GetHostName(szUrl)
{
iNameSize = szUrl.indexOf("/", 7) - 7;
szUrl = szUrl.substr(7, iNameSize);
if(szUrl.indexOf(":") > 0)iNameSize = szUrl.indexOf(":");
szHostName = szUrl.substr(0, iNameSize);
return szHostName;
}
function GetHostPort(szUrl)
{
var szHostPort, iPortPos, iPortSize;
if(szUrl.indexOf(":", 5) > 0)
{
iPortPos = szUrl.indexOf(":", 5) + 1;