AppRTC: make requestTurn() failure non-fatal to call establishment.

BUG=1795
R=vikasmarwaha@google.com, vikasmarwaha@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/1504005

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4063 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
fischman@webrtc.org
2013-05-17 18:32:23 +00:00
parent 8d6eb56085
commit 5e2a1bbbc6

View File

@@ -112,7 +112,7 @@
var remoteStream; var remoteStream;
var channel; var channel;
var channelReady = false; var channelReady = false;
var turnReady = false; var turnDone = false;
var pc; var pc;
var socket; var socket;
var initiator = {{ initiator }}; var initiator = {{ initiator }};
@@ -159,7 +159,7 @@
for (var i in pc_config.iceServers) { for (var i in pc_config.iceServers) {
if (pc_config.iceServers[i].url.substr(0, 5) == 'turn:') { if (pc_config.iceServers[i].url.substr(0, 5) == 'turn:') {
turnExists = true; turnExists = true;
turnReady = true; turnDone = true;
break; break;
} }
} }
@@ -179,8 +179,10 @@
"url": "turn:" + turnServer.username + "@" + turnServer.turn, "url": "turn:" + turnServer.username + "@" + turnServer.turn,
"credential": turnServer.password "credential": turnServer.password
}); });
turnReady = true; } else {
console.log("Request for TURN server failed.")
} }
turnDone = true;
} }
function resetStatus() { function resetStatus() {
@@ -223,7 +225,7 @@
} }
function maybeStart() { function maybeStart() {
if (!started && localStream && channelReady && turnReady) { if (!started && localStream && channelReady && turnDone) {
setStatus("Connecting..."); setStatus("Connecting...");
console.log("Creating PeerConnection."); console.log("Creating PeerConnection.");
createPeerConnection(); createPeerConnection();