- 3.代码使用
- 3.1 [A]swfObject调用
- 3.2 [B]object调用
- 3.3 [C]Ebemb调用
- 3.4 [D]JS形式调用
- 3.5 getNext函数用法
- 3.6 与ASP程序结合
- 3.7 与PHP程序结合
- 3.8 与.Net程序结合
- 3.9 与JSP程序结合
参数名称 | 数据类型 | 参数描述 | 备注 |
CuPlayerFile | String | 视频文件地址 | 支持flv,mp4,mov,f4v,3gp格式视频文件 |
CuPlayerImage | String | 视频缩图 | 支持jpg,png,gif , 必须存在,否则将影响正常播放 |
CuPlayerWidth | Number | 播放器宽度 | 宽度值为像素 |
CuPlayerHeight | Number | 播放器高度 | 宽度值为像素 |
CuPlayerAutoPlay | String | 是否自动播放 | 值为yes / no |
CuPlayerLogo | String | 用户Logo文件地址 | 推荐.png,支持jpg,png,gif |
CuPlayerPosition | String | 用户Logo显示的位置 | 值为top-right / top-left / bottom-left / bottom-right 右上角/左上角/左下角/右下角 |
CuPlayerSetFile.xml文件示例: //播放器设置文件地址,例SetFile.xml、SetFile.asp、SetFile.php、SetFile.aspx
<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>test.mp4</CuPlayerFile>
</content>
示例2-2-1:与ASP程序交互示例:
html部分
<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>