Fix webrtc
authorgparant <g.parant@thecodingmachine.com>
Fri, 1 May 2020 22:31:44 +0000 (00:31 +0200)
committergparant <g.parant@thecodingmachine.com>
Fri, 1 May 2020 22:31:44 +0000 (00:31 +0200)
back/src/Controller/IoSocketController.ts
front/src/WebRtc/SimplePeer.ts

index 3a17242aeee4e0dfeb365dcf28cd075eb8cde331..967c78a5dec8853c23463ea6bae5165a204c65f1 100644 (file)
@@ -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();
index 60a2c5a9445cb6b3dcdd01648251510e17d2e4c1..776ed470178efe42f4aa7bac54ad2c76775c5f7b 100644 (file)
@@ -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;
         }