Fixing WebRtc user name / password when using TURN REST API

This commit is contained in:
David Négrier 2021-02-16 18:13:30 +01:00
parent 7fb923f823
commit 6b00355ea8
9 changed files with 65 additions and 18 deletions

View file

@ -28,12 +28,12 @@ export class ScreenSharingPeer extends Peer {
{
urls: STUN_SERVER.split(',')
},
{
TURN_SERVER !== '' ? {
urls: TURN_SERVER.split(','),
username: user.webRtcUser || TURN_USER,
credential: user.webRtcPassword || TURN_PASSWORD
},
]
} : undefined,
].filter((value) => value !== undefined)
}
});

View file

@ -103,7 +103,7 @@ export class SimplePeer {
// This would be symmetrical to the way we handle disconnection.
//start connection
console.log('receiveWebrtcStart. Initiator: ', user.initiator)
//console.log('receiveWebrtcStart. Initiator: ', user.initiator)
if(!user.initiator){
return;
}

View file

@ -34,14 +34,15 @@ export class VideoPeer extends Peer {
{
urls: STUN_SERVER.split(',')
},
{
TURN_SERVER !== '' ? {
urls: TURN_SERVER.split(','),
username: user.webRtcUser || TURN_USER,
credential: user.webRtcPassword || TURN_PASSWORD
},
]
} : undefined,
].filter((value) => value !== undefined)
}
});
this.userId = user.userId;
this.userName = user.name || '';