Hi,
I want to create a chat application that allow users to select a particular user from the room and chat with that person alone.I tried and succeeded in creating a chat application that works like a group chat, where all the users in the room can see all the messsges.Is there anything to do in room console with permissions,pls explain..
Thanks in advance!!!
Solved! Go to Solution.
Views
Replies
Total Likes
Yep. It's basically the same idea but actually a bit easier. The code should be something like this...
Cam:
private function startPublisher() : void {
// Removing the recipient ids on the publishing side. Everything should be handled ok by setting publisher ids on the receiving side for each receiver
// var recipientIDs:Array = new Array();
// var userId : String = Util.getUserIdForDisplayName(CocomoSession.session, this.currentTargetUser);
// recipientIDs.push(userId);
// webcamPub.recipientIDs = recipientIDs;
if(webcamPub.isPublishing == false) {
webcamPub.quality = 85;
webcamPub.keyframeInterval = 36;
webcamPub.publish();
}
}
Views
Replies
Total Likes
I'd recommend reading through to give you an idea of structure and details of LCCS:
* http://learn.adobe.com/wiki/display/lccs/LiveCycle+Collaboration+Service
For example, one of the chapters is on Audio/Video streams:
* http://learn.adobe.com/wiki/display/lccs/08+Audio%2C+WebCam%2C+and+Screen+Sharing
Quoting from the document:
I don't know if there's a way to do permission and userID filtering on A/V streams in the room console, but you should be able to in AS3/Flex fairly easy. The example in the LCCS SDK "sampleApps/Audio/Audio.mxml" will probably help you get started. For example:
/****
* When published stream is received, start polling the activity level of my microphone.
*/
private function onStreamReceive(p_evt:StreamEvent):void
{
if ( p_evt.streamDescriptor.finishPublishing && p_evt.streamDescriptor.streamPublisherID == cSession.userManager.myUserID) {
..................
}
}
I haven't done this myself, so feel free to correct me
Alex G.
Views
Replies
Total Likes
Hey,
In your app you need to know what the user ID is. Everyone who connects to the room is assigned an ID by the service.
If you know what the ID is you can send a private message. (make sure the node details have allowPrivateMessages checked off)
Then you can send a message just like a public chat but make sure that there is a receipient with the right id.
Here is how I've been doing it.
var messItem:MessageItem = new MessageItem("PrivateMessage");
messItem.publisherID = this.MyID
messItem.recipientID = userID;
messItem.collectionName = _msgCollection.sharedID;
messItem.body = {
note: "closeWindow"
}
_msgCollection.publishItem(messItem);
so your publishing to a node called private message.
try it out.
...russ
Views
Replies
Total Likes
Here's some sample code that will help you to direct messages to individual clients:
public var chatModel:SimpleChatModel;
chatModel.allowPrivateChat = true;
var message:String = "Hello";
var cmd:ChatMessageDescriptor = new ChatMessageDescriptor();
cmd.displayName = session.userManager.getUserDescriptor(session.userManager.myUserID).displayName;
cmd.msg = message;
var userId : String = getUserIdForDisplayName(session, targetUser);
cmd.recipient = userId;
chatModel.sendMessage(cmd);
Hey thank you so much i got it working.can the same approach be followed for audio and video chat too???
Views
Replies
Total Likes
Yep. It's basically the same idea but actually a bit easier. The code should be something like this...
Cam:
private function startPublisher() : void {
// Removing the recipient ids on the publishing side. Everything should be handled ok by setting publisher ids on the receiving side for each receiver
// var recipientIDs:Array = new Array();
// var userId : String = Util.getUserIdForDisplayName(CocomoSession.session, this.currentTargetUser);
// recipientIDs.push(userId);
// webcamPub.recipientIDs = recipientIDs;
if(webcamPub.isPublishing == false) {
webcamPub.quality = 85;
webcamPub.keyframeInterval = 36;
webcamPub.publish();
}
}
Views
Replies
Total Likes
Thank u very much.I will try and let you know...Thanks once again for the answers..
cheers,
Naveen M
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies