- 4.代码使用
- 4.1 [A]swfObject调用
- 4.2 [B]object调用
- 4.3 [C]Ebemb调用
- 4.4 [D]JS形式调用
- 4.5 函数接口
- 4.6 广告相关
- [1] 前置广告
- [2] 视频广告
- [3] 暂停广告
- [4] 角标广告
- [5] 后置广告
- 4.7 开灯关灯
- 4.8 高清模式
- 4.9 分享模式
- 4.10 视频模式
- 4.11 RTMP点播
- 4.12 RTMP直播
- 4.13 视频结束动作
- 4.14 色彩自定义
- 4.15 移动终端适配(New)
- 4.16 HLS直播(m3u8适配)
- 4.17 适配PC/安卓/苹果
- 4.18 收费模式(节目预览)
6.1 与ASP+Access结合的应用
- 高级应用可以实现通过获取FlvID或ListID这样的参数,传给JcScpFile[配置文件],配置文件接收传过来的FlvID或ListID,再进行查询数据库,最终匹配出对应的配置文件参数,从而播放视频。
- 简要过程说明(本例以ASP为例):
- 1. /Player/player.swf?FlvID=745,此处写入视频ID;
- 2. JcScpFile[配置文件]/Player/CuSunV2Set.asp会接收以上传过来的FlvID=745,此时,也就是相当于/Player/CuSunV2Set.asp?FlvID=745
- 3. 现在很清楚了,就是在/Player/CuSunV2Set.asp?FlvID=745中,程序获取FlvID=745,再进行查询数据库,匹配出对应的配置文件参数
- 例(3)-1:使用[ HTML代码参数 ]
- 第一部分:在html中使用您需要的[ HTML代码参数 ]
-
<script type="text/javascript" src="images/swfobject.js"></script>
<div class="video" id="CuPlayer"><b>网页视频播放器加载中,请稍后...</b></div>
<script type="text/javascript">
var so = new SWFObject("/Player/player.swf?FlvID=745","ply","520","325","9","#000000");
so.addParam("allowfullscreen","true");
so.addParam("allowscriptaccess","always");
so.addParam("wmode","opaque");
so.addParam("quality","high");
so.addParam("salign","lt");
so.addVariable("JcScpFile","/Player/CuSunV2Set.asp");
so.write("CuPlayer");
</script>
-
- 第二部分,以下是配置文件/Player/CuSunV2Set.asp代码如下 (提示:注意以下的标红的数字序号) :
-
<!--#include file="conn.asp"-->
<% -
FlvID=Safecheckstr(request("FlvID")) '①. 获取第一部分中传过来的FlvID值
if FlvID="" then
response.write("<script>alert('参数错误!');window.close();</script>")
response.end
end if
if not isnumeric(FlvID) then
response.write("<script>alert('参数错误!');window.close();</script>")
response.end
end if
’②. 此处对传过来FlvID的值,进行查询
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
'④. 此处得出查询结果
JcScpVideoPath=rs("JcScpVideoPath")
JcScpVideoPathHD=rs("JcScpVideoPathHD")
JcScpImg=rs("JcScpImg")
rs.close
set rs=nothing
conn.close
set conn=nothing
end if%>
-
<?xml version="1.0" encoding="gb2312"?>
<CuPlayer>
<Player_Set
JcScpBufferTime = "5"
JcScpVolume = "75"
JcScpAutoPlay = "yes"
JcScpAutoRepeat = "no"
JcScpImgDisplay = "no"
JcScpAutoHideControl="no"
JcScpControlHideTime="0.5"
JcScpControlHeight="40"
JcScpShowList= "showad"
JcScpShowListInfo= "no,yes,next,showad"
JcScpsetMode = "1"
JcScpsetModeInfo ="1:exactMode,2:strechMode,3:normalMode:,4:doubleMode"
JcScpCode = "gb2312"
JcScpAFrontCanClose = "no"/>
<Logo_Set
JcScpLogoDisplay = "yes"
JcScpLogoPath = "Images/logo.png"
JcScpLogoPosition = "top-left"
JcScpLogoWidth = "165"
JcScpLogoHeight = "55"
JcScpLogoAlpha = "0.5"
/>
<Flashvars_Set
JcScpServer =""
<!-- ⑤. 赋值给对应的参数,用以传入播放器进行播放。至此传值完毕-->
JcScpVideoPath = "<%=JcScpVideoPath%>"
JcScpVideoPathHD = "<%=JcScpVideoPathHD%>"
JcScpImg ="<%=JcScpImg%>"
ShowJcScpAFront = "yes"
JcScpCountDowns = "10"
JcScpCountDownsPosition = "top-right"
JcScpAFrontW = "645"
JcScpAFrontH = "300"
JcScpAFrontPath = "Images/SevenColorPlayer_650x418.swf"
JcScpAFrontLink = "http://yxp.163.com/act/20120214.html"
ShowJcScpAVideo= "no"
JcScpAVideoPath= "http://vf1.mtime.cn/Video/2012/07/11/flv/120711093250238753.flv"
JcScpAVideoLink= "http://yxp.163.com/act/20120214.html"
ShowJcScpAPause = "yes"
JcScpAPausePath = "Images/SevenColorPlayer_a1.swf"
JcScpAPauseW = "375"
JcScpAPauseH = "230"
JcScpAPauseLink= "http://yxp.163.com/act/20120214.html"
ShowJcScpACorner = "yes"
JcScpACornerPath= "Images/SevenColorPlayer_a10.swf"
JcScpACornerW = "80"
JcScpACornerH = "50"
JcScpACornerPosition = "top-right"
JcScpACornerLink = "http://yxp.163.com/act/20120214.html"ShowJcScpAEnd = "yes"
JcScpAEndPath = "Images/Cover_changfa.jpg"
JcScpAEndW = "400"
JcScpAEndH = "200"
JcScpAEndLink= "http://yxp.163.com/act/ShowJcScpAEnd466.html"
/>......
......
-