- 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 收费模式(节目预览)
4.1 swfObject调用
swfObject调用,是指通过第三方flash加载模块( swfobject.js ),调用本款flash播放器。虽然swfobject.js并不是adobe官方提供的,但由于其使用方便,并且swfobject参数的写法,简洁明了,所以本站比较推荐使用这种调用方式。
例(4.1)-1:swfObject模式调用示例1
<script type="text/javascript" src="/player/images/swfobject.js"></script>
<div class="video" id="CuPlayer"><b>网页视频播放器加载中,请稍后...</b></div>
<script type="text/javascript">
var so = new SWFObject("/Player/player.swf","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.xml");
so.addVariable("JcScpVideoPath","http://demo.cuplayer.com/file/test.mp4");
so.addVariable("JcScpImg","/player/Images/flashChangfa2.jpg");
so.write("CuPlayer");
</script>
例(4.1)-2:swfObject模式调用示例2
<script type="text/javascript" src="/player/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>
例(4.1)-3:swfObject模式调用示例3
<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","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","CuSunV2set.asp");
//视频文件及略缩图--------------------------
//so.addVariable("JcScpServer","rtmp://www.yoursite.com/vod");
so.addVariable("JcScpVideoPath","http://demo.cuplayer.com/file/test.mp4");
so.addVariable("JcScpVideoPathHD","http://demo.cuplayer.com/file/test.mp4");
so.addVariable("JcScpImg","Images/flashChangfa2.jpg");
//-前置Flash广告-----------------------------
so.addVariable("ShowJcScpAFront","yes");
so.addVariable("JcScpCountDownsPosition","top-left");
so.addVariable("JcScpCountDowns","4");
so.addVariable("JcScpAFrontW","520");
so.addVariable("JcScpAFrontH","325");
so.addVariable("JcScpAFrontPath","Images/SevenColorPlayer_650x418.swf");
so.addVariable("JcScpAFrontLink","http://yxp.163.com/act/20120214.html");
//-视频广告参数-----------------------------
so.addVariable("ShowJcScpAVideo","no");
so.addVariable("JcScpAVideoPath","http://www.roewe.com.cn/download/roewew5/video/01/video/1.flv");
so.addVariable("JcScpAVideoLink","http://www.roewe.com.cn");
//-暂停广告参数-----------------------------
so.addVariable("ShowJcScpAPause","yes");
so.addVariable("JcScpAPauseW","375");
so.addVariable("JcScpAPauseH","230");
so.addVariable("JcScpAPausePath","Images/Apause375x250.jpg");
so.addVariable("JcScpAPauseLink","http://yxp.163.com/act/20120214.html");
//-角标广告参数-----------------------------
so.addVariable("ShowJcScpACorner","yes");
so.addVariable("JcScpACornerW","85");
so.addVariable("JcScpACornerH","50");
so.addVariable("JcScpACornerPath","Images/SevenColorPlayer_a10.swf");
so.addVariable("JcScpACornerPosition","bottom-right");
so.addVariable("JcScpACornerLink","http://www.163.com");
//-----------------------------------------
so.addVariable("JcScpSharetitle","标题信息");
so.write("CuPlayer");
</script>
- swfObject调用,是指通过第三方flash加载模块( swfobject.js ),调用本款flash播放器。虽然swfobject.js并不是adobe官方提供的,但由于其使用方便,并且swfobject参数的写法,简洁明了,所以本站比较推荐使用这种调用方式。