|
|
|
@ -44,19 +44,19 @@ define([ |
|
|
|
var td = null; |
|
|
|
var td = null; |
|
|
|
$window.testDisconnect = function() { |
|
|
|
$window.testDisconnect = function() { |
|
|
|
if (td) { |
|
|
|
if (td) { |
|
|
|
window.clearInterval(td); |
|
|
|
$window.clearInterval(td); |
|
|
|
td = null; |
|
|
|
td = null; |
|
|
|
console.info("Stopped disconnector."); |
|
|
|
console.info("Stopped disconnector."); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
td = window.setInterval(function() { |
|
|
|
td = $window.setInterval(function() { |
|
|
|
console.info("Test disconnect!"); |
|
|
|
console.info("Test disconnect!"); |
|
|
|
connector.conn.close(); |
|
|
|
connector.conn.close(); |
|
|
|
}, 10000); |
|
|
|
}, 10000); |
|
|
|
console.info("Started disconnector."); |
|
|
|
console.info("Started disconnector."); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
return { |
|
|
|
var mediaStream = { |
|
|
|
version: version, |
|
|
|
version: version, |
|
|
|
url: url, |
|
|
|
url: url, |
|
|
|
config: context.Cfg, |
|
|
|
config: context.Cfg, |
|
|
|
@ -64,6 +64,15 @@ define([ |
|
|
|
connector: connector, |
|
|
|
connector: connector, |
|
|
|
api: api, |
|
|
|
api: api, |
|
|
|
tokens: tokens, |
|
|
|
tokens: tokens, |
|
|
|
|
|
|
|
url: { |
|
|
|
|
|
|
|
room: function(id) { |
|
|
|
|
|
|
|
id = $window.encodeURIComponent(id); |
|
|
|
|
|
|
|
return $window.location.protocol+'//'+$window.location.host+context.Cfg.B+id; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
api: function(path) { |
|
|
|
|
|
|
|
return (context.Cfg.B || "/") + "api/v1/" + path; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
initialize: function($rootScope, translation) { |
|
|
|
initialize: function($rootScope, translation) { |
|
|
|
|
|
|
|
|
|
|
|
var cont = false; |
|
|
|
var cont = false; |
|
|
|
@ -151,7 +160,7 @@ define([ |
|
|
|
} |
|
|
|
} |
|
|
|
}, prompt); |
|
|
|
}, prompt); |
|
|
|
}; |
|
|
|
}; |
|
|
|
var url = (context.Cfg.B || "/") + "api/v1/tokens"; |
|
|
|
var url = mediaStream.url.api("tokens"); |
|
|
|
var check = function(code) { |
|
|
|
var check = function(code) { |
|
|
|
$http({ |
|
|
|
$http({ |
|
|
|
method: "POST", |
|
|
|
method: "POST", |
|
|
|
@ -191,7 +200,9 @@ define([ |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return mediaStream; |
|
|
|
|
|
|
|
|
|
|
|
}]; |
|
|
|
}]; |
|
|
|
|
|
|
|
|
|
|
|
|