Browse Source

ref(conference): try video only

Will make an attempt to create video only stream in case microphone
permissions were not granted.
j8
paweldomas 8 years ago
parent
commit
63377a2f76
1 changed files with 11 additions and 3 deletions
  1. 11
    3
      conference.js

+ 11
- 3
conference.js View File

@@ -134,7 +134,8 @@ function connect(roomName) {
134 134
  */
135 135
 function createInitialLocalTracksAndConnect(roomName) {
136 136
     let audioAndVideoError,
137
-        audioOnlyError;
137
+        audioOnlyError,
138
+        videoOnlyError;
138 139
 
139 140
     JitsiMeetJS.mediaDevices.addEventListener(
140 141
         JitsiMeetJS.events.mediaDevices.PERMISSION_PROMPT_IS_SHOWN,
@@ -152,8 +153,14 @@ function createInitialLocalTracksAndConnect(roomName) {
152 153
             return createLocalTracks({ devices: ['audio'] }, true);
153 154
         })
154 155
         .catch(err => {
155
-            // If audio failed too then just return empty array for tracks.
156 156
             audioOnlyError = err;
157
+
158
+            // Try video only...
159
+            return createLocalTracks({ devices: ['video'] }, true);
160
+        })
161
+        .catch(err => {
162
+            videoOnlyError = err;
163
+
157 164
             return [];
158 165
         });
159 166
 
@@ -165,7 +172,8 @@ function createInitialLocalTracksAndConnect(roomName) {
165 172
                     // If both requests for 'audio' + 'video' and 'audio' only
166 173
                     // failed, we assume that there is some problems with user's
167 174
                     // microphone and show corresponding dialog.
168
-                    APP.UI.showDeviceErrorDialog(audioOnlyError, null);
175
+                    APP.UI.showDeviceErrorDialog(
176
+                        audioOnlyError, videoOnlyError);
169 177
                 } else {
170 178
                     // If request for 'audio' + 'video' failed, but request for
171 179
                     // 'audio' only was OK, we assume that we had problems with

Loading…
Cancel
Save