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
This commit is contained in:
fischman@webrtc.org 2014-01-06 23:46:53 +00:00
parent acc05ac7d1
commit 0b7d8e6fcb

View File

@ -20,6 +20,7 @@ var isVideoMuted = false;
var isAudioMuted = false;
// Types of gathered ICE Candidates.
var gatheredIceCandidateTypes = { Local: {}, Remote: {} };
var infoDivErrors = [];
function initialize() {
if (errorMessages.length > 0) {
@ -105,7 +106,12 @@ function onTurnResult() {
}
}
} 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 @@ function updateInfoDiv() {
}
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 @@ document.onkeydown = function(event) {
toggleVideoMute();
return false;
case 73:
toggleInfoDivDisplay();
toggleInfoDiv();
return false;
default:
return;