Fix remove video reconnect bug

This commit is contained in:
calzoneman 2014-08-21 20:32:58 -05:00
parent b3c3ee93ce
commit 53971af737
1 changed files with 14 additions and 8 deletions

View File

@ -893,7 +893,7 @@ Callbacks = {
}, },
mediaUpdate: function(data) { mediaUpdate: function(data) {
if ($("body").hasClass("chatOnly")) { if ($("body").hasClass("chatOnly") || $("#videowrap").length === 0) {
return; return;
} }
@ -1071,16 +1071,22 @@ Callbacks = {
} }
} }
var SOCKET_DEBUG = true; var SOCKET_DEBUG = false;
setupCallbacks = function() { setupCallbacks = function() {
for(var key in Callbacks) { for(var key in Callbacks) {
(function(key) { (function(key) {
socket.on(key, function(data) { socket.on(key, function(data) {
if (SOCKET_DEBUG) { if (SOCKET_DEBUG) {
console.log(key, data); console.log(key, data);
} }
Callbacks[key](data); try {
}); Callbacks[key](data);
} catch (e) {
if (SOCKET_DEBUG) {
console.log("EXCEPTION: " + e.stack);
}
}
});
})(key); })(key);
} }
} }