Listener for when caller video src is updated

55 views
Skip to first unread message

man...@phonon.in

unread,
Nov 15, 2014, 12:36:03 AM11/15/14
to eas...@googlegroups.com
Hello,

I am working on easyrtc audio+video application. Where I have a scenario that call owner must have webcam. and caller may not have webcam.
I my case the video call is still berforming with caller being only with microphone (only audio).

Now I am facing problem to show call owner that the other caller is not having webcam.
I want to just put a listener, like if callerVideo src is not received or stream is not received from caller, then caller is not having a webcam.

My listener for video call ocupants:
easyrtc.setRoomOccupantListener(performVideoCallListener);

In my listener I am calling, when I receive any easyrtc id from caller.
performVideoCall(easyrtcid);

Inside "performVideoCall" I am calling:
easyrtc.call(otherEasyrtcid, successCB, failureCB);

Now inside the "successCB" I am checking that caller video src is updated or not.
var vdoObj = document.getElementById("callerVideo");
if (vdoObj.src == ""){ alert("vdoObj.src blank "); } else { alert("vdoObj.src not blank "); }

Call is started successfully, but even if the function "successCB" completed, I am not able to get when the caller video src is updated.
If I come to know when the video src is updated I can show message to Call Owner that the caller is not having a webcam.


Thanks,
Mandar.

Eric Davies

unread,
Nov 15, 2014, 2:12:55 AM11/15/14
to eas...@googlegroups.com

<static> setStreamAcceptor(acceptor)

easyrtc.setStreamAcceptor sets a callback to receive media streams from other peers, independent of where the call was initiated (caller or callee).
Parameters:
NameTypeDescription
acceptor Function takes arguments (caller, mediaStream)
Example
 easyrtc.setStreamAcceptor(function(easyrtcid, stream) {
    document
.getElementById('callerName').innerHTML = easyrtc.idToName(easyrtcid);
    easyrtc
.setVideoObjectSrc( document.getElementById("callerVideo"), stream);
 
});
Reply all
Reply to author
Forward
0 new messages