Added better console logs

This commit is contained in:
Paulin Jorys
2017-07-11 13:20:01 +02:00
parent 2dfdf703fd
commit 4108d696e4
4 changed files with 77 additions and 83 deletions

View File

@@ -5,7 +5,7 @@ var sendMessage = function(method, params) {
return new Promise(function(resolve, reject) {
var id = callbacks_ids++;
callbacks[id] = {'resolve': resolve, 'reject': reject};
common.naclModule.postMessage({
'callbackId': id,
'method': method,
@@ -19,9 +19,9 @@ function handleMessage(msg) {
callbacks[msg.data.callbackId][msg.data.type](msg.data.ret);
delete callbacks[msg.data.callbackId]
} else { // else, it's just info, or an event
console.log(msg.data);
console.log('%c[handleMessage]', 'color:gray;', 'Message data: ', msg.data)
if(msg.data === 'streamTerminated') { // if it's a recognized event, notify the appropriate function
$('#loadingSpinner').css('display', 'none'); // This is a fallback for RTSP handshake failing, which immediately terminates the stream.
$('#loadingSpinner').css('display', 'none'); // This is a fallback for RTSP handshake failing, which immediately terminates the stream.
$('body').css('backgroundColor', '#282C38');
api.refreshServerInfo().then(function (ret) { // refresh the serverinfo to acknowledge the currently running app