Przeglądaj źródła

Merge pull request #154 from jitsi/desktop_streaming_fix

Fixes JS error on desktop streaming start
dev1
Дамян Минков 9 lat temu
rodzic
commit
25a9d7cd20
1 zmienionych plików z 12 dodań i 10 usunięć
  1. 12
    10
      JitsiConference.js

+ 12
- 10
JitsiConference.js Wyświetl plik

@@ -331,16 +331,18 @@ JitsiConference.prototype.addTrack = function (track) {
331 331
     this.room.addListener(XMPPEvents.SENDRECV_STREAMS_CHANGED,
332 332
         track.ssrcHandler);
333 333
 
334
-    // Report active device to statistics
335
-    var devices = RTC.getCurrentlyAvailableMediaDevices();
336
-    device = devices.find(function (d) {
337
-        return d.kind === track.getTrack().kind + 'input'
338
-            && d.label === track.getTrack().label;
339
-    });
340
-
341
-    Statistics.sendАctiveDeviceListEvent(
342
-        RTC.getEventDataForActiveDevice(device));
343
-
334
+    if(track.isAudioTrack() || (track.isVideoTrack() &&
335
+        track.videoType !== "desktop")) {
336
+        // Report active device to statistics
337
+        var devices = RTC.getCurrentlyAvailableMediaDevices();
338
+        device = devices.find(function (d) {
339
+            return d.kind === track.getTrack().kind + 'input'
340
+                && d.label === track.getTrack().label;
341
+        });
342
+        if(device)
343
+            Statistics.sendАctiveDeviceListEvent(
344
+                RTC.getEventDataForActiveDevice(device));
345
+    }
344 346
     return new Promise(function (resolve, reject) {
345 347
         this.room.addStream(track.getOriginalStream(), function () {
346 348
             if (track.isVideoTrack()) {

Ładowanie…
Anuluj
Zapisz