From a049bcde71b9f740843d0c64192fa1c4aa4138a5 Mon Sep 17 00:00:00 2001 From: paweldomas Date: Tue, 25 Mar 2014 10:30:28 +0100 Subject: [PATCH] Obtaining audio+video stream and closing it in order to reduce permission queries makes sense only on HTTPS sites. --- app.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app.js b/app.js index 134db97ca..b76bc450f 100644 --- a/app.js +++ b/app.js @@ -63,10 +63,16 @@ function init() { } /** + * HTTPS only: * We first ask for audio and video combined stream in order to get permissions and not to ask twice. * Then we dispose the stream and continue with separate audio, video streams(required for desktop sharing). */ function obtainAudioAndVideoPermissions(callback){ + // This makes sense only on https sites otherwise we'll be asked for permissions every time + if(location.protocol !== 'https:') { + callback(); + return; + } // Get AV getUserMediaWithConstraints( ['audio', 'video'],