2016-10-13 00:16:48 点击量:9 标签: 收藏本文
发布端(Publish.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 var mic:Microphone;
- private var cam:Camera;
- private function init():void
- {
- //加载自己的摄像头
- mic = Microphone.getMicrophone();
- cam = Camera.getCamera();
- var video:Video = new Video();
- video.attachCamera(cam);
- var uiBox:UIComponent = new UIComponent();
- uiBox.addChild(video);
- this.addElement(uiBox);
- nc = new NetConnection();
- nc.addEventListener(NetStatusEvent.NET_STATUS,onNetStatus);
- nc.connect("rtmp://192.168.1.16/virtualShow");
- nc.client = this;
- }
- private function onNetStatus(evt:NetStatusEvent):void
- {
- trace(evt.info.code);
- if(evt.info.code=="NetConnection.Connect.Success")
- {
- var ns:NetStream = new NetStream(nc);
- ns.addEventListener(NetStatusEvent.NET_STATUS,onNetStatus);
- ns.attachAudio(mic);
- ns.attachCamera(cam);
- ns.client = this;
- ns.publish("hxw","live");
- }
- }
- public function onBWDone():void
- {
- }
- ]]>
- </fx:Script>
- </s:Application>
我们是一家提供综合软件外包与弱电工程服务的技术公司。
业务涵盖定制软件、管理系统、网站、小程序、APP、系统集成、网络布线、监控安防、门禁、机房建设及长期技术维护。
公司地址:湖北省宜昌市伍家岗区东站二路6号三峡(宜昌)大数据产业园海洋馆二楼A203室