Procházet zdrojové kódy

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

j8
paweldomas před 11 roky
rodič
revize
a049bcde71
1 změnil soubory, kde provedl 6 přidání a 0 odebrání
  1. 6
    0
      app.js

+ 6
- 0
app.js Zobrazit soubor

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

Načítá se…
Zrušit
Uložit