Fix webrtc

This commit is contained in:
gparant 2020-05-02 00:31:44 +02:00
parent e06b20fe96
commit c7f8f92e85
2 changed files with 4 additions and 4 deletions

View File

@ -222,7 +222,7 @@ export class IoSocketController{
} }
arrayMap.forEach((value : any) => { arrayMap.forEach((value : any) => {
let roomId = value[0]; 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.seTimeOutInProgress = setTimeout(() => {
this.shareUsersPosition(); this.shareUsersPosition();

View File

@ -97,7 +97,7 @@ export class SimplePeer {
}); });
//add lof info PeerConnexionArray //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) => { this.PeerConnexionArray[user.userId].on('signal', (data: any) => {
console.info("createPeerConnexion => sendWebrtcSignal : "+user.userId, data); console.info("createPeerConnexion => sendWebrtcSignal : "+user.userId, data);
@ -138,8 +138,8 @@ export class SimplePeer {
*/ */
private receiveWebrtcSignal(message: string) { private receiveWebrtcSignal(message: string) {
let data = JSON.parse(message); let data = JSON.parse(message);
console.log("receiveWebrtcSignal", data); console.log("receiveWebrtcSignal", data.userId);
console.log("this.PeerConnexionArray[data.userId]", this.PeerConnexionArray[data.userId]); console.log("receiveWebrtcSignal => data", data);
if(!this.PeerConnexionArray[data.userId]){ if(!this.PeerConnexionArray[data.userId]){
return; return;
} }