- 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 收费模式(节目预览)
7.4 RTMP协议
-
RTMP(Real Time Messaging Protocol)实时消息传送协议是Adobe Systems公司为Flash播放器和服务器之间音频、视频和数据传输 开发的私有协议。
本款阳光播放器v2版,支持rtmp协议,并且在rtmp协议下,可以实现任意点的拖动(无须像http下那样,必须缓冲后的进度条中才可以拖动播放)。在rtmp下,阳光v2的使用方式:只须设置JcScpServer服务器参数,即写上服务器地址即可,很方便,其它代码不变。
简要的说:在rtmp下,JcScpServer的服务器地址参数值,请对应的填入您的服务器地址;在http下,JcScpServer的值,必须为空.
- 例(7.4)-1:rtmp协议下的播放器调用代码示例
-
-
<script type="text/javascript">
var so = new SWFObject("/Player/CuSunPlayerV20_S.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("JcScpServer","rtmp://www.89525.net/vod"); //注意此处填入了rtmp流媒体服务器地址
so.addVariable("JcScpVideoPath","myfile.flv");
so.addVariable("JcScpImg","/player/Images/flashChangfa2.jpg");
so.addVariable("JcScpFile","/player/CuSunV2Set.asp");
<!-- HTML代码参数/End -->so.write("CuPlayer");
</script>
-
- 例(7.4)-2:rtmp协议下的播放器调用代码示例
- 第一部分:
-
<script type="text/javascript" src="images/swfobject.js"></script>
<script type="text/javascript">
var so = new SWFObject("/Player/CuSunPlayerV20_S.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.asp");
so.write("CuPlayer");
</script>
-
- 第二部分,以下是配置文件CuSunV2Set.asp代码如下 :
- <?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/logov22.png"
JcScpLogoPosition = "top-left"
JcScpLogoWidth = "165"
JcScpLogoHeight = "55"
JcScpLogoAlpha = "0.5"
/>
<Flashvars_Set
JcScpServer ="http://www.89525.net/vod" //注意此处填入了rtmp流媒体服务器地址
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"
/>......
......
- <?xml version="1.0" encoding="gb2312"?>
- 例(7.4)-3:http协议下的播放器调用代码示例
-
-
<script type="text/javascript">
var so = new SWFObject("/Player/CuSunPlayerV20_S.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("JcScpServer",""); //注意此处必须为空
so.addVariable("JcScpVideoPath","myfile.flv");
so.addVariable("JcScpImg","/player/Images/flashChangfa2.jpg");
so.addVariable("JcScpFile","/player/CuSunV2Set.asp");
<!-- HTML代码参数/End -->so.write("CuPlayer");
</script>
-