In Flex3,NetStream publishs record ,the video has no image,only has voice
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init();">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.core.mx_internal;
import flash.media.Camera;
private var nc:NetConnection;
private var ns:NetStream;
private var crm:Camera;
private var mic:Microphone;
private var shobj:SharedObject;
private var myurl = "rtmp://localhost:8888/video/flv";
private function init():void{
crm = Camera.getCamera();
mic = Microphone.getMicrophone();
if(crm){
crm.setMode(video.width,video.height,200,true);
crm.setQuality(0,70);
video.attachCamera(crm);
conn();
}else{
Alert.show("USING");
}
}
private function conn():void{
nc = new NetConnection();
nc.connect(myurl);
nc.addEventListener(NetStatusEvent.NET_STATUS,onNetStatusHandler);
}
private function onNetStatusHandler(evt:NetStatusEvent):void {
if(evt.info.code=="NetConnection.Connect.Success")
{
shobj = SharedObject.getRemote("show",nc.uri,true);
shobj.addEventListener(SyncEvent.SYNC,sharedObject_func);
shobj.connect(nc);
ns=new NetStream(nc);
ns.addEventListener(NetStatusEvent.NET_STATUS,onNetStatusHandler);
ns.attachCamera(crm);
ns.attachAudio(mic);
ns.publish("tmp_vedio","record");
}
}
]]>
</mx:Script>
<mx:VideoDisplay width="167" height="144" id="video"/>
</mx:Application>
So,I play the record video , but there is no image , just voice . (My compute's carema is good) Anyone can help me ? Thanks.
