3.1 基础应用

 

基础应用是为了方便操作,一种简单便捷的使用播放器的方法,[基础应用]不涉及直接调用视频ID查询数据库的方式,去获取视频的各项参数。

基础应用主要涉及[HTML代码参数],高级应用则主要涉及[配置文件参数] 涉及调用视频ID查询数据库,从而获取视频参数的[高级应用],会在[高级应用]介绍中详细说明。这种应用在一些CMS中很常用,在CMS的模版中,您只需要调出一两个播放器参数,就可以正常使用播放器的,如下例子调出JcScpVideoPath,JcScpImg:

 

例(3.1)-1:使用[ HTML代码参数 ]

第一部分:在html中使用您需要的[ HTML代码参数 ]

<script type="text/javascript" src="/player/images/swfobject.js"></script>
<div class="video" id="CuPlayer"> <b> <img src="/player/images/loading.gif" /> 网页视频播放器加载中,请稍后...</b> </div>
<script type="text/javascript">
var so = new SWFObject("/player/player.swf","ply","980","460","9","#000000");
so.addParam("allowfullscreen","true");
so.addParam("allowscriptaccess","always");
so.addParam("wmode","opaque");
so.addParam("quality","high");
so.addParam("salign","lt");
<!-- HTML代码参数/Begin -->
so.addVariable("JcScpVideoPath","http://www.roewe.com.cn/roewew5/video/1.flv");
so.addVariable("JcScpImg","/player/Images/flashChangfa2.jpg");
so.addVariable("JcScpFile","/player/CuSunV3Set.asp");
<!-- HTML代码参数/End -->
so.write("CuPlayer");
</script>

 

第二部分: 以下是[ 配置文件参数 ] JcScpFile参数中“/player/CuSunV3Set.asp”中的部分代码:

......
<Flashvars_Set
JcScpServer ="" 
JcScpVideoPath = "test1.flv"  //由于JcScpVideoPath参数值在[ HTML代码参数 ] 中已经取到了 ,此处参数值无效
JcScpImg ="Images/flashChangfa2.jpg"  //由于 JcScpImg参数值已经取到了,此处参数值无效
JcScpVideoPathHD = "test1HD.flv"  //此参数在[ HTML代码参数 ] 没有取到值,播放器将从此处取值
JcScpHotList ="http://yxp.163.com/act/20120214.html" //同样,播放器也将从此处取此参数的值
ShowJcScpAFront = "yes" //同上
JcScpCountDowns = "25" //同上
JcScpCountDownsPosition = "top-left" //同上
JcScpAFrontW = "615" //同上
JcScpAFrontH = "400" //同上
JcScpAFrontPath = "Images/960-400[15].swf"   //同上
......

 

例(3.1)-2:HTML代码参数范例 简写 (加载xml配置文件的参考)

<!--极酷播放器/代码开始-->
<script type="text/javascript" src="/player/images/swfobject.js"></script>
<div class="video" id="CuPlayer"><b><img src="/player/images/loading.gif" /> 网页视频播放器加载中,请稍后...</b></div>
<script type="text/javascript">
var so = new SWFObject("/player/player.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("JcScpFile","/player/CuSunV4set.xml"); //加载xml后辍的配置文件
//视频文件及略缩图--------------------------
so.addVariable("JcScpVideoPath","http://demo.cuplayer.com/file/test.mp4"); //视频地址
so.addVariable("JcScpImg","/player/images/startpic.jpg"); //视频图片
so.write("CuPlayer");
</script>
<!--极酷播放器/代码结束-->

 

例(3.1)-3:HTML代码参数范例 简写 (加载asp配置文件的参考)

<!--极酷播放器/代码开始-->
<script type="text/javascript" src="/player/images/swfobject.js"></script>
<div class="video" id="CuPlayer"><b><img src="/player/images/loading.gif" /> 网页视频播放器加载中,请稍后...</b></div>
<script type="text/javascript">
var so = new SWFObject("/player/player.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("JcScpFile","/player/CuSunV3set.asp"); //加载asp后辍的配置文件,可以方便与asp程序交互
//视频文件及略缩图--------------------------
so.addVariable("JcScpVideoPath","http://demo.cuplayer.com/file/test.mp4"); //视频地址
so.addVariable("JcScpImg","/player/images/startpic.jpg"); //视频图片
so.write("CuPlayer");
</script>
<!--极酷播放器/代码结束-->

 

例(3.1)-4:HTML代码参数范例 简写 (加载php配置文件的参考)

<!--极酷播放器/代码开始-->
<script type="text/javascript" src="/player/images/swfobject.js"></script>
<div class="video" id="CuPlayer"><b><img src="/player/images/loading.gif" /> 网页视频播放器加载中,请稍后...</b></div>
<script type="text/javascript">
var so = new SWFObject("/player/player.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("JcScpFile","/player/CuSunV3set.php"); //加载php后辍的配置文件,可以方便与php程序交互
//视频文件及略缩图--------------------------
so.addVariable("JcScpVideoPath","http://demo.cuplayer.com/file/test.mp4"); //视频地址
so.addVariable("JcScpImg","/player/images/startpic.jpg"); //视频图片
so.write("CuPlayer");
</script>
<!--极酷播放器/代码结束-->