2
votes

I'm currently developing a video chat application using the opentok WebRTC javascript API. The application is linking user A and B in a 1-on-1 video chat. A and B both have their own session of which they are the moderator (sessionId is generated on login and stored in a database). At first user A and B are only publishing to their own session and are not subscribed to any other session. Then a "start" command is send to both users (using socket.io), triggering user A to subscribe to the session of user B and vice versa. Then instead of displaying each others stream (which worked perfectly a few weeks ago), the subscribing video window now remains black (in 3-4 out of 5 cases) and eventually a 1013 peerconnection error is triggered. Has anyone seen the same behaviour (it got very bad since the release of WebRTC 2.0.0.13, about 2 weeks ago)? I'm pretty sure it has nothing to do with any firewall settings since it worked perfectly before and the opentok diagnostic tool doesn't show any issues.

Something strange I noticed: if for example one or both users only start publishing (by giving access to their webcam) to their own session after they had subscribed to each others session I never get the 1013 error and everything runs smoothly (using the exact same sessionID's).

If this is something that can't be avoided, is there a proper way to recover from these errors? I tried unsubscribing - resubscribing but that doesn't work. Any ideas?

Frederik

1

1 Answers

0
votes

This does sound like a strange problem. When you generate a sessionId, can you make sure p2p is not enabled? p2p streams that do not go through our servers are susceptible to 1013 connection errors.

Make sure your javascript/iOS libraries are all using webrtc SDK. If a session Id is allocated for our flash servers, the person trying to connect via webrtc will get 1013 error.

Sometimes, if you try to call session.subscribe multiple times to the same stream, it can put the subscriber in a weird state, resulting in a 1013 error.

These are the possible causes that I can come up with. Do you have a live demo that you can share so we can reproduce the problem?