From: gparant Date: Fri, 1 May 2020 22:31:44 +0000 (+0200) Subject: Fix webrtc X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=c7f8f92e85e6c445b9c6e64d18d55643a6150cad;p=libreadventure.git Fix webrtc --- diff --git a/back/src/Controller/IoSocketController.ts b/back/src/Controller/IoSocketController.ts index 3a17242..967c78a 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 60a2c5a..776ed47 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; }