From c7f8f92e85e6c445b9c6e64d18d55643a6150cad Mon Sep 17 00:00:00 2001 From: gparant Date: Sat, 2 May 2020 00:31:44 +0200 Subject: [PATCH] Fix webrtc --- back/src/Controller/IoSocketController.ts | 2 +- front/src/WebRtc/SimplePeer.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/back/src/Controller/IoSocketController.ts b/back/src/Controller/IoSocketController.ts index 3a17242a..967c78a5 100644 --- a/back/src/Controller/IoSocketController.ts +++ b/back/src/Controller/IoSocketController.ts @@ -222,7 +222,7 @@ export class IoSocketController{ } arrayMap.forEach((value : any) => { let roomId = value[0]; - this.Io.in(roomId).emit('user-position', JSON.stringify(arrayMap)); + this.Io.in(roomId).emit(SockerIoEvent.USER_POSITION, JSON.stringify(arrayMap)); }); this.seTimeOutInProgress = setTimeout(() => { this.shareUsersPosition(); diff --git a/front/src/WebRtc/SimplePeer.ts b/front/src/WebRtc/SimplePeer.ts index 60a2c5a9..776ed470 100644 --- a/front/src/WebRtc/SimplePeer.ts +++ b/front/src/WebRtc/SimplePeer.ts @@ -97,7 +97,7 @@ export class SimplePeer { }); //add lof info PeerConnexionArray - this.PeerConnexionArray[user.userId]._debug = console.info; + //this.PeerConnexionArray[user.userId]._debug = console.info; this.PeerConnexionArray[user.userId].on('signal', (data: any) => { console.info("createPeerConnexion => sendWebrtcSignal : "+user.userId, data); @@ -138,8 +138,8 @@ export class SimplePeer { */ private receiveWebrtcSignal(message: string) { let data = JSON.parse(message); - console.log("receiveWebrtcSignal", data); - console.log("this.PeerConnexionArray[data.userId]", this.PeerConnexionArray[data.userId]); + console.log("receiveWebrtcSignal", data.userId); + console.log("receiveWebrtcSignal => data", data); if(!this.PeerConnexionArray[data.userId]){ return; }