Live Webcam and Netstream.publish HELP!
Hello! Im new to the forums. Im working on a project for work and im using FMS 3 and AS3. I've gotten to a point where google cant help me anymore. When I get my webcamera with flash and allow the camera to be used it then opens a netstream to the FMS server, which for some reason doesnt work all the way. I can see the new stream being published but i just stops and you cant view it. Here is my code.
var my_nc:NetConnection = new NetConnection();
my_nc.connect("rtmp://my_fms_server_ip/live/livestream");
var camera ;
var video ;
function onCameraStatus( evt ):void {
if (evt.code == "Camera.Muted"){
trace("Camera Access Has Been Denied!") ;
}
if (evt.code == "Camera.Unmuted"){
trace("Camera Access Has Been Granted") ;
}
}
camera = Camera.getCamera() ;
camera.addEventListener(StatusEvent.STATUS, onCameraStatus) ;
if (camera == null)
{
Security.showSettings(SecurityPanel.CAMERA) ;
}else{
video = new Video(camera.width, camera.height) ;
video.attachCamera(camera) ;
addChild(video) ;
}
var my_ns:NetStream = new NetStream(my_nc);
my_ns.attachCamera(camera);
my_ns.publish("cwysong");
Please Help!
