浏览代码

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

master
paweldomas 11 年前
父节点
当前提交
a049bcde71
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6
    0
      app.js

+ 6
- 0
app.js 查看文件

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

正在加载...
取消
保存