bugfix
This commit is contained in:
parent
48314a0bd1
commit
afb965dc9c
@ -32,6 +32,7 @@ bricks.Signaling = class {
|
|||||||
this.handlers = {};
|
this.handlers = {};
|
||||||
this.sessionhandlers = {};
|
this.sessionhandlers = {};
|
||||||
this.init_websocket();
|
this.init_websocket();
|
||||||
|
this.hb_task = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
init_websocket(){
|
init_websocket(){
|
||||||
@ -43,6 +44,13 @@ bricks.Signaling = class {
|
|||||||
}
|
}
|
||||||
reconnect(){
|
reconnect(){
|
||||||
console.log('eror happened');
|
console.log('eror happened');
|
||||||
|
if (this.hb_task){
|
||||||
|
this.hb_task.cancel();
|
||||||
|
this.hb_task = null;
|
||||||
|
}
|
||||||
|
if (this.onclose){
|
||||||
|
this.onclose();
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
try {
|
try {
|
||||||
this.socket.close();
|
this.socket.close();
|
||||||
@ -122,6 +130,9 @@ bricks.Signaling = class {
|
|||||||
type:'login',
|
type:'login',
|
||||||
}
|
}
|
||||||
this.send_data(d);
|
this.send_data(d);
|
||||||
|
if (this.heartbeat_period){
|
||||||
|
this.hb_task = schedule_once(this.login.bind(this), this.heartbeat_period);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logout(){
|
logout(){
|
||||||
|
@ -108,15 +108,16 @@ var schedule_once = function(f, t){
|
|||||||
t:time in second unit
|
t:time in second unit
|
||||||
*/
|
*/
|
||||||
t = t * 1000
|
t = t * 1000
|
||||||
window.setTimeout(f, t);
|
return window.setTimeout(f, t);
|
||||||
}
|
}
|
||||||
|
|
||||||
var schedule_interval = function(f, t){
|
var schedule_interval = function(f, t){
|
||||||
var mf = function(func, t){
|
var mf = function(func, t){
|
||||||
|
console.log('arguments:', func, t);
|
||||||
func();
|
func();
|
||||||
schedule_once(f, t);
|
return schedule_once(mf.bind(func, t), t);
|
||||||
}
|
}
|
||||||
schedule_once(mf.bind(f,t), t);
|
return schedule_once(mf.bind(f,t), t);
|
||||||
}
|
}
|
||||||
|
|
||||||
var debug = function(){
|
var debug = function(){
|
||||||
|
@ -41,6 +41,7 @@ bricks.Video = class extends bricks.Layout {
|
|||||||
this.hidedbtn.hide();
|
this.hidedbtn.hide();
|
||||||
this.add_widget(this.hidedbtn);
|
this.add_widget(this.hidedbtn);
|
||||||
}
|
}
|
||||||
|
|
||||||
destroy_resource(params, event){
|
destroy_resource(params, event){
|
||||||
var w = event.target.bricks_widget;
|
var w = event.target.bricks_widget;
|
||||||
if (! w.parent){
|
if (! w.parent){
|
||||||
|
Loading…
Reference in New Issue
Block a user