Obtaining audio+video stream and closing it in order to reduce permission queries makes sense only on HTTPS sites.

This commit is contained in:
paweldomas 2014-03-25 10:30:28 +01:00
parent 68b8512b27
commit a049bcde71
1 changed files with 6 additions and 0 deletions

6
app.js
View File

@ -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'],