|
@@ -231,7 +231,7 @@ export class MetaGateway
|
|
const heartPack = new DataView(new ArrayBuffer(4));
|
|
const heartPack = new DataView(new ArrayBuffer(4));
|
|
heartPack.setUint32(0, 2009889916);
|
|
heartPack.setUint32(0, 2009889916);
|
|
this._webrtcInterval = setInterval(() => {
|
|
this._webrtcInterval = setInterval(() => {
|
|
- if (channel.isOpen()) {
|
|
|
|
|
|
+ if (channel && channel.isOpen()) {
|
|
channel.sendMessageBinary(Buffer.from(heartPack.buffer));
|
|
channel.sendMessageBinary(Buffer.from(heartPack.buffer));
|
|
}
|
|
}
|
|
}, 200);
|
|
}, 200);
|
|
@@ -280,8 +280,13 @@ export class MetaGateway
|
|
fe_version: '',
|
|
fe_version: '',
|
|
is_browser: false,
|
|
is_browser: false,
|
|
};
|
|
};
|
|
-
|
|
|
|
- client.send(JSON.stringify(demoVal));
|
|
|
|
|
|
+ this.sceneService.onSteaming.subscribe((val) => {
|
|
|
|
+ if (val) {
|
|
|
|
+ console.log('onSteaming-start', val);
|
|
|
|
+ client.send(JSON.stringify(demoVal));
|
|
|
|
+ }
|
|
|
|
+ // debugger
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
handleConnection(client: WebSocket, ...args: any[]) {
|
|
handleConnection(client: WebSocket, ...args: any[]) {
|