From 5617c195e8bbcc15519b29fcbcffba33f6bd9b72 Mon Sep 17 00:00:00 2001 From: Bryan Arbelo Date: Tue, 11 Apr 2017 08:52:14 +1000 Subject: [PATCH 1/4] =?UTF-8?q?updated=20logic=20so=20we=20don=E2=80=99t?= =?UTF-8?q?=20use=20undefined=20values?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 2b4439f..e34baf9 100644 --- a/index.js +++ b/index.js @@ -73,7 +73,7 @@ exports.couple = require('./couple'); **/ exports.createConnection = function(opts, constraints) { var plugin = findPlugin((opts || {}).plugins); - var PeerConnection = (opts || {}).RTCPeerConnection || RTCPeerConnection; + var PeerConnection = (opts != undefined && opts.RTCPeerConnection != undefined) ? opts.RTCPeerConnection : RTCPeerConnection; // generate the config based on options provided var config = gen.config(opts); From 1f55c5de423d34a0d87413164e1639920303cafa Mon Sep 17 00:00:00 2001 From: Bryan Arbelo Date: Tue, 11 Apr 2017 09:29:44 +1000 Subject: [PATCH 2/4] updated --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index e34baf9..0463f89 100644 --- a/index.js +++ b/index.js @@ -73,7 +73,7 @@ exports.couple = require('./couple'); **/ exports.createConnection = function(opts, constraints) { var plugin = findPlugin((opts || {}).plugins); - var PeerConnection = (opts != undefined && opts.RTCPeerConnection != undefined) ? opts.RTCPeerConnection : RTCPeerConnection; + var PeerConnection = (opts != undefined && opts.RTCPeerConnection != undefined) ? opts.RTCPeerConnection : window.RTCPeerConnection; //use window so the variable will not be parsed by the minificator engine and it will not be an undefined variable when running this on ios // generate the config based on options provided var config = gen.config(opts); From 86819735051d6908121ae5fc5b2408d6af8acb19 Mon Sep 17 00:00:00 2001 From: Bryan Arbelo Date: Tue, 11 Apr 2017 09:52:26 +1000 Subject: [PATCH 3/4] made code more similar to original to smooth conversations --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 0463f89..f452150 100644 --- a/index.js +++ b/index.js @@ -73,7 +73,7 @@ exports.couple = require('./couple'); **/ exports.createConnection = function(opts, constraints) { var plugin = findPlugin((opts || {}).plugins); - var PeerConnection = (opts != undefined && opts.RTCPeerConnection != undefined) ? opts.RTCPeerConnection : window.RTCPeerConnection; //use window so the variable will not be parsed by the minificator engine and it will not be an undefined variable when running this on ios + var PeerConnection = (opts || {}).RTCPeerConnection || (RTCPeerConnection || window.RTCPeerConnection); //use window so the variable will not be parsed by the minificator engine and it will not be an undefined variable when running this onios // generate the config based on options provided var config = gen.config(opts); From 0373ab14c3e5a436e80352b6ed3c2f42f1c73f44 Mon Sep 17 00:00:00 2001 From: Bryan Arbelo Date: Tue, 11 Apr 2017 13:19:44 +1000 Subject: [PATCH 4/4] updated pr with comment --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index f452150..36f9e05 100644 --- a/index.js +++ b/index.js @@ -73,7 +73,7 @@ exports.couple = require('./couple'); **/ exports.createConnection = function(opts, constraints) { var plugin = findPlugin((opts || {}).plugins); - var PeerConnection = (opts || {}).RTCPeerConnection || (RTCPeerConnection || window.RTCPeerConnection); //use window so the variable will not be parsed by the minificator engine and it will not be an undefined variable when running this onios + var PeerConnection = (opts || {}).RTCPeerConnection || RTCPeerConnection; // generate the config based on options provided var config = gen.config(opts); @@ -85,5 +85,5 @@ exports.createConnection = function(opts, constraints) { return plugin.createConnection(config, constraints); } - return new PeerConnection(config, constraints); + return new PeerConnection(config, constraints);//if you find an exception here creating an instance of PeerConnection, try passing RTCPeerConnection option to the options on the quickconnect initialization };