步骤二:修改ShowSoftDown.asp文件为播放页。
建议利用自定义页面功能为电影频道增加一个文件,如增加文件名为的PlayMovie.asp文件
文件改名后,请仔细看这一贴,下载模块做影视频道终极解决方案http://bbs.powereasy.net/dispbbs.asp?BoardID=28&ID=364522&replyID=&skin=1,在点击播放地址时,调用URL为PlayMovie.asp
1、复制ShowSoftDown.asp文件,重命名为PlayMovie.asp
2、删除多余代码(这里不用的调用)
找到
End If
以下代码除
%>
保留外,其余全部删除。
3、增加对数据库中电影名称、播放ID和播放器的判断。
在
End If
下加入以下代码:
'获取电影名称、ID、播放器
Dim rs, DownID, DownName, DUrlID, Player
DownID = Trim(request("SoftID"))
DUrlID = Trim(request("UrlID"))
Call openconn
Set rs = Conn.Execute("select SoftName,MY_Player from PE_Soft where SoftID = " & DownID & " ")
DownName = rs("SoftName")
Player = rs("MY_Player")
Set rs = Nothing
Call closeconn
'获取电影名称、ID、播放器
注意,红色部分请与你的播放器自定义字段名保持一致。
4、增加播放器的判断条件:
在文件下面加入以下代码:
<%
IF Player = "XunleiPlayer" Then
DownloadUrl=replace(DownloadUrl," http://v.xueol.com/UploadFiles_7325/ ","")
ShowXunleiPlayer (DownloadUrl)
ElseIF Player = "RealPlayer" Then
ShowRealPlayer (DownloadUrl)
ElseIF Player = "MediaPlayer" Then
ShowMediaPlayer (DownloadUrl)
ElseIF Player = "SwfPlayer" Then
ShowSwfPlayer (DownloadUrl)
ElseIF Player = "FlvPlayer" Then
ShowFlvPlayer (DownloadUrl)
ElseIF Player = "BoboPlayer" then
DownloadUrl=BoBoConvert(DownloadUrl,SiteUrl)
ShowP2PPlayer (DownloadUrl)
ElseIF Player = "P2PPlayer" then
ShowP2PPlayer (DownloadUrl)
End If
%>
绿色部分对应你的电影频道播放器字段中的选择值。
红色部分请修改为你的电影频道URL和上传目录。如你的电影频道URL是http://bbs.powereasy.net/movie/,上传目录是UploadFiles,此处即改为http://bbs.powereasy.net/movie/UploadFiles/
5、增加播放器:在文件最下面加入以下代码,注意红色部分是播放器的输出语句,每一段对应一个播放器。
<%
Function ShowMediaPlayer(strUrl)
%>
<OBJECT id="Playerd" codeBase=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701standby=Loading type=application/x-oleobject height=453 width=563 classid=CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6 VIEWASTEXT><PARAM NAME="URL" VALUE="<%=strUrl%>"><PARAM NAME="rate" VALUE="1"><PARAM NAME="balance" VALUE="0"><PARAM NAME="currentPosition" VALUE="-1"><PARAM NAME="defaultFrame" VALUE=""><PARAM NAME="playCount" VALUE="1"><PARAM NAME="autoStart" VALUE="-1"><PARAM NAME="currentMarker" VALUE="0"><PARAM NAME="invokeURLs" VALUE="-1"><PARAM NAME="baseURL" VALUE=""><PARAM NAME="volume" VALUE="70"><PARAM NAME="mute" VALUE="0"><PARAM NAME="uiMode" VALUE="full"><PARAM NAME="stretchToFit" VALUE="-1"><PARAM NAME="windowlessVideo" VALUE="0"><PARAM NAME="enabled" VALUE="-1"><PARAM NAME="enableContextMenu" VALUE="0"><PARAM NAME="fullScreen" VALUE="0"><PARAM NAME="SAMIStyle" VALUE=""><PARAM NAME="SAMILang" VALUE=""><PARAM NAME="SAMIFilename" VALUE=""><PARAM NAME="captioningID" VALUE=""><PARAM NAME="enableErrorDialogs" VALUE="0"><PARAM NAME="_cx" VALUE="11906"><PARAM NAME="_cy" VALUE="9790"></OBJECT>
<%
End Function
Function ShowRealPlayer(strUrl)
%>
<OBJECT height=395 width=563 classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA id="Playerd"><PARAM NAME="_ExtentX" VALUE="7938"><PARAM NAME="_ExtentY" VALUE="5292"><PARAM NAME="AUTOSTART" VALUE="-1"><PARAM NAME="SHUFFLE" VALUE="0"><PARAM NAME="PREFETCH" VALUE="0"><PARAM NAME="NOLABELS" VALUE="0"><PARAM NAME="SRC" VALUE="<%=strUrl%>"><PARAM NAME="CONTROLS" VALUE="ImageWindow"><PARAM NAME="CONSOLE" VALUE="Clip1"><PARAM NAME="LOOP" VALUE="0"><PARAM NAME="NUMLOOP" VALUE="0"><PARAM NAME="CENTER" VALUE="0"><PARAM NAME="MAINTAINASPECT" VALUE="0"><PARAM NAME="BACKGROUNDCOLOR" VALUE="#000000"></OBJECT><BR>
<OBJECT height=60 width=563 classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA><PARAM NAME="_ExtentX" VALUE="7938"><PARAM NAME="_ExtentY" VALUE="1588"><PARAM NAME="AUTOSTART" VALUE="0"><PARAM NAME="SHUFFLE" VALUE="0"><PARAM NAME="PREFETCH" VALUE="0"><PARAM NAME="NOLABELS" VALUE="0"><PARAM NAME="CONTROLS" VALUE="ControlPanel,StatusBar"><PARAM NAME="CONSOLE" VALUE="Clip1"><PARAM NAME="LOOP" VALUE="0"><PARAM NAME="NUMLOOP" VALUE="0"><PARAM NAME="CENTER" VALUE="0"><PARAM NAME="MAINTAINASPECT" VALUE="0"><PARAM NAME="BACKGROUNDCOLOR" VALUE="#000000"></OBJECT>
<%
End Function
Function ShowSwfPlayer(strUrl)
%>
<OBJECT codeBase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0 height=453 width=563 classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 id="Playerd"><PARAM NAME="_cx" VALUE="12674"><PARAM NAME="_cy" VALUE="10636"><PARAM NAME="FlashVars" VALUE=""><PARAM NAME="Movie" VALUE="<%=strUrl%>"<PARAM NAME="Src" VALUE="<%=strUrl%>"<PARAM NAME="WMode" VALUE="Window"><PARAM NAME="Play" VALUE="-1"><PARAM NAME="Loop" VALUE="-1"><PARAM NAME="Quality" VALUE="High"><PARAM NAME="SAlign" VALUE=""><PARAM NAME="Menu" VALUE="-1"><PARAM NAME="Base" VALUE=""><PARAM NAME="AllowScriptAccess" VALUE=""><PARAM NAME="Scale" VALUE="ShowAll"><PARAM NAME="DeviceFont" VALUE="0"><PARAM NAME="EmbedMovie" VALUE="0"><PARAM NAME="BGColor" VALUE=""><PARAM NAME="SWRemote" VALUE=""><PARAM NAME="MovieData" VALUE=""><PARAM NAME="SeamlessTabbing" VALUE="1"><PARAM NAME="Profile" VALUE="0"><PARAM NAME="ProfileAddress" VALUE=""><PARAM NAME="ProfilePort" VALUE="0"><PARAM NAME="AllowNetworking" VALUE="all"><PARAM NAME="AllowFullScreen" VALUE="false">
><embed src="<%=strUrl%>" pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width=480 height=405></embed></OBJECT>
<%
End Function
Function ShowFlvPlayer(strUrl)
%>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="563" height="453" id="Playerd">
<param name="movie" value="Flvplayer.swf">
<param name="quality" value="high">
<param name="allowFullScreen" value="true" />
<param name="FlashVars" value="vcastr_file=<%=strUrl%>&LogoText=www.SHiove.com&BufferTime=3" />
<embed src="Flvplayer.swf" allowFullScreen="true" FlashVars="vcastr_file=<%=strUrl%>&LogoText=www.SHiove.com" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="450" height="380"></embed>
</object>
<%
End Function
Function ShowXunleiPlayer(strUrl)
%>
<!--请在页面中需要展现的位置加入代码,尺寸为500x420-->
<script src="http://play.kankan.xunlei.com/u/UPlayer/KKPlayer.js"></script><div id="KKPlayerContainer" width="563" height="420" autoplay="1" unid="22722" source="<%=strUrl%>"></div>
<%
End Function
Function ShowP2PPlayer(strUrl)
%>
<SCRIPT LANGUAGE="JavaScript">
function CheckPlayer()
{
var bobo;
try
{
bobo = new ActiveXObject("BOBO_ACTIVEX_V3.BoBo_V3Ctrl.1");
if( bobo == null )
{
window.alert("请安装BoBo P2P多媒体点播/广播/直播控件!");
return false;
}
}
catch( e )
{
window.alert("请安装BoBo P2P多媒体点播/广播/直播控件!");
return false;
}
delete bobo;
return true;
}
CheckPlayer()
</SCRIPT>
<TABLE width="100%" border=0 cellPadding=0 cellSpacing=0>
<TBODY>
<TR>
<TD width=563 height=390>
<object id="Playerd" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" height="100%" width="100%" viewastext="" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject" style="display:none">
<param name="URL" value="" />
<param name="animationatStart" value="true" />
<param name="autoStart" value="true" />
<param name="showControls" value="true" />
</object>
<div id="hg">
<embed name=RealObj src=test.rpm width="100%" height="100%" maintainaspect="true" controls="ImageWindow" console="one"></div></TD>
</TR><tr><td height="22" valign="bottom">
<object id="Playerd" width="100%" height="22" classid="clsid:EC0978ED-24E3-403C-AB7A-060E388553E6" codebase="http://www.17BoBo.com/Software/BoBo_ActiveX_V3.ocx">
<param name="MaxLinkCount" value="100" />
<param name="MaxCacheTimeS" value="120" />
<param name="MinCacheTimeS" value="60" />
<param name="MaxCacheSizeMB" value="100" />
<param name="MaxDownloadKbps" value="800" />
<param name="MaxUploadKbps" value="500" />
<param name="RealMediaType" value=".mp4,.mp3" />
<param name="AllowDrag" value="1" />
<param name="ActName" value="<%=strUrl%>" />
</object></td></tr></TBODY></TABLE>
<%
End Function
%>
呵呵