2

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();
}
user2688636
  • 141
  • 1
  • 7
  • Can I have a look at your test app code? I have followed the steps on installation page of wiki and have added the plugin too. It has created a sample app for me. It is just a page which says "Device is ready".. I can't understand where to go from there. Should I start using code snippets given on Getting Started page in a JS file in www or should I need to go to Java code and code there? – SamFast Feb 16 '15 at 11:30

1 Answers1

0

I had a similar problem, got it to work once I set an explicit height and width in the style on the videoContainer like so:

  <div id="videoContainer" style="width: 300px; height: 300px;"></div>
derekv
  • 3,131
  • 3
  • 21
  • 30