Add STUN_SERVER env variable with fallback

default: "stun:stun.l.google.com:19302"

Make STUN_SERVER available for app config

Change also the STUN_SERVER for ScreenSharingPeer
This commit is contained in:
Sebastian Wiesendahl 2021-02-08 20:46:26 +01:00
parent adb535d1b6
commit b6807d274b
4 changed files with 20 additions and 6 deletions

View file

@ -1,6 +1,6 @@
import * as SimplePeerNamespace from "simple-peer";
import {mediaManager} from "./MediaManager";
import {TURN_PASSWORD, TURN_SERVER, TURN_USER} from "../Enum/EnvironmentVariable";
import {STUN_SERVER, TURN_PASSWORD, TURN_SERVER, TURN_USER} from "../Enum/EnvironmentVariable";
import {RoomConnection} from "../Connexion/RoomConnection";
const Peer: SimplePeerNamespace.SimplePeer = require('simple-peer');
@ -21,7 +21,7 @@ export class VideoPeer extends Peer {
config: {
iceServers: [
{
urls: 'stun:stun.l.google.com:19302'
urls: STUN_SERVER.split(',')
},
{
urls: TURN_SERVER.split(','),
@ -38,7 +38,7 @@ export class VideoPeer extends Peer {
config: {
iceServers: [
{
urls: 'stun:stun.l.google.com:19302'
urls: STUN_SERVER.split(',')
},
{
urls: TURN_SERVER.split(','),