From 8655aef6298d34f1895f6555b063ceabd0120051 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=A9grier?= Date: Fri, 28 Aug 2020 16:29:21 +0200 Subject: [PATCH] Fixing URL passing in WebRtc setup --- front/src/WebRtc/ScreenSharingPeer.ts | 2 +- front/src/WebRtc/VideoPeer.ts | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/front/src/WebRtc/ScreenSharingPeer.ts b/front/src/WebRtc/ScreenSharingPeer.ts index 3774c612..8857274e 100644 --- a/front/src/WebRtc/ScreenSharingPeer.ts +++ b/front/src/WebRtc/ScreenSharingPeer.ts @@ -24,7 +24,7 @@ export class ScreenSharingPeer extends Peer { urls: 'stun:stun.l.google.com:19302' }, { - urls: TURN_SERVER, + urls: TURN_SERVER.split(','), username: TURN_USER, credential: TURN_PASSWORD }, diff --git a/front/src/WebRtc/VideoPeer.ts b/front/src/WebRtc/VideoPeer.ts index 0124eee5..33422433 100644 --- a/front/src/WebRtc/VideoPeer.ts +++ b/front/src/WebRtc/VideoPeer.ts @@ -19,7 +19,7 @@ export class VideoPeer extends Peer { urls: 'stun:stun.l.google.com:19302' }, { - urls: TURN_SERVER, + urls: TURN_SERVER.split(','), username: TURN_USER, credential: TURN_PASSWORD }, @@ -27,6 +27,23 @@ export class VideoPeer extends Peer { } }); + console.log('PEER SETUP ', { + initiator: initiator ? initiator : false, + reconnectTimer: 10000, + config: { + iceServers: [ + { + urls: 'stun:stun.l.google.com:19302' + }, + { + urls: TURN_SERVER, + username: TURN_USER, + credential: TURN_PASSWORD + }, + ] + } + }) + //start listen signal for the peer connection this.on('signal', (data: unknown) => { this.sendWebrtcSignal(data);