I need help for your videoconference

Post your questions and bug-reports about the audio/video streaming add-on based on Red5 Media Server.

Moderators: Lapo, Bax

supermk88
Posts: 239
Joined: 18 Mar 2011, 12:30

I need help for your videoconference

Postby supermk88 » 12 Nov 2012, 16:01

Sorry, i want to know how can i do this thing:
I want that when 1 user enter in chat appears the flash message to connect the webcam. Then i want that all people of the chat can see user only with a click on their names.
Example: i enter in the chat and i connect my webcam then i click in "user" webcam and i see him. My webcam up and the other down, and if i click on other username new webcam take the place of existing webcam.
Is a good way start by modifing the videoconference where all people can see each other?
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Re: I need help for your videoconference

Postby rjgtav » 12 Nov 2012, 21:22

Hi,

You can subscribe to a single cast, by using the castId, which you could store as a UserVariable.
I'm only afraid that this would be too heavy to the network and to the clients, as you would be constantly subscribing and unsubscribing to broadcasts. You can try
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
supermk88
Posts: 239
Joined: 18 Mar 2011, 12:30

Re: I need help for your videoconference

Postby supermk88 » 12 Nov 2012, 21:38

Thx for answer :) are you sure is too heavy for the server and client? i want that in a room (with like 100 or 200 people) who have the webcam subscribe like in a conference but an user can watch only 1 webcam for time
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Re: I need help for your videoconference

Postby rjgtav » 13 Nov 2012, 20:23

You have to test it for yourself. Just make sure that the client is subscribed only to one cast at a time.
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
supermk88
Posts: 239
Joined: 18 Mar 2011, 12:30

Re: I need help for your videoconference

Postby supermk88 » 13 Nov 2012, 22:05

Ok thx :) i try to do ^^ i have only a thing that i don't understand, in the conference i see that when user join the conference he automatically see all the other user that are into that conference, i can't use that code and show only 1 webcam at time(the webcam that the user choose by click on the name in the userlist)? Sorry if i explain bad the question ^^
I want that all people that have a webcam when join in the chat accept the message for public their webcam to all (and it remain published for all the time he remain into the same room) and who want see just click in the name of a user. For see a webcam user is obligate to subscribe? i thought it was easy for the network and for the client have only a webcam x user online. Sorry for my english ^^
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Re: I need help for your videoconference

Postby rjgtav » 14 Nov 2012, 16:42

When you publish a cast using the publishLiveCast() method, the RedBox API automatically sets your live cast and sets an UserVariable called $RB_castId (which is the CAST_USER_VAR constant on the AVCastManager class) with the value of your castId.
When you want to show a webcam, you use the subscribeLiveCast(castId) method and use the value of that variable from the selected user, and it will subscribe to his stream. Don't forget to previously use the unsubscribeLiveCast(castId) method in order to correctly close the previous user's webcam.
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
supermk88
Posts: 239
Joined: 18 Mar 2011, 12:30

Re: I need help for your videoconference

Postby supermk88 » 16 Nov 2012, 23:29

Hi and very thx for the answer :) i have only two question (sorry if are easy question but i don't know that :P):
I must use the publishLiveCast method only 1 time when user join the chat (and then use unpublish when he left) or when he change the room i must do unpublish and then publish again? (the question is if the publishLiveCast work in all the chat or only in a room of that chat ^^)
The second is if is possible with the videoconference chat make a function (with the default userlist) that when i click on an username it automatically show the user webcam, or i must create a different userlist that do so? (i know that there is the command that take the userid when i click on username but then i must click in a button like "watch" for see him webcam). Sorry for english and thx for answer ^^

edit: and if i use a larger webcam (like 320x240) do you think that can cause problem for the client and the server?thx ^^
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Re: I need help for your videoconference

Postby rjgtav » 17 Nov 2012, 17:25

I must use the publishLiveCast method only 1 time when user join the chat (and then use unpublish when he left) or when he change the room i must do unpublish and then publish again? (the question is if the publishLiveCast work in all the chat or only in a room of that chat ^^)

I'm sorry I haven't worked much with RedBox, but you can check on the SmartVideoConference example if it does unpublish and publish the cast everytime it changes rooms.
The second is if is possible with the videoconference chat make a function (with the default userlist) that when i click on an username it automatically show the user webcam, or i must create a different userlist that do so? (i know that there is the command that take the userid when i click on username but then i must click in a button like "watch" for see him webcam).

Basically, the same way you store the userid on the user's item inside the user list, you should also store the castId variable. Then, you add a listener to the component to when it is clicked and show a small window with the watch button, etc.
edit: and if i use a larger webcam (like 320x240) do you think that can cause problem for the client and the server?thx ^^

The bigger the resolution of the camera, the more information the client needs to upload to the server, but that's what happens with every other video-chat application, like skype, etc.
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
supermk88
Posts: 239
Joined: 18 Mar 2011, 12:30

Re: I need help for your videoconference

Postby supermk88 » 17 Nov 2012, 21:09

Ok thx :) i have a big problem.. i have try tu put the code publishLiveCast in the function onJoinRoom (the flash request for open the webcam arrive) but then if a user try to watch that webcam nothing happen.. i have try to make a button publish for publish the webcam and then its all ok.. any suggest for where i must put that code?^^ (in the default videoconference there is the button JoinConference and all time that the user change the room he must click again on it for publish him webcam but i want an automatic thing ^^).
I have try to put the code when somebody write in the public chat and it work, only in the joinRoom function there are some problem ^^ hope that you can help me :) thx for answer

edit: sorry if i ask here but is possible change the username of the user that publish his webcam? (like make a @ before the name), i have try with smartfox.myusername = "@" + smartfox.myusername but it remain the same..
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Re: I need help for your videoconference

Postby rjgtav » 18 Nov 2012, 12:08

i have try tu put the code publishLiveCast in the function onJoinRoom (the flash request for open the webcam arrive) but then if a user try to watch that webcam nothing happen.. i have try to make a button publish for publish the webcam and then its all ok.. any suggest for where i must put that code?^^ (in the default videoconference there is the button JoinConference and all time that the user change the room he must click again on it for publish him webcam but i want an automatic thing ^^).
I have try to put the code when somebody write in the public chat and it work, only in the joinRoom function there are some problem

Hmm... Does it throw any error when you try to publish the cast on the onJoinRoom() function? Can you add some traces on the redBox source in order to find out in what line of the publishLiveCast() function does it stop?
A workaround may be to add a Timer on the onJoinRoom() function, so that it publishes the cast some time after the event.
sorry if i ask here but is possible change the username of the user that publish his webcam? (like make a @ before the name), i have try with smartfox.myusername = "@" + smartfox.myusername but it remain the same..

After the login phase, you can no longer change the username. What you can do is create an UserVariable called, for example, displayName, and use that value to set and read an user's name, instead of using directly the userName property.
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
supermk88
Posts: 239
Joined: 18 Mar 2011, 12:30

Re: I need help for your videoconference

Postby supermk88 » 18 Nov 2012, 13:22

Ok thx :) i have try to open admintool to watch if redbox create an user variable for who publish the webcam, if i click the button "publish" yes it create that variable but if i join a room no. I have put a timer and now work perfeclty :)
For the second question do you think that there are problem if i use that user variable when i click in the userlist for show him webcam? (like different userId i don't know..) I want that only in userlist happear a simbol that show that a user have a webcam (but then when he write in public or in private the username remain the same). So people have more easy way to click only in username that have a webcam :)

edit: is normal that when i use publish live cast it work also if an user don't have webcam and microphone?^^ can cause a problem?
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Re: I need help for your videoconference

Postby rjgtav » 18 Nov 2012, 19:08

For the second question do you think that there are problem if i use that user variable when i click in the userlist for show him webcam? (like different userId i don't know..) I want that only in userlist happear a simbol that show that a user have a webcam (but then when he write in public or in private the username remain the same). So people have more easy way to click only in username that have a webcam

In that case, you don't need the displayName UV at all. When you add an item to the list, you can set which "name" will appear for that item. What you can do is check whether or not the user is broadcasting. If it is, then you add a "symbol" to the name. If he isn't, you add nothing.
is normal that when i use publish live cast it work also if an user don't have webcam and microphone?^^ can cause a problem?

Are you saying that the RedBox API is setting the castId UV even if no webcam is found?
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
supermk88
Posts: 239
Joined: 18 Mar 2011, 12:30

Re: I need help for your videoconference

Postby supermk88 » 18 Nov 2012, 22:22

Yes, also in the default videoconference when i click on joinConference button all other user can see me (with webcam grey) and with admintool i see my user variable stored, this is my function for publish livecast:

/**
* Join video conference
*/
public function joinConference():void
{

// Publish my live cast
var myStream:NetStream = avCastMan.publishLiveCast(true, true)

if (myStream != null)
{
// Attach camera output
myVCItem.attachCamera(Camera.getCamera())

}

}

Then when i join arrive the flash request (if i have the webcam) and the redBox Api set the castId even if i click on refuse to connect the webcam..

For you how can i do to set the symbol to the name? Maybe in that function after if(myStream != null) but what code i must use?
Thx for answer ^^
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Re: I need help for your videoconference

Postby rjgtav » 18 Nov 2012, 23:40

Well, it seems that the Webcam is really buggy on ActionScript 2.0. Tomorrow I'll try to cook a solution for you.
The problem is that when the flash player asks if you allow or not the app to use the webcam, it doesn't stop the code execution, which means, when the code sets the UV, it doesn't know if the user allowed or not. The Camera object has a muted property which is false if the user clicked "Deny" or if the user didn't click in any of the buttons yet. The only workaround I can see is to wait for some seconds (so the user can click one of the buttons) and then set the UV if allowed.
The only problem that still persists with this workaround is that if the user doesn't click in any of the buttons, it will simply take it as if the user denied the request. In this case, the user simply needs to click again on the "Publish cast" button.

You should also, at the home page of your application, inform the user to right click on the swf, go to the Privacy Settings, and allow it to use the webcam and the microphone.

Regarding your second question, you simply need to set the name when you join the room, every time a new user comes in, and when the castId variable is updated.
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
supermk88
Posts: 239
Joined: 18 Mar 2011, 12:30

Re: I need help for your videoconference

Postby supermk88 » 19 Nov 2012, 13:00

Yeah very thx :) i have done all without bug (i hope) now i have only that problem and the symbol of username ^^ hope that you can solve the first problem :) (i don't know the code for set the UV only if user click allow of flash request ^^) Thx for your help :)

Return to “RedBox”

Who is online

Users browsing this forum: No registered users and 17 guests