AppRTC: Alert the user to failure to acquire TURN server.

Hopefully will result in quicker turnaround time for CEOD/turnserver fixes.
Might trigger undesirable levels of bogus/spammy/unhelpful/PEBCAK reports to
discuss-webrtc, in which case I'll remove the second part of the message.

R=juberti@google.com, juberti@webrtc.org

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5343 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/samples/js/apprtc/js/main.js b/samples/js/apprtc/js/main.js
index 6c261b1..3c0b73e 100644
--- a/samples/js/apprtc/js/main.js
+++ b/samples/js/apprtc/js/main.js
@@ -20,6 +20,7 @@
 var isAudioMuted = false;
 // Types of gathered ICE Candidates.
 var gatheredIceCandidateTypes = { Local: {}, Remote: {} };
+var infoDivErrors = [];
 
 function initialize() {
   if (errorMessages.length > 0) {
@@ -105,7 +106,12 @@
       }
     }
   } else {
-    console.log('Request for TURN server failed.');
+    var msg =
+        'No TURN server; unlikely that media will traverse networks.  ' +
+        'If this persists please report it to discuss-webrtc@googlegroups.com.';
+    console.log(msg);
+    infoDivErrors.push(msg);
+    updateInfoDiv();
   }
   // If TURN request failed, continue the call with default STUN.
   turnDone = true;
@@ -454,17 +460,29 @@
   }
   var div = getInfoDiv();
   div.innerHTML = contents + "</pre>";
+
+  for (var msg in infoDivErrors) {
+    div.innerHTML += '<p style="background-color: red; color: yellow;">' +
+                     infoDivErrors[msg] + '</p>';
+  }
+  if (infoDivErrors.length)
+    showInfoDiv();
 }
 
-function toggleInfoDivDisplay() {
+function toggleInfoDiv() {
   var div = getInfoDiv();
   if (div.style.display == "block") {
     div.style.display = "none";
   } else {
-    div.style.display = "block";
+    showInfoDiv();
   }
 }
 
+function showInfoDiv() {
+  var div = getInfoDiv();
+  div.style.display = "block";
+}
+
 function toggleVideoMute() {
   // Call the getVideoTracks method via adapter.js.
   videoTracks = localStream.getVideoTracks();
@@ -533,7 +551,7 @@
       toggleVideoMute();
       return false;
     case 73:
-      toggleInfoDivDisplay();
+      toggleInfoDiv();
       return false;
     default:
       return;