PDA

View Full Version : Web Cam Problem in Media Server


supriyopaul
09-20-2007, 02:34 PM
I have developed an web cam feed it is working, when i embed it in a html page it is also working, but the file when the html is opened from other machines the web cam feed is not available, the net connection is connecting but a blank white background is visible in place of the video.

Here is the code:-

var interval:Number;
var myCam:Camera = Camera.get();
var nc:NetConnection = new NetConnection();
nc.connect("rtmp://fms-stream.flukii.com/Live_Cam");
myCam.setMode(320,240,30);
myCam.setQuality(0,80);
myCam.setKeyFrameInterval(5);
/*trace(myCam.bandwidth) //Clients Requirement
trace(myCam.fps)
trace(myCam.quality)*/
//
nc.onStatus = function(info:Object) {
if (String(info.code) == "NetConnection.Connect.Success") {
connectStatus_mc.gotoAndStop(2);
//
cam_vid.attachVideo(myCam);
ns.attachVideo(myCam);
ns.attachAudio(Microphone.get());
if (String(_root.save1).toLowerCase() == "yes") {
ns.publish("live_","record");
} else {
ns.publish("live_","record");
}
//
if (String(_root.camType).toLowerCase() == "livecam") {
interval = setInterval(checkEventTime, 1000);
}
} else {
connectStatus_mc.gotoAndStop(3);
trace(myCam.activityLevel);
}
for (var i in info) {
trace("Broadcaster: "+i+" == "+String(info[i]));
trace_txt.text += "\n"+i+" == "+String(info[i]);
}
};


any advise will be appreciated ....

supriyopaul
09-21-2007, 03:42 PM
yeah... I have got the Solution -


here is the code:-

var nc:NetConnection = new NetConnection();
nc.connect("rtmp://fms-stream.flukii.com/Live_Cam");
var cam = Camera.get();
cam.onStatus = function(infoObj) {
trace(infoObj.code);
};
nc.onStatus = function(info:Object) {
trace(info.code)
};
cam_vid.attachVideo(cam);
var active_mic = Microphone.get();
active_mic.setUseEchoSuppression(true);
this.createEmptyMovieClip("sound_mc",Depth.getRealDepth(_root));
sound_mc.attachAudio(active_mic);
var snd = new Sound(sound_mc);
snd.setVolume(0);
var outns = new NetStream(_root.nc);
outns.onStatus = function(data) {
trace("outns:"+data.code);
};
outns.attachVideo(cam);
outns.attachAudio(active_mic);
outns.publish("stream","live");
var inns = new NetStream(_root.nc);
inns.onStatus = function(data) {
trace("inns:"+data.code);
};
inns.play("stream");
cam_vid.attachVideo(inns);