From 80dc0a51d94d177c56e2b79a8649bd4c3654efbe Mon Sep 17 00:00:00 2001 From: Pontus Persson Date: Fri, 8 Dec 2017 15:28:32 +0100 Subject: [PATCH] Modularize config. --- client/config.js | 6 ++++++ client/webrtc.js | 9 ++------- 2 files changed, 8 insertions(+), 7 deletions(-) create mode 100644 client/config.js diff --git a/client/config.js b/client/config.js new file mode 100644 index 0000000..3e07031 --- /dev/null +++ b/client/config.js @@ -0,0 +1,6 @@ +export const peerConnectionConfig = { + 'iceServers': [ + {'urls': 'stun:stun.services.mozilla.com'}, + {'urls': 'stun:stun.l.google.com:19302'}, + ], +}; diff --git a/client/webrtc.js b/client/webrtc.js index 6a98dea..a863fda 100755 --- a/client/webrtc.js +++ b/client/webrtc.js @@ -1,3 +1,5 @@ +import { peerConnectionConfig } from './config.js'; + var localVideo; var localStream; var remoteVideo; @@ -11,13 +13,6 @@ var dataChannelOptions = { maxRetransmitTime: 500, // in milliseconds }; -var peerConnectionConfig = { - 'iceServers': [ - {'urls': 'stun:stun.services.mozilla.com'}, - {'urls': 'stun:stun.l.google.com:19302'}, - ] -}; - function pageReady() { document.querySelector("button#start") .addEventListener("click", start);