Kaynağa Gözat

Logs an error which occurred when trying to obtain video stream to be used after screen sharing.

master
paweldomas 10 yıl önce
ebeveyn
işleme
cd8af2a823
1 değiştirilmiş dosya ile 11 ekleme ve 8 silme
  1. 11
    8
      modules/desktopsharing/desktopsharing.js

+ 11
- 8
modules/desktopsharing/desktopsharing.js Dosyayı Görüntüle

@@ -33,15 +33,15 @@ function newStreamCreated(track) {
33 33
     eventEmitter.emit(DSEvents.NEW_STREAM_CREATED, track, streamSwitchDone);
34 34
 }
35 35
 
36
-function getVideoStreamFailed() {
37
-    console.error("Failed to obtain the stream to switch to");
36
+function getVideoStreamFailed(error) {
37
+    console.error("Failed to obtain the stream to switch to", error);
38 38
     switchInProgress = false;
39 39
     isUsingScreenStream = false;
40 40
     newStreamCreated(null);
41 41
 }
42 42
 
43
-function getDesktopStreamFailed() {
44
-    console.error("Failed to obtain the stream to switch to");
43
+function getDesktopStreamFailed(error) {
44
+    console.error("Failed to obtain the stream to switch to", error);
45 45
     switchInProgress = false;
46 46
 }
47 47
 
@@ -97,14 +97,17 @@ module.exports = {
97 97
         } else {
98 98
             type = "video";
99 99
         }
100
-        var fail = () => {
100
+        var fail = (error) => {
101 101
             if (type === 'desktop') {
102
-                getDesktopStreamFailed();
102
+                getDesktopStreamFailed(error);
103 103
             } else {
104
-                getVideoStreamFailed();
104
+                getVideoStreamFailed(error);
105 105
             }
106 106
         };
107 107
         APP.conference.createLocalTracks(type).then((tracks) => {
108
+            // FIXME does it mean that 'not track.length' == GUM failed ?
109
+            // And will this ever happen if promise is supposed to fail in GUM
110
+            // failed case ?
108 111
             if (!tracks.length) {
109 112
                 fail();
110 113
                 return;
@@ -125,7 +128,7 @@ module.exports = {
125 128
                     config.desktopSharingFirefoxExtensionURL);
126 129
                 return;
127 130
             }
128
-            fail();
131
+            fail(error);
129 132
         });
130 133
     }
131 134
 };

Loading…
İptal
Kaydet