Ver código fonte

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

master
paweldomas 11 anos atrás
pai
commit
a049bcde71
1 arquivos alterados com 6 adições e 0 exclusões
  1. 6
    0
      app.js

+ 6
- 0
app.js Ver arquivo

@@ -63,10 +63,16 @@ function init() {
63 63
 }
64 64
 
65 65
 /**
66
+ * HTTPS only:
66 67
  * We first ask for audio and video combined stream in order to get permissions and not to ask twice.
67 68
  * Then we dispose the stream and continue with separate audio, video streams(required for desktop sharing).
68 69
  */
69 70
 function obtainAudioAndVideoPermissions(callback){
71
+    // This makes sense only on https sites otherwise we'll be asked for permissions every time
72
+    if(location.protocol !== 'https:') {
73
+        callback();
74
+        return;
75
+    }
70 76
     // Get AV
71 77
     getUserMediaWithConstraints(
72 78
         ['audio', 'video'],

Carregando…
Cancelar
Salvar