I have made a small test app, to test out the phonertc plugin for cordova.
But i have run into a bit of a problem. When 2 ipads call each other from the app only the callee can see the caller, the caller can't see the callee, but the sound goes through both ways, so there is a problem with the video stream.
If i test the app from browser to browser it works fine, and when a browser calls an tablet, it also works. But not when a tablet calls a browser, then same story as tablet to tablet.
Here is a snippet of where i handle the phoneRTC plugin.
messageHub.client.signal = function (message) {
session.receiveMessage(data);
}
messageHub.client.callIncomming = function (user) {
if(confirm(user + " is calling you?"))
{
StartSession(false, user);
window.setTimeout(function(){
messageHub.server.acceptCall(user);
},1500);
}
else {
messageHub.server.rejectCall(user);
}
}
messageHub.client.callAccepted = function (user) {
StartSession(true, user);
}
messageHub.client.callRejected = function (user) {
alert(user + " didn't want to talk to you.");
}
function StartSession(initiator, user){
session = new webRTC.Session(config);
session.on('sendMessage', function(data){
messageHub.server.signal(user, JSON.stringify(data));
});
webRTC.setVideoView({
container: document.getElementById('videoContainer'),
local: {
position: [512, 288],
size: [256, 144]
}
});
session.call();
}