I have ApprtcDemo from Android to Desktop not working, i have followed all the StackOVerflow links and Google discussion links none of them made it working yet, everybody cl
After a lot of discussion, trial, error and logging we come tho these answers to fix the problems:
'file://'+'/_ah/channel/jsapi'
, instead of 'http://server_adress:port'+'/_ah/channel/jsapi'
)appRTCSignalingParameters.gaeBaseHref
contained a slash on the end, but appRTCSignalingParameters.postMessageUrl
did that on the beginning so the program tried to post to server_adress:port//message
which is incorrect. Simply removing the / from appRTCSignalingParameters.postMessageUrl
fixed this.Old answer:
Thanks for the logging. Now we know what goes wrong. The if doesn't trigger because signalingReady == 0
. The reason it is zero is because of something I found on line 49:
// Caller is always ready to create peerConnection.
signalingReady = initiator;
I have no idea why this is there, and what it does.
Also, the only way to make it true happens on line 311, which is inside the function onChannelMessage
. There is no log from that function, and also the console.trace doesn't show anything from onChannelMessage
, as right on line 312 it should call maybeStart()
. So to temporary avoid it won't work, because there is no signalling done.
So what I think would solve the solution is to set initiator to 1 somewhere. You can do this for instance in the function that creates a new room, so the script directly knows that you are the initiator and not joining anyone.
I hope this solves your problem, and please keep me updated on further results and problems.
(As this is a demo from the site, I also suggest you to try and understand how an RTC connection is established, and write everything from the ground up. This will make your knowledge a lot better and debugging will be much easier, as it is your own code which you understand).