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

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

......
......

例(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>