Selaa lähdekoodia

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

j8
paweldomas 11 vuotta sitten
vanhempi
commit
a049bcde71
1 muutettua tiedostoa jossa 6 lisäystä ja 0 poistoa
  1. 6
    0
      app.js

+ 6
- 0
app.js Näytä tiedosto

63
 }
63
 }
64
 
64
 
65
 /**
65
 /**
66
+ * HTTPS only:
66
  * We first ask for audio and video combined stream in order to get permissions and not to ask twice.
67
  * We first ask for audio and video combined stream in order to get permissions and not to ask twice.
67
  * Then we dispose the stream and continue with separate audio, video streams(required for desktop sharing).
68
  * Then we dispose the stream and continue with separate audio, video streams(required for desktop sharing).
68
  */
69
  */
69
 function obtainAudioAndVideoPermissions(callback){
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
     // Get AV
76
     // Get AV
71
     getUserMediaWithConstraints(
77
     getUserMediaWithConstraints(
72
         ['audio', 'video'],
78
         ['audio', 'video'],

Loading…
Peruuta
Tallenna