[FMS]AS3.0与FMS的连接测试源代码写法示例
[FMS]AS3.0与FMS的连接测试源代码写法示例
[FMS]AS3.0与FMS的连接测试源代码写法示例
- var fmsIP:String = "127.0.0.1";
- var fmsPath:String = "rtmp://"+fmsIP+"/cuplayer_fms/";
- var myNC:NetConnection = new NetConnection();
- myNC.objectEncoding = ObjectEncoding.AMF0;
- myNC.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
- myNC.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
- function netStatusHandler(event:NetStatusEvent):void {
- switch (event.info.code) {
- case "NetConnection.Connect.Success":
- trace("cuplayer.com提示:连接成功!")
- getStream();
- break;
- case "NetStream.Play.StreamNotFound":
- trace("cuplayer.com提示:未找到视频文件: " + videoURL);
- break;
- }
- }
- function securityErrorHandler(event:SecurityErrorEvent):void {
- trace("cuplayer.com提示:安全沙箱错误侦听: " + event);
- }
- function getStream():void {
- var myNS:NetStream = new NetStream(myNC);
- myNS.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
- movie.Live_video.attachNetStream(myNS);
- myNS.play("1");
- }
- myNC.connect(fmsPath)
极酷阳光播放器CuSunPlayerV2.0版RTMP流媒体播放器:[ Rtmp测试演示1 ]
支持RTMP协议(支持red5,wowza,FMS等rtmp流媒体)[ 演示2 ]
更多演示请点击进入[ 极酷阳光V2版RTMP流媒体播放器专栏 ]
热门文章推荐
- [FMS]Adobe FMS产品(Adobe Flash Media Server)使用介绍(组图)
- [FMS]Flash Media Server之教程附示例代码
- [RTMP]国产RTMP/HLS直播服务器simple-rtmp-server
- [WOWZA]用wowza流媒体服务器发布和播放直播流(RTMP)
- [RTMP]又一款rtmp类的服务器openrtmfp流媒体服务器
- [RTMP]adobe之FMS视频直播解决方案流程介绍(组图)
- [RTMP协议]实时消息传输协议 (RTMP) 常识性介绍
- [FMS]Adobe的Flash Media Server服务器(FMS服务器)安装
请稍候...