[FMS]FMS实现视频聊天的代码示例(含发布端和接收端)(2)
接收端(Receive.mxml) ? xml version = 1.0 encoding = utf-8 ? s:Application xmlns:fx = http://ns.adobe.com/mxml/2009 xmlns:s = library://ns.adobe.com/flex/spark xmlns:mx = library://ns.adobe.com/flex/m
接收端(Receive.mxml)
- <?xml version="1.0" encoding="utf-8"?>
- <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
- xmlns:s="library://ns.adobe.com/flex/spark"
- xmlns:mx="library://ns.adobe.com/flex/mx" initialize="init()">
- <s:layout>
- <s:BasicLayout/>
- </s:layout>
- <fx:Declarations>
- <!-- 将非可视元素(例如服务、值对象)放在此处 -->
- </fx:Declarations>
- <fx:Script>
- <![CDATA[
- import mx.core.UIComponent;
- private var nc:NetConnection;
- private function init():void
- {
- nc = new NetConnection();
- nc.connect("rtmp://192.168.1.16/virtualShow");
- nc.addEventListener(NetStatusEvent.NET_STATUS,onNetStatus);
- nc.client = this;
- }
- private function onNetStatus(evt:NetStatusEvent):void
- {
- var ns:NetStream = new NetStream(nc);
- ns.play("hxw");
- var video:Video = new Video();
- video.attachNetStream(ns);
- var uiBox:UIComponent = new UIComponent();
- uiBox.addChild(video);
- this.addElement(uiBox);
- }
- public function onBWDone():void
- {
- }
- ]]>
- </fx:Script>
- </s:Application>
热门文章推荐
- [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服务器)安装
请稍候...