From 5e2a1bbbc695acc40bd3cb42b9ac7a9e25f227c0 Mon Sep 17 00:00:00 2001 From: "fischman@webrtc.org" Date: Fri, 17 May 2013 18:32:23 +0000 Subject: [PATCH] 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 --- samples/js/apprtc/index.html | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/samples/js/apprtc/index.html b/samples/js/apprtc/index.html index f2aef2a2c8..3d40d910df 100644 --- a/samples/js/apprtc/index.html +++ b/samples/js/apprtc/index.html @@ -112,7 +112,7 @@ var remoteStream; var channel; var channelReady = false; - var turnReady = false; + var turnDone = false; var pc; var socket; var initiator = {{ initiator }}; @@ -159,7 +159,7 @@ for (var i in pc_config.iceServers) { if (pc_config.iceServers[i].url.substr(0, 5) == 'turn:') { turnExists = true; - turnReady = true; + turnDone = true; break; } } @@ -179,8 +179,10 @@ "url": "turn:" + turnServer.username + "@" + turnServer.turn, "credential": turnServer.password }); - turnReady = true; + } else { + console.log("Request for TURN server failed.") } + turnDone = true; } function resetStatus() { @@ -223,7 +225,7 @@ } function maybeStart() { - if (!started && localStream && channelReady && turnReady) { + if (!started && localStream && channelReady && turnDone) { setStatus("Connecting..."); console.log("Creating PeerConnection."); createPeerConnection();