Testing Webcam with Flash Communication Server/Flash Media Server

The Flash Media Server/Flash Communication Server is a server of stream developed by Macromedia, with it can be developed applicatory of the most varied as complex videoconferences , chats, stream of audio, video and what more the imagination to allow. We will see with the time as to develop a complex application and robust using the FMS/FCS, however, I go to look for to show as to make this without using the ready components of the Flash.

Installing and creating its first application in FlahCom
Having the FMS/FCS installed correctly in its machine or the server, we go to test connection and to create small applicatory that will test its they webcam

Opens a new document in the Flash, presses F11 to open the library, later inserts a new item in the library (New Video) as in the image below:

Inserindo novo video

It drags this item for palco of the Flash, gives the name of instance “live�?. presses F9 to open the window of Actions.
Create one variavel for connection.

[as]var teste_nc:NetConnection = new NetConnection();[/as]

Testing the connection.

[as]teste_nc.onStatus = function(info) {
trace(“Level: “+info.level+” Code: “+info.code);
};[/as]

Connecting the server FMS/FCS

[as]teste_nc.connect(“rtmp://doman”);//for localhost use rtmp:/aplication[/as]

Getting images of webcam

[as]var teste_cam:Camera = Camera.get();[/as]

Insert the images of webcam in instance of video create

[as]live.attachVideo(teste_cam);[/as]

The code:

[as]var teste_nc:NetConnection = new NetConnection();
teste_nc.onStatus = function(info) {
trace(“Level: “+info.level+” Code: “+info.code);
};
teste_nc.connect(“rtmp://dominio”);//para localhost use
var teste_cam:Camera = Camera.get();
live.attachVideo(teste_cam);[/as]

Test the swf(ctrl+enter) if everything will be certain swf will ask to it if it will be able to have access its webcam, accepting you will see its webcam functioning.

see the test

***UPDATE*** 18/02/2006
When you use the method “Camera.get();” automatically the Flash Player shows to the user the option to allow or to deny the access of the flash they webcam it. In this we can know if the access or was allowed not using the function onStatus later as in the following example:

[as]var client_cam = Camera.get();
client_cam.onStatus = function(infoObj:Object) {
switch (infoObj.code) {
case ‘Camera.Muted’ :
trace(“Camera deny”);
break;
case ‘Camera.Unmuted’ :
trace(“Camera access”);
break;
}[/as]

Flash Media Server Developer Center
http://www.macromedia.com/devnet/flashmediaserver/

FlashComGuru
http://www.flashcomguru.com/

FlashCom.com.br
http://www.flashcom.com.br/

4 thoughts on “Testing Webcam with Flash Communication Server/Flash Media Server

  1. Hugo Silva

    i have install the media server and i can reach him, but have connection refuse. i don’t have licenses fr media server. can i test applications on media server …. what is the options i have
    Best regard

  2. renuka

    Greetings

    i want to have webcamera option for one of my client’s website.

    How do i intergrate it…Can you pls help me?

    thanks and regards
    Renuka

Leave a Reply