CuPlayer与ASP程序结合演示

三分地 / 50人浏览 / 0人评论

网页部分代码写法参考:

<%
FlvID=request("id")
if FlvID="" then
FlvID=1
end if
if not isnumeric(FlvID) then
response.write("<script>alert('参数错误2!');window.close();</script>")
response.end
end if 
%>
<script type="text/javascript" src="images/swfobject.js"></script>
<script type="text/javascript">
var so = new SWFObject("CuPlayerMiniV4.swf","ply","600","410","9","#000000");
so.addParam("allowfullscreen","true");
so.addParam("allowscriptaccess","always");
so.addParam("wmode","opaque");
so.addParam("quality","high");
so.addParam("salign","lt");
so.addVariable("CuPlayerSetFile","CuPlayerSetFile.asp?id=<%=FlvID%>"); //播放器配置文件地址,可以接参数
so.write("CuPlayer");
</script>

程序文件CuPlayerSetFile.asp写法参考:

<%
FlvID=request("id") 
if FlvID="" then
response.write("<script>alert('参数错误1!');window.close();</script>")
response.end
end if
if not isnumeric(FlvID) then
response.write("<script>alert('参数错误2!');window.close();</script>")
response.end
end if
sql="select * from JcPlayer where JcPlayer_ID="&FlvID
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if rs.eof then
response.write "<script>window.alert('系统未找到此视频!');javascript:location='/';</script>"
response.end
else
flvurl=rs("VideoPath")
rs.close
set rs=nothing
conn.close
set conn=nothing
end if
%> 
<content>
<CuPlayerWidth>600</CuPlayerWidth>
<CuPlayerHeight>410</CuPlayerHeight>
<CuPlayerAutoPlay>yes</CuPlayerAutoPlay> 
<CuPlayerImage>images/start.jpg</CuPlayerImage>
<CuPlayerLogo>images/Logo.png</CuPlayerLogo>
<CuPlayerPosition>top-right</CuPlayerPosition>
<CuPlayerFile><%=flvurl%></CuPlayerFile>
</content>


0 条评论

还没有人发表评论

发表评论 取消回复

记住我的信息,方便下次评论
有人回复时邮件通知我