Entry: red5 videoconference
Description
This example shows how easy it is to use streaming with Red5. To test it you need a webcam installed on your computer and maybe you should invite a friend to see him on the other side. All we use is the NetConnection, NetStream and SharedObject class to make it work. Below you can see the heart of the application, the complete source code can be downloaded.
remote_so.onSync = function(list){
if (remote_so.data.users != undefined){
var userArray:Array = remote_so.data.users.split(",");

var windowNumber:Number = 2;
var streamNumber:Number = 1;
for (var i:Number=1;i<=userArray.length;i++){
if (i != streamID && i < 5){
_root["ns"+streamNumber] = new NetStream(nc);
_root["video"+windowNumber].attachVideo(_root["ns"+streamNumber]);
_root["video"+windowNumber].attachAudio(_root["ns"+streamNumber]);
_root["ns"+streamNumber].play("red5Broadcast"+i, -1);
windowNumber++;
streamNumber++;
}
}
}
}

function login():Void{
if (remote_so.data.users == undefined){
remote_so.data.users = username;
remote_so.data.streamID = 1;
}else{
remote_so.data.users += "," + username;
remote_so.data.streamID++;
} streamID = remote_so.data.streamID;

cam = Camera.get();
cam.setMode(360, 270, 30);
cam.setQuality(0,50);

// setup mic
mic = Microphone.get();
mic.setRate(44);
video1.attachVideo(cam);
video1.attachAudio(mic);
ns.attachVideo(cam);
ns.attachAudio(mic);
ns.publish("red5Broadcast"+streamID, "live");
}
To have some information about the live streams we save stream ids in the SharedObject so every new user coming in fires the remote_so.onsync event which updates all current users screen and adds on more streaming window. The maximum number of users is five in this simple sample.
Unfortunately, I had to use AS2 again because of the embedded video component which is also not out for Flash 9 so far.
download source
Comments
Hi...
I tried your application but can you give me your backend and flex code?

Thanks a lot
Sameer
irox wrote:
Its possible have the RED5 side files ?
Ari wrote:
Hello

Is it possible to get the "whole package"? Thank you!


Ari
Cromwell wrote:
Please can you send the backend java files for this videoconference. Would really appreciate it.
Thanks
Cromwell
this is great! wheres the source for the backend test app?
Rave wrote:
don't i need the 'test' aplication on the server side ?
WHAK wrote:
Neat that webcams can be used with Flash! See some of my experiments
Kris wrote:
Hi:

I tried using your FLA and generated SWF file to use it on Red5 server. When test it for streaming multiple user videos I do not see one on the other.

Do I need to do anything with the script you posted here?
Can you please Email me whole package including the action scripts.

Appreciate the help very much.

Thanks a lot.

Kris

NameE-Mail
send


Creative Commons License