|
@@ -35,11 +35,12 @@ initLogger('Debug');
|
|
|
path: '/ws',
|
|
|
})
|
|
|
export class MetaGateway
|
|
|
- implements OnGatewayInit, OnGatewayConnection, OnGatewayDisconnect {
|
|
|
+ implements OnGatewayInit, OnGatewayConnection, OnGatewayDisconnect
|
|
|
+{
|
|
|
constructor(
|
|
|
private readonly sceneService: SceneService,
|
|
|
private readonly configService: ConfigService,
|
|
|
- ) { }
|
|
|
+ ) {}
|
|
|
private logger: Logger = new Logger('MetaGateway');
|
|
|
private peer: PeerConnection = null;
|
|
|
private timer: NodeJS.Timeout;
|
|
@@ -272,14 +273,15 @@ export class MetaGateway
|
|
|
client_os: '',
|
|
|
fe_version: '',
|
|
|
};
|
|
|
- this.startstreamingSub = this.sceneService.startSteaming.subscribe((val) => {
|
|
|
- if (val) {
|
|
|
- console.log('onSteaming-start', val);
|
|
|
- client.send(JSON.stringify(startReply));
|
|
|
- }
|
|
|
- // debugger
|
|
|
- });
|
|
|
- } catch (error) { }
|
|
|
+ this.startstreamingSub = this.sceneService.startSteaming.subscribe(
|
|
|
+ (val) => {
|
|
|
+ if (val) {
|
|
|
+ console.log('onSteaming-start', val);
|
|
|
+ client.send(JSON.stringify(startReply));
|
|
|
+ }
|
|
|
+ },
|
|
|
+ );
|
|
|
+ } catch (error) {}
|
|
|
}
|
|
|
|
|
|
handleConnection(client: WebSocket, ...args: any[]) {
|
|
@@ -316,5 +318,6 @@ export class MetaGateway
|
|
|
this.logger.log(`Client disconnected: ${client.id}`);
|
|
|
this.peer && this.peer.close();
|
|
|
this.startstreamingSub & this.startstreamingSub.unsubscribe();
|
|
|
+ this.sceneService.stopStream();
|
|
|
}
|
|
|
}
|