NetConnection.Connect.Rejected
Hi,
I am newbie FMS.
Just i installed FMS 4.
created a swf..... the code is
var nc:NetConnection;
var ns:NetStream;
var nsPlayer:NetStream;
var vid:Video;
var vidPlayer:Video;
var cam:Camera;
var mic:Microphone;
nc = new NetConnection();
nc.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
nc.connect("rtmp://localhost/publishlive");
publishCamera();
displayPublishingVideo();
displayPlaybackVideo();
function onNetStatus(event:NetStatusEvent):void{
trace(event.info.code);
txt.text = event.info.code;
if(event.info.code == "NetConnection.Connect.Success"){
publishCamera();
displayPublishingVideo();
displayPlaybackVideo();
}
}
function publishCamera() {
cam = Camera.getCamera();
mic = Microphone.getMicrophone();
ns = new NetStream(nc);
ns.attachCamera(cam);
ns.attachAudio(mic);
ns.publish("myCamera", "live");
}
function displayPublishingVideo():void {
vid = new Video();
vid.x = 10;
vid.y = 10;
vid.attachCamera(cam);
addChild(vid);
}
function displayPlaybackVideo():void{
nsPlayer = new NetStream(nc);
nsPlayer.play("myCamera");
vidPlayer = new Video();
vidPlayer.x = cam.width + 20;
vidPlayer.y = 10;
vidPlayer.attachNetStream(nsPlayer);
addChild(vidPlayer);
}
I saved the file in the path "C:\Program Files\Adobe\Flash Media Server 4\webroot\publishlive"
When i execute the file from Firefox "http://localhost/publishlive/vr.swf"
It show me errors like
NetConnection.Connect.Rejected
NetConnection.Connect.Closed
Please help me to solve this.
thanks,
shanthi
