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

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"
......
......

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