视频播放模块代码:
<
table cellspacing
=
"
0
"
cellpadding
=
"
4
"
width
=
"
100%
"
border
=
"
0
"
>
< tbody >
< tr >
< td style = " vertical-align: top; width: 70% " >
< object id = " pl " style = " width: 100%; height: 519px " classid = " clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6 "
viewastext = "" >
< param value = "" name = " URL " />
< param value = " 1 " name = " rate " />
< param value = " 0 " name = " balance " />
< param value = " 0 " name = " currentPosition " />
< param value = "" name = " defaultFrame " />
< param value = " 1 " name = " playCount " />
< param value = " -1 " name = " autoStart " />
< param value = " 0 " name = " currentMarker " />
< param value = " -1 " name = " invokeURLs " />
< param value = "" name = " baseURL " />
< param value = " 50 " name = " volume " />
< param value = " 0 " name = " mute " />
< param value = " full " name = " uiMode " />
< param value = " 0 " name = " stretchToFit " />
< param value = " 0 " name = " windowlessVideo " />
< param value = " -1 " name = " enabled " />
< param value = " -1 " name = " enableContextMenu " />
< param value = " 0 " name = " fullScreen " />
< param value = "" name = " SAMIStyle " />
< param value = "" name = " SAMILang " />
< param value = "" name = " SAMIFilename " />
< param value = "" name = " captioningID " />
< param value = " 0 " name = " enableErrorDialogs " />
< param value = " 6482 " name = " _cx " />
< param value = " 6350 " name = " _cy " />
</ object >
</ td >
< td style = " vertical-align: top; width: 30% " >
播放列表 < br />
< script language = " javascript " type = " text/javascript " >
// JScript 文件
function loadXML(xmlFile)
{
var xmlDoc;
if(window.ActiveXObject)
{
xmlDoc = new ActiveXObject('Microsoft.XMLDOM');
xmlDoc.async = false;
xmlDoc.load(xmlFile);
}
else if (document.implementation&&document.implementation.createDocument)
{
xmlDoc = document.implementation.createDocument('', '', null);
xmlDoc.load(xmlFile);
}
else
{
return null;
}
return xmlDoc;
}
// 一个检查xml文件的函数
checkXMLDocObj = function(xmlFile)
{
var xmlDoc = loadXML(xmlFile);
if(xmlDoc==null)
{
alert('您的浏览器不支持xml文件读取,于是本页面禁止您的操作,推荐使用IE5.0以上可以解决此问题!');
window.location.href='/Index.aspx';
}
return xmlDoc;
}
function doo()
{
// 定义一个读取xml文件的对象
var xmlDoc = checkXMLDocObj('http://s-sps:801/huojian.xml');
var name = new Array();
var url = new Array();
var sum=xmlDoc.getElementsByTagName("pp").length;
for(var i=0; i<sum; i++)
{
url[i]=xmlDoc.getElementsByTagName('media/pp')[i].getAttribute('url');
name[i]=xmlDoc.getElementsByTagName('media/pp')[i].getAttribute('name');
}
var str = new Array();
for(var i=0; i<sum; i++)
{
str[i]="return play('"+url[i]+"')";
}
document.write('<table border="0" cellpadding="0" cellspacing="0">');
for(var i=0; i<sum; i++)
{
var x = i+1;
document.write('<tr><td style="background-image: url(playbj.GIF);background-position:center;background-repeat:no-repeat; width:20px;height:24px; text-align:center;vertical-align:middle;" >'+x+'</td><td>');
document.write('<input id=Button1 type=button value='+name[i].toString()+' οnclick="'+str[i]+'" style="padding:2 0 0 2; border:0px;vertical-align:middle; background-color:#fff;text-align:left;">');
document.write('</td></tr>');
document.write('<tr><td style="height:1px;"><td><tr>');
}
document.write('</table>');
}
function play(urlx)
{
document.all.item("pl").url=urlx;
document.all.item("pl").controls.play();
}
doo();
</ script >
</ td >
</ tr >
< tr >
< td id = " _invisibleIfEmpty " style = " display: none " valign = " top " width = " 100% " colspan = " 2 "
name = " _invisibleIfEmpty " >
</ td >
</ tr >
< script language = " javascript " > if ( typeof (MSOLayout_MakeInvisibleIfEmpty) == " function " ) {MSOLayout_MakeInvisibleIfEmpty();} </ script >
</ tbody >
</ table >
< tbody >
< tr >
< td style = " vertical-align: top; width: 70% " >
< object id = " pl " style = " width: 100%; height: 519px " classid = " clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6 "
viewastext = "" >
< param value = "" name = " URL " />
< param value = " 1 " name = " rate " />
< param value = " 0 " name = " balance " />
< param value = " 0 " name = " currentPosition " />
< param value = "" name = " defaultFrame " />
< param value = " 1 " name = " playCount " />
< param value = " -1 " name = " autoStart " />
< param value = " 0 " name = " currentMarker " />
< param value = " -1 " name = " invokeURLs " />
< param value = "" name = " baseURL " />
< param value = " 50 " name = " volume " />
< param value = " 0 " name = " mute " />
< param value = " full " name = " uiMode " />
< param value = " 0 " name = " stretchToFit " />
< param value = " 0 " name = " windowlessVideo " />
< param value = " -1 " name = " enabled " />
< param value = " -1 " name = " enableContextMenu " />
< param value = " 0 " name = " fullScreen " />
< param value = "" name = " SAMIStyle " />
< param value = "" name = " SAMILang " />
< param value = "" name = " SAMIFilename " />
< param value = "" name = " captioningID " />
< param value = " 0 " name = " enableErrorDialogs " />
< param value = " 6482 " name = " _cx " />
< param value = " 6350 " name = " _cy " />
</ object >
</ td >
< td style = " vertical-align: top; width: 30% " >
播放列表 < br />
< script language = " javascript " type = " text/javascript " >
// JScript 文件
function loadXML(xmlFile)
{
var xmlDoc;
if(window.ActiveXObject)
{
xmlDoc = new ActiveXObject('Microsoft.XMLDOM');
xmlDoc.async = false;
xmlDoc.load(xmlFile);
}
else if (document.implementation&&document.implementation.createDocument)
{
xmlDoc = document.implementation.createDocument('', '', null);
xmlDoc.load(xmlFile);
}
else
{
return null;
}
return xmlDoc;
}
// 一个检查xml文件的函数
checkXMLDocObj = function(xmlFile)
{
var xmlDoc = loadXML(xmlFile);
if(xmlDoc==null)
{
alert('您的浏览器不支持xml文件读取,于是本页面禁止您的操作,推荐使用IE5.0以上可以解决此问题!');
window.location.href='/Index.aspx';
}
return xmlDoc;
}
function doo()
{
// 定义一个读取xml文件的对象
var xmlDoc = checkXMLDocObj('http://s-sps:801/huojian.xml');
var name = new Array();
var url = new Array();
var sum=xmlDoc.getElementsByTagName("pp").length;
for(var i=0; i<sum; i++)
{
url[i]=xmlDoc.getElementsByTagName('media/pp')[i].getAttribute('url');
name[i]=xmlDoc.getElementsByTagName('media/pp')[i].getAttribute('name');
}
var str = new Array();
for(var i=0; i<sum; i++)
{
str[i]="return play('"+url[i]+"')";
}
document.write('<table border="0" cellpadding="0" cellspacing="0">');
for(var i=0; i<sum; i++)
{
var x = i+1;
document.write('<tr><td style="background-image: url(playbj.GIF);background-position:center;background-repeat:no-repeat; width:20px;height:24px; text-align:center;vertical-align:middle;" >'+x+'</td><td>');
document.write('<input id=Button1 type=button value='+name[i].toString()+' οnclick="'+str[i]+'" style="padding:2 0 0 2; border:0px;vertical-align:middle; background-color:#fff;text-align:left;">');
document.write('</td></tr>');
document.write('<tr><td style="height:1px;"><td><tr>');
}
document.write('</table>');
}
function play(urlx)
{
document.all.item("pl").url=urlx;
document.all.item("pl").controls.play();
}
doo();
</ script >
</ td >
</ tr >
< tr >
< td id = " _invisibleIfEmpty " style = " display: none " valign = " top " width = " 100% " colspan = " 2 "
name = " _invisibleIfEmpty " >
</ td >
</ tr >
< script language = " javascript " > if ( typeof (MSOLayout_MakeInvisibleIfEmpty) == " function " ) {MSOLayout_MakeInvisibleIfEmpty();} </ script >
</ tbody >
</ table >