Sync setRoomOccupantListener and successCallBack in easyrtc.connect() or asyrtc.easyApp()

155 views
Skip to first unread message

man...@phonon.in

unread,
Nov 17, 2014, 1:54:37 AM11/17/14
to eas...@googlegroups.com
Hello,

For easyrtc audio+video application I am facing problem for asynchronous functionality for:
easyrtc.setRoomOccupantListener and successCallBack of easyrtc.connect() or   easyrtc.easyApp()

The Problem I am facing is, inside listener the perform call is called even before the login success if happens for self easyrtc id.
Is there any way to check setRoomOccupantListener and successCallBack of easyrtc.connect() or easyrtc.easyApp(), to make them in sync.

I tried to check using:
easyrtc.getConnectStatus(clientEasyrtcid) == easyrtc.IS_CONNECTED
and 
easyrtc.getConnectStatus(clientEasyrtcid) == easyrtc.NOT_CONNECTED


But in this case I get other easyrtc id is not connected everytime. Because successCallBack is not yet called and selfeasyrtid is not yet generated.
Please suggest any solution for the same.

Regards,
Mandar Pandit.

Eric Davies

unread,
Nov 18, 2014, 12:50:51 AM11/18/14
to eas...@googlegroups.com
You are confusing two different types of connection:
   peer to server connection
       easyrtc.connect
       easyrc.easyApp
       easyrtc.setRoomOccupantListener.
   peer to peer connection
       easyrtc.getConnectStatus(clientEasyrtcId)


man...@phonon.in

unread,
Nov 18, 2014, 1:22:40 AM11/18/14
to eas...@googlegroups.com
Thanks Eric for your response.

man...@phonon.in

unread,
Nov 18, 2014, 6:00:49 AM11/18/14
to eas...@googlegroups.com
Please can you explain little brief on difference when we call
easyrtc.easyApp and easyrtc.connect.

What I read about them is easyrtc.easyApp is mostly better to use with video calls.
And easyrtc.connect is used with chat communications.

Is this understanding correct ?

Eric Davies

unread,
Nov 19, 2014, 1:11:42 AM11/19/14
to eas...@googlegroups.com
easyApp is a convenience function that does some some common video chat type tasks for you.
It was written before we had the api/lab directory, otherwise it would be in there instead of in the main easyrtc.js file.
If you are doing anything that it can't support, you use easyrtc.connect and implement that functionality yourself.
Reply all
Reply to author
Forward
0 new messages