Expand my Community achievements bar.

Private audio/video conference

Avatar

Former Community Member

Hi,

We want to implement chat, audio and video collaboration features in our application using LCCS. A user should be able to pick another user from a list of available users and start audio / video conferencing. We could find lot of examples on how to publish audio/video to everyone available in the room, but not able to figure out how to accomplish a private audio/video conferencing between 2 users. What kind of role the users should have to enable a private audio/video conferencing?

24 Replies

Avatar

Former Community Member

Hi,

One thing I can think of is grouping.

You can create a group and assign the two users to that group, then all the streams between the two users will be shared between themselves and not others. If you want a group of people to share the streams , you can put all of them in that group. An example of how groups can be created and grouping can be done is in MultipleGroups example.

Whenever you are done with private audio/video, you can again reassign the user back to the main default group so that he receive every stream.

Thanks

Hironmay Basu

Avatar

Level 4

I'm solving a similar problem here, we have a ton of users and we want them to be able to do audio/video chat in small private groups.   Much like instant messanger with video conferencing.   We also didn't want all our users connected to LCCS because there's a low hourly charge for that we wanted to avoid. 

My solution was to build a small flex XMPP client and connect them to a jabber/xmpp server.   Now all the users can see each other in the XMPP client, along with their status.  When they select a bunch of users to video conference with I connect to LCCS, and get a room based on my username (created using the afcs.php library).   Then I send that room name to the others using XMPP.   When their application receives the room name it connects to LCCS and joins that room.   So then you get just those user in a private chat in a private room. 

That was just my solution, it sounded simliar to what you were after.  Good Luck.

Regards,

Eric

Avatar

Former Community Member

One of the features we're working on right now is the ability to build

"lobby" rooms for your users. Hopefully there will be something to show in a

couple of months - this way, the "lobby" would take the place of your XMPP

room (but otherwise work much the same way - send new roomURLs to

participants).

nigel

Avatar

Level 4

That sounds interesting, if that still counts as being connected to the LCCS

service we'll probably stick with XMPP. We want our elderly users

connected 24 hours a day and it's $0.01 / hr to stay connected. That's

$0.24 a day and over 30 days that's $7.19 a month. Our financial model

can't carry $7.19 a month for them to stay connected ( to be fair you could

subtract my bandwidth cost for the XMPP keep alive messages but it's pretty

low). For other use cases I could see it working though.

-Eric

Avatar

Level 1

Hi,

Only a owner can create a group right ?How should i assign the access to guest so that the guest with publisher role can create groups .

or dynamically how can i change the user with publisher role to owner role ?

Avatar

Former Community Member

Hi,

You can dynamically change any User's Role using setUserRole function of UserManager. Thus you can make any publisher (with role=50) to owner(role=100) and vice versa.

But you need be a owner to do changing of roles.

Thanks

Hironmay Basu

Avatar

Former Community Member

Thanks for the response. Here is the list of issues/questions:

1. To have a private audio / video chat, we need to dynamically (at runtime) create group names. Publisher and subscriber will use this group name.

2. To create dynamic groups, the user should be a owner for the room. We cannot have all the users in an organization as owners. We will have only one user designated as owner. Do we need to use this user account to create the dynamic group or can we change the role of the publisher to room owner?

3. How do we dynamically add subscribers to a particular group name? The reason we want to do this is to invite 1 or more users to join the same group (after the group is created at runtime) and participate in audio/video chat.

Appreciate your help.

Thanks,

Ramesh.

Avatar

Former Community Member

Hi,

>>2. To create dynamic groups, the user should be a owner for the room. We >>cannot have all the users in an organization as owners. We will have only >>one user designated as owner. Do we need to use this user account to >>create the dynamic group or can we change the role of the publisher to >>

>>room owner?

The owner has to be in the room to create groups. Only one owner can be fine. You can develop a mechanism wherein a user sends a message when a group needs to be created, the owner listens and creates the group.

The publisher's role can be also changed dynamically to owner using the setUserRole API in UserManager but then only a owner can enhance the role of a user.

So, in either case, at least one owner(userRole=100) has to be there to create groups dynamically or initially raise someone's role to 100.

>>3.How do we dynamically add subscribers to a particular group name? The >>reason we want to do this is to invite 1 or more users to join the same >>group (after the group is created at runtime) and participate in >>audio/video chat.

Every Audio/Webcam Publisher/Subscriber has a groupName property that you can set to let that subscriber be part of that group dynamically.

For e.g. webcamSubscriber.groupName = "YourGroupName" ;

As a related thought, after your query yesterday, we have thought of providing this functionality(private audio/video) in near future probably in our next update in sometime first half of next year. Till then, you can use grouping.

Hope this helps.

Thanks

Hironmay Basu

Avatar

Level 1

Thanks for the response.

I have bunch of questions.

1) When i try to create groupName with owner credential and when i publish it with publisher credential immediately , it throws me "insufficient permission" error

    tempVideoPub.connectSession.streamManager.createGroup("testing"); // tempVideoPub assigned with owner credentials

   

    // if i try to execute this lines immediately after the create group line,it throws me "insufficient error"

   // if i try to execute this line after 1 or 2 minutes after the create group line,it doesnt throw me the error

     webCamPub.groupName = "testing";

     webCamPub.publish();

createGroup method takes some time to create the group ?

right now i am planning to use timer to wait for 1 or 2 minutes and continue.Shall i goahead and use timer ?

2) using "groupname" we can have more than 2 people to listen to the group.Is there any groupName concept in ChatModel so that i can send the message to more than 1 person ? Basically i want to implement  groupchat with more than 2 or 3 persons.

   

Avatar

Former Community Member

Hi,

As far as create group is concerned, yes it internally creates nodes and you need to wait for sometime. Currently , streamManager doesn't throw an NODE_CREATE event but I will add that in next drop.

After that you can just listen to that event and do the publishing inside the event handler and then remove the timer. Timer can work good for now.

Also, to point out, we are planning to add infrastructure for sending messages to a set of recipients(instead of a single recipient as of now) , so you will be automatically able to send chat messages to a selected set of people.

Similarly, we are also working on private streaming (of audio/video) so that you don't need to go through the grouping process since that's not the cleanest way I believe to do.

We are planning to add these features in a near release, sometimes in beginning half of next year.

As per grouping for chat is concerned , yes it is there. All you need is to first create a simplechatmodel with the groupName , see the

protected function initializeGroupModels(p_groupName:String):void

function inside MultipleGroups.mxml example. Once a chat model with group is created, you can just say simpleChat.groupName = groupName, again shown in that example.

You can also iterate over userIDs to send private chat messages to different users by using one recipientID at a time.

But yes, all of this work will be completely eased in coming releases with the functionalities inside the framework itself.

Hope this helps.

Thanks

Hironmay Basu

Avatar

Former Community Member

Hi,

As a heads up for your first issue, you will be now able to listen to the event handler for NODE_CREATE in StreamManager and check whether the group Exists or not using isGroupDefined API which returns true only when the group is created and ready for publishing and then you can do any publishing.

You should be able to get in the next SDK drop. Till then timer can work fine temporarily.

Hope this helps

Thanks

Hironmay Basu

Avatar

Level 1

Hi Hironmay,

Thank you very much for your immediate response. I just have 4 more questions

1) Inorder to create groupName for simplechatmodel,i need to be with owner credential to create it.i just want to know which line triggers the creation of groupname is it "chatmodel.sharedId = groupName" or "chatmodel.subscribe()"

     If "chatmodel.subscribe()" triggers the creation of groupname then in my case i dnt want the owner to be subscribed.Because i need the owner credential just to create the groupname . in my case publisher is the one who is going to publish message and subscribe to the groupname.

Basically i want to create groupname for simple chat model with owner credential and subscribe to it with the publisher credential.

how to achieve this ?

or is there a way to immediately unsubscribe from the owner credential ?

2) is there api to check wheather the groupname is created for the simplechatmodel ? (like streammanager.isgroupdefined )

3) my webcamsubscriber is subscribing to a groupname and whenever my webcampublisher is publishing to the groupname,the sender is not able to see his own video.all the others in the group except the publisher was able to see the video published on the group.Any clue on this ?I just attached the sample file "webpublishersample.mxml" which i am trying to use.

4)Kindly intimate me whenever the next sdk is available so that i can make use of Node_Create event listener

Your timely replys are very helpful.

Thank you very much for all your efforts.

Regards,

BalaSathya.B

Avatar

Former Community Member

Hi,

When you set the sharedID in a SimpleChatModel, it actually creates a collectionNode with that name(groupName) when you call subscribe. Once created the first time, the collectionNode remains on server. Since collectionNodes are referred by name, all you need is to do this once from the owner initally.

model.sharedID = groupName ;

model.subscribe();

Then later any publisher can also do

model.sharedID = groupName ;

model.subscribe();

Since this collectionNode was already created, the publisher would get the subscribed to it and can publish message. You can also create this collectionNode(with groupName as its name) from devconsole.

There is no such method as such whether this group is defined for SimpleChat, and calling subscribe() from a publisher will throw exception if it(model) was not created already by the owner.

For streams ( audio and video) , you have a function called isGroupDefined(p_groupName:String):Boolean in class StreamManager.

Hope this helps.

As I mentioned earlier, private audio/video streaming is coming soon in our future releases.

Thanks

Regards

Hironmay Basu

Avatar

Level 1

Hi Hironmay,

Using the owner credential i created the groupname and subscribed to it with the following lines

simpleChatModel.sharedID = "testing1234"

simpleChatModel.subscribe();

wheareas "simpleChatModel" points to the owner credential.

After executing the above 2 lines i was able to see my gorupname "testing1234" listed under the CollectionNode in the room console.

When i try to execute the below 2 lines after the execution of above 2 lines i am getting "insufficient permission error"

chatModel.sharedID = "testing1234"

chatModel.subscribe();

wheareas "chatModel" points to publisher credential.

Error: Error - insufficient permissions to create a new CollectionNode. You must be an OWNER of the room to add new multi-user features to it. Log in with developer credentials in order to do so.

May i know the reason of getting this error ?

Regards,

BalaSathya.B

Avatar

Former Community Member

Hi,

I think you need to give it bit of time, this was one issue I fixed recently. If you do immediately, it won't have created the model with that shredID yet.

I just ran the SimpleChatExample code, first as a owner with model.sharedID="mygroupName" and then as a publisher/viewer with model.sharedID=" mygroupName " and it works fine. So I guess you may be missing out something. Can you try out the example and see whats the problem ?

Also , if you are still getting the problem, you send me a test code that reproduces along with step and I will verify that.

Thanks

Hironmay Basu

Avatar

Level 1

Hi Hironmay,

I had attached a sample file i which i was trying to use the groupname created by the owner but still it throws the "insuffecient error" when publisher subscribes

Actually i am calling the publisher.subscribe after some time using the setTimeout method.

I observe onething some times it works fine with 8000 as the delay and sometimes it is not working fine with 8000 as delay.

Just want to know after how long should i call the publisher subscribe ?

even if i set 10,000 as the delay value,but in the mean time if the publisher is sending a message to someone i guess it wont work fine as the publisher is not subscribed yet. am i right ?

how to solve this ?

Avatar

Level 1

Hi Hironmay,

I actually got stuck with 2 issues.

     1) when i do audiopub.publish() -> this line was throwing me TypeError:1009 cannot access a null object or reference

          It was showing null object reference at AudioPublisher:625

     2) When i explored on net on this error i got a option of upgrading to player10 swc.when i did that , most of my functionality stop working so i tryed to revert back to the old version of swc , when i reverted back i was getting the following error :

     Cannot create property isPeer on com.adobe.rtc.sharedManagers.descriptors.UserDescriptor.
at com.adobe.rtc.sharedManagers.descriptors::UserDescriptor/readValueObject()[C:\work\main\connect\cocomo\src\com\adobe\rtc\sharedManagers\descriptors\UserDescriptor.as:162]
at com.adobe.rtc.sharedManagers::UserManager/readUserDesc()[C:\work\main\connect\cocomo\src\com\adobe\rtc\sharedManagers\UserManager.as:1151]
at com.adobe.rtc.sharedManagers::UserManager/userReceivedOrEdited()[C:\work\main\connect\cocomo\src\com\adobe\rtc\sharedManagers\UserManager.as:978]
at com.adobe.rtc.sharedManagers::UserManager/onItemReceive()[C:\work\main\connect\cocomo\src\com\adobe\rtc\sharedManagers\UserManager.as:889]

Please suggest me the things i need to take care when i was reverting back to the old version of swc.and also please help me in fixing the bug no:1

Regards,

BalaSathya.B

Avatar

Former Community Member

Hi Bala,

This was a bug that was fixed long back. Are you using our old SDK ? can you get the latest SDK from our devportal and get the player 9 swc from there. It shouldn't happen.

And why will your player 10 swc stop working ? it shouldn't. Anyways, first get the latest player 9 swc and let me know the results and then we can talk more on player 10 swc.

Thanks

Hironmay Basu

Avatar

Level 1

Hi Hironmay,

Thank you very much for your response. I had taken the latest sdk version and now i dont find any issues on my existing functionality.

I have another question on private audio chat,

When "A" is publishing the audio to the "B" , "A" creates a groupname

I used messaging service to intimate "B"  regarding the groupname created by "A".

so now 'B' will be subscribing to groupname received through messaging service (which was sent by "A")

But now if B wants to publish the audio to the samegroup , when it tries to

1)tempAudioPub.connectSession.streamManager.isGroupDefined(groupNameCreatedByA) - this statement is returning true in client "A"

2)when i check the room console i was able to see the groupNameCreatedByA under streammanager

3)tempAudioPub.connectSession.streamManager.isGroupDefined(groupNameCreatedByA) - this statement is returning false in client "B"

Where tempAudioPub is AudioPublisher

question 1 : why tempAudioPub.connectSession.streamManager.isGroupDefined(groupNameCreatedByA) is returning false in client "B"?

i tryed after some time and executed the above line , still it was returning false.

question 2 : is there a way to intimate all the client whenever a group is created by someone?

My requirement is something like if a is publishing to b , both should be connected in the same groupname.

Any suggestion on this ?

Thank you very much for all your efforts!

Regards,

BalaSathya.B

Avatar

Level 1

Hi Hironmay,

For the above 2 questions , i found a workaround for now.

If you have any solution please share it with me.

Right now i am having only 3 issues :

Issue 1 : When a person is sharing a webcamera to another person , the sender is not able to see his own stream.I already posted this with the attachment.Again i am attaching the sample file for this problem.(this is using the groupname concept)

Issue 2 : When A is typing a text message , how to intimate the other person that "A is typing a message" in the chat pod ?if you have any example please share it.

Issue 3:  (whreas simpleChatModel is with owner credential)

               simpleChatModel.sharedID = groupName;

               simpleChatModel.subscribe();

     Using the above 2 lines i was able to create the collection node with my groupname.Now my question is how to programatically delete the groupname ? I have to delete the groupname created when the user logout of the application.

Expecting your reply.

Regards,

BalaSathya.B