[FMS]AS3.0连接FMS2.0的测试代码演示
[FMS]AS3.0连接FMS2.0的测试代码演示
[FMS]AS3.0连接FMS2.0的测试代码演示
- var fmsIP:String = "127.0.0.1";
- var fmsPath:String = "rtmp://"+fmsIP+"/audioOnLine_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("连接成功!")
- 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)
热门文章推荐
- [HLS]做自己的m3u8点播系统使用HTTP Live Streaming(HLS技术)
- [FMS]FMS流媒体服务器配置与使用相关的介绍
- [AS3]什么是M3U8,与HTML5的区别是什么
- AS2.0 让flash自适应全屏,并且不自动缩放
- [AS3]as3.0的sound类常用技巧整理
- [AS3]as3与ByteArray详解、ByteArray介绍、ByteArray用法
- 关于RTMP,RTMPT,RTMPS,RTMPE,RTMPTE协议的介绍
- [JS]分享浏览器弹出窗口不被拦截JS示例
请稍候...