- 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.12 RTMP协议
RTMP(Real Time Messaging Protocol)实时消息传送协议是Adobe Systems公司为Flash播放器和服务器之间音频、视频和数据传输开发的私有协议。
本款阳光播放器v2版,支持rtmp协议,并且在rtmp协议下,可以实现任意点的拖动(无须像http下那样,必须缓冲后的进度条中才可以拖动播放)。在rtmp下,阳光v2的使用方式:只须设置JcScpServer服务器参数,即写上服务器地址即可,很方便,其它代码不变。
简要的说:在rtmp下,JcScpServer的服务器地址参数值,请对应的填入您的服务器地址;在http下,JcScpServer的值,必须为空.
例(7.4)-1:rtmp协议下的播放器调用代码示例1
<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("JcScpServer","rtmp://www.cuplauyer.com/vod"); //rtmp流媒体服务器地址
so.addVariable("JcScpVideoPath","mp4:test.mp4"); //文件地址
so.addVariable("JcScpImg","/player/Images/flashChangfa2.jpg");
so.addVariable("JcScpFile","/player/CuSunV2Set.asp");
<!-- HTML代码参数/End -->
so.write("CuPlayer");
</script>
例(7.4)-2:rtmp协议下的播放器调用代码示例2
第一部分:
<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","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代码如下 :
......
<Flashvars_Set
JcScpServer ="http://www.cuplayer.com/vod" //rtmp流媒体服务器地址
JcScpVideoPath="mp4:test.mp4" //文件地址
ShowJcScpAFront = "yes"
JcScpCountDowns = "10"
JcScpCountDownsPosition = "top-right"
......
......