diff --git a/static/checks.js b/static/checks.js index 180c537..f5f6c94 100644 --- a/static/checks.js +++ b/static/checks.js @@ -12,7 +12,7 @@ var webrtcChecks = { if (!navigator.mozGetUserMedia) return false; try { - var dummy = new window.mozRTCPeerConnection() + var dummy = new window.mozRTCPeerConnection({iceServers: []}); } catch (x) { return false; } @@ -24,8 +24,14 @@ var webrtcChecks = { }, checkSidebarSupport: function webrtc_checkSidebarSupport() { - if (!this.hasWebRTC() || !this.hasBrowserId()) + if (!this.hasWebRTC()) this.displaySidebarWarning(); + + if (!this.hasBrowserId()) { + gHasInternetAccess = false; + $("#guest").show(); + startGuest(); + } }, displayWarning: function webrtc_displayWarning() { diff --git a/static/media.js b/static/media.js index 6108618..411133b 100644 --- a/static/media.js +++ b/static/media.js @@ -1,3 +1,5 @@ +var gHasInternetAccess = true; + // This object currently assumes the following elements are defined in the web page for calls: // remoteVideo, remoteAudio, localVideo, localAudio var webrtcMedia = { @@ -101,7 +103,10 @@ var webrtcMedia = { _createBasicPc: function webrtcMedia_createBasicPc(aWin, aPerson, aOriginator, aAudioOnly, aConnectionCallback, aDataConnectionCallback) { - var pc = new aWin.mozRTCPeerConnection(); + var params; + if (!gHasInternetAccess) + params = {iceServers: []}; + var pc = new aWin.mozRTCPeerConnection(params); pc.onaddstream = function(obj) { var type = obj.type; if (type == "video") {