在线客服QQ: 176797520 极酷FlvPlayer在线客服 酷播网页视频播放器

4.11 RTMP协议

  RTMP(Real Time Messaging Protocol)实时消息传送协议是Adobe Systems公司为Flash播放器和服务器之间音频、视频和数据传输 开发的私有协议。
本款阳光播放器v2版,支持rtmp协议,并且在rtmp协议下,可以实现任意点的拖动(无须像http下那样,必须缓冲后的进度条中才可以拖动播放)。在rtmp下,阳光v2的使用方式:只须设置JcScpServer服务器参数,即写上服务器地址即可,很方便,其它代码不变。
简要的说:在rtmp下,JcScpServer的服务器地址参数值,请对应的填入您的服务器地址;在http下,JcScpServer的值,必须为空.

 

以FMS软件为例,如下图,它有两个地地址,一个是server服务器地址,一个是stream发布点称

 
例(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.cuplayer.com/live"); //服务器地址
so.addVariable("JcScpVideoPath","livestream"); //发布点名称
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/live"//服务器地址

JcScpVideoPath="livestream" //发布点名称
......
......

配置Adobe Flash Media Server流媒体服务器,可以参考如下

专业级流媒体直播技术服务 http://live.cuplayer.com

摄像机直播 - 电视节目直播 - USB摄像头直播 - 监控摄像头直播 - 编码机直播 - 电脑桌面直播