mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-31 08:21:59 +02:00
Clean websocket signal properly
This commit is contained in:
@@ -292,12 +292,16 @@ class ClapperPlayerBase extends GstPlayer.Player
|
|||||||
this.webserver = new WebServer(settings.get_int('webserver-port'));
|
this.webserver = new WebServer(settings.get_int('webserver-port'));
|
||||||
|
|
||||||
this.webserver.startListening();
|
this.webserver.startListening();
|
||||||
this.websocketSignal = this.webserver.connect(
|
|
||||||
'websocket-data', this._onWsData.bind(this)
|
if(!this.websocketSignal) {
|
||||||
);
|
this.websocketSignal = this.webserver.connect(
|
||||||
|
'websocket-data', this._onWsData.bind(this)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if(this.webserver) {
|
else if(this.webserver) {
|
||||||
this.webserver.disconnect(this.websocketSignal);
|
this.webserver.disconnect(this.websocketSignal);
|
||||||
|
this.websocketSignal = null;
|
||||||
this.webserver.stopListening();
|
this.webserver.stopListening();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user