Webrtc - Apprtcdemo With Local Server Does Not Work With Android Native To Pc Browser
Solution 1:
After a lot of discussion, trial, error and logging we come tho these answers to fix the problems:
- Do not load channel.html from the internal assets folder. Then the url's don't match up anymore. (It is trying to post a message to the server at
'file://'+'/_ah/channel/jsapi'
, instead of'http://server_adress:port'+'/_ah/channel/jsapi'
) - After fixing that there was a problem with double slashes.
appRTCSignalingParameters.gaeBaseHref
contained a slash on the end, butappRTCSignalingParameters.postMessageUrl
did that on the beginning so the program tried to post toserver_adress:port//message
which is incorrect. Simply removing the / fromappRTCSignalingParameters.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).
Post a Comment for "Webrtc - Apprtcdemo With Local Server Does Not Work With Android Native To Pc Browser"