var selfEasyrtcid = "";
function connect() { easyrtc.setVideoDims(1280,720); easyrtc.enableDebug(false); easyrtc.setRoomOccupantListener(convertListToButtons); easyrtc.easyApp("easyrtc.videoChatHd", "selfVideo", ["callerVideo"], loginSuccess, loginFailure);}
function clearConnectList() { var otherClientDiv = document.getElementById('otherClients'); while (otherClientDiv.hasChildNodes()) { otherClientDiv.removeChild(otherClientDiv.lastChild); }}
function convertListToButtons(roomName, data, isPrimary) { for (var easyrtcid in data) { performCall(easyrtcid); }}
function performCall(otherEasyrtcid) { easyrtc.hangupAll(); var acceptedCB = function(accepted, caller) { if( !accepted ) { easyrtc.showError("CALL-REJECTED", "Sorry, your call to " + easyrtc.idToName(caller) + " was rejected"); } }; var successCB = function() {}; var failureCB = function () { }; easyrtc.call(otherEasyrtcid, successCB, failureCB, acceptedCB);}
function loginSuccess(easyrtcid) { selfEasyrtcid = easyrtcid; document.getElementById("iam").innerHTML = "I am " + easyrtc.cleanId(easyrtcid); }
function loginFailure(errorCode, message) { easyrtc.showError(errorCode, message);}
easyrtc.setAcceptChecker(function(caller, cb) { cb(true);} );
But
this code allow to get the client video only in case when I set breakpoint
in function loginSuccess(easyrtcid)
and in easyrtc.call(...) function
and debug it in Chrome browser by stepping. If I launch code in Chrome without
breakpoint I don't see client video. It means that there are must be delay
after client enters server and it starts to call. In easyrts exemples this delay is made by button that must be clicked manually. How the remove that button and make call
automatically?