Fixes crash on non HTTPS sites.

This commit is contained in:
paweldomas 2014-08-26 13:02:17 +02:00
parent 5ccb720ecc
commit e94c4238d1
1 changed files with 2 additions and 8 deletions

10
app.js
View File

@ -144,16 +144,10 @@ function connect(jid, password) {
}
/**
* 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).
* We ask for audio and video combined stream in order to get permissions and
* not to ask twice.
*/
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'],